It’s been a while since I wrote a blog post (over 5 years!) and in republishing my blog, I wanted to ensure a few best-practices were in place. One of those is ensuring that all content is served up over HTTPS.
Thankfully, we’ve come a long way in the past 5 years when it comes to providing a simple and cost free way to serve content using HTTPS – with thanks to the CA LetsEncrypt, you can now generate free SSL certificates with ease:
- Step 1: Head over to the CertBot from EFF
- Select your OS and web server
- Follow the step-by-step guide to install CertBot
- Bam! You’re running under HTTPS
Because Certificates from LetsEncrypt are only valid for 90 days, you need to setup a cronjob to renew the certificate. I do this on a weekly basis as follows:
letsencrypt renew --post-hook "service apache2 reload"
Using “dig” you can determine what IP address or CNAME your domain is pointing to quite easily. However what I didn’t know was that you can actually check what the root server thinks your domain is pointing at, so you can check if its set correctly when you are migrating to a new IP address.
To do this, simply type:
dig domaintolookup.com +trace
Okay, so you’ve accidentally adding a bunch of files to SVN. Or, you need to copy a bunch of files but you don’t want to take the .svn folders with you. How to get rid of these? On any *nix machine (Mac included) you can run the following command:
rm -rf `find . -type d -name .svn`
Fedora Core 5 is currently EOL – it’s not supported any more. As a result, you might find you can’t use yum to install packages any more – you get an error message about this file not existing:
This is because the repositories that yum uses aren’t there anymore. However you can modify the repositories in /etc/yum/repos.d/ and add these to fix the problem:
An example change would be to the /etc/yum/repos.d/fedora-core.repo file:
name=Fedora Core $releasever - $basearch
moint is a fantastic utility that can be installed on Linux or Mac OS X and provides the ability to monitor services running on your server. These could be apache, mysql, bind or any other service you need to be up and running. After installing monit, you create a config file containing information about the services you want to monitor. Monit with then dutifully monitor the service, and email you if they go down. You can even configure it to restart the service if it fails.
Running on top of monit is m/monit, which is a web based service which pools information from all your servers running monit and provides information in a easily accessable format on a web page. You can use this as your monitoring station for your website for instance, as it also includes information such as load average, disk usage and uptime – in addition to the services you are monitoring.
More and more mail servers are starting to reject email if your outgoing mail server doesn’t have a reverse DNS record or PTR record. You can check if you have one by issuing the following command:
dig -x 127.0.0.1
Obviously, replace the 127.0.0.1 address with the relevant IP address of your mail server. You should receive a response like this:
; <<>> DiG 9.4.1-P1 <<>> -x 18.104.22.168
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17269
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;22.214.171.124.in-addr.arpa. IN PTR
;; ANSWER SECTION:
126.96.36.199.in-addr.arpa. 3600 IN PTR myserver.mydomain.com.
;; Query time: 217 msec
;; SERVER: 188.8.131.52#53(184.108.40.206)
;; WHEN: Thu Jul 10 11:09:58 2008
;; MSG SIZE rcvd: 79
If you don't have one setup, you won't get a response in the ANSWER SECTION - so contact your host and ask them to set one up for you. It can help save a lot of headaches when you get bounce-back messages such as:
Could not deliver the message in the time limit specified. Please
retry or contact your administrator.
I have been getting the following error when trying to compile monit for my CentOS server:
make: *** [y.tab.c] Error 127
To resolve it, I simply installed bison:
yum install bison
Then run configure again:
make && make install
And that fixed the problem! Hope that helps someone.
If you are looking for an easy way to find RPMs for your favourite linux distribution, there are many options out there. However none seem to have the easy of use and search capabilites of rpm.pbone.net. The service is easy to use and covers all the major distributions and version. Very handy.
We use Postfix as a dropin replacement for Sendmail on our servers. We wanted to configure postfix to relay email via our internal mail server for internal email addresses, and send directly if the email address was external.
To do this, follow these steps:
- Edit the /etc/postfix/transport file and add the following line:
- Edit the /etc/postfix/main.cf file and add the following line to the end:
transport_maps = hash:/etc/postfix/transport
- Run the following commands at the prompt:
[root@triton postfix]# postfix /etc/postfix/transport
[root@triton postfix]# service postfix restart
And you should be done!
- Google automatically serves them up in Gzip format (if your browser supports this)
- Caching is done by Google – you only have to load a copy once, and it can be used at many sites!
- The servers are really quick
- The servers are physically “close” to users (utilising the Google network)
- They are minified
This is very exciting development, as I use many of these libraries in my applications – and the speed they load direct impacts all users of the software I develop.