Apache Setup on Ubuntu

November 19, 2008 by John Jenkins · 2 Comments
Filed under: Tools 

I like to have a copy of my blog hosted on my local computer for two reasons. The first, and most important, is that I can try different configurations of the blog without them being visible to the world. The second is that making changes is more immediate on a local server.

The Apache setup on Ubuntu is quite unusual. To activate a module you need to create a link. And, as mod-rewrite isn’t enabled by default you need to execute the following:

$ cd /etc/apache2/mods-enabled
$ sudo ln -s ../mods-available/rewrite.load rewrite.load

For each of my local websites there main setting I need is AllowOverride all to allow .htaccess to set various parameters on a directory by directory basis.

Here is a section of my /etc/apache2/httpd.conf:

ServerName localhost

<VirtualHost *>
    Alias /images "/u/websites/images/"
    <Directory "/u/websites/images/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride all
    </Directory>

    Alias /test-blog "/u/websites/blog/test-blog/"
    <Directory "/u/websites/blog/test-blog/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride all
    </Directory>

    Alias /timepoor "/u/websites/blog/timepoor/"
    <Directory "/u/websites/blog/timepoor/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride all
    </Directory>
</VirtualHost>

Comments

2 Responses to “Apache Setup on Ubuntu”
  1. johnny says:

    4Pq805 Thanks for good post

  2. John Jenkins says:

    Hi Johnny - no worries and welcome to my first commenter!

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!