dennis's blog
Better Drupal cron jobs with drush
Something which I was wondering about with Drupal was the fact that both cron.php and update.php are public reachable files (Even though you only can reach update.php if you are logged in). Don't think this pose any really danger unless you do heavy tasks in your drupal cron jobs. Anyhow: I decided to change that. In my configuration for Apache I placed something like this:
<FilesMatch "cron.php|update.php">
Order deny,allow
Deny from all
</FilesMatch>Remove https from search engine search results with apache and mod_rewrite
This server is installed with mod_ssl, which means that you can use both https and http. That was just fine, until I discovered that google was duplicating my search results. So that each page was listed first as http://www.os-cms.net and then the exact same page, just as https://www.os-cms.net
The solution was to make two robots text. First the ordinary robots.txt and then make a robots_ssl.txt with this content:
User-agent: *
disallow: /
You need to have mod_rewrite enabled to use the solution: You add the following somewhere in your server setup:
Moved website to slicehost.com
I have moved this website to a virtual server from http://slicehost.com, which seems to be a great hosting company (: so far at least :) You get your own virtual server with the brand of OS that you prefer. Then you start installing what you need: There are some great 'step by step' tutorials about setting up the Server, setting iptabels firewall, setting up ssh tunneling from you computer to the virtual server, and then setting up Apache with mod_SSL, MySQL and PHP. The only limit is off cause brandwidth and usage of hardware.
How to remove Apache and PHP server Signature
Normally when you install a distribution of Linux server software (Apache with a PHP module enabled) there will be a signature in the headers sent to the browser. You can remove those headers quite easily so nobody know what exact versions of software your are using, which is a far more secure solution for your Apache server:
In your php.ini search for expose_php and set it to 'Off' e.g:
expose_php = Off
In your Apache configuration search for 'ServerTokens' (in my case it is located in): /etc/apache2/conf.d/security
Kingston datatraveler ext3 format
I have got a USB pen called Kingston datatraveler with 2 GB of data and I decided to use it as a backup media for my most important files. But first i needed to format it which was very easy actually. My usb pen was on sdf
sudo mkfs.ext3 /dev/sdf
Put a label on it:
sudo e2label /dev/sdf usbpen
You should now be able to see it under places -> Removable media -> USB pen.
Or /media/usbpen (gnome desktop)
Server and website is up
I have set up a server at home to drive a couple of sites. It runs the good old Linux, Apache, MySQL and PHP configuration for serving web clients. I have chosen a minimal Drupal installation as my CMS system as it seemed to be easy to use. The Drupal system has some nice features it seems. It has the option to serve many sites from the same code base. That was the reason why I started out by making a couple of shell scripts for automating the process of making new virtual hosts for Apache, MySQL databases and Drupal installations. You can find those scripts under 'Shell scripts'.