Moved & a couple of Apache2 tools/tricks

If you can can see this post, then my server move is complete. I have moved this blog across to a dedicated server, provided by my employers, Positive Internet.

So far, I’ve not done too much playing with it, but in case you need to know, adding this in your apache2.conf file will allow it to read .htaccess files in any /home/<username>/public_html/ document roots – handy if you don’t want to use /var/www/ to store all your websites.

<Directory /home/*/public_html>
        AllowOverride All
</Directory>

There are a couple of useful apache2 tools which don’t get a lot of publicity.

a2enmod – enable a mod in apache. You’ll need to reload apache after running it. If you run it without specifying a mod, it will list all available ones.

a2dismod – disable a mod. Again, if you run it without specifying a mod it will list all enabled ones, before giving you a prompt asking which one to disable.

Along similar lines, if you’re using sites-available/sites-enabled to quickly enable/disable vhosts, you can use:

a2ensite – enable a website.

a2dissite – disable a website.

Of course, you can then use apache2ctl graceful to restart the webserver nicely – so the changes take effect, but you don’t close all the connections currently talking to apache.

Have fun!

2 thoughts on “Moved & a couple of Apache2 tools/tricks

  1. James

    One of my favs is apache2ctl configtest which is a nice way to see if you botched anything in the the confs or site files. Easier that rolling the site over to see if everything is buttoned up properly. 😉

  2. Kirrus

    When I was first taught to use and configure apache, I had apache2ctl configtest drummed into me. Now, I use it in reflex after any change, which is invaluable when working on a shared server with over 500 websites on it, as I have to do periodically in the course of my duties at work 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *