The next stage in the process is to let the Apache web server know about our new Mercurial scripts and folders. We’ll start by creating a brand new Apache configuration file for Mercurial and then add that into the default site for Apache. Again you can use pico in place of vi for any of the commands below. First we’ll create a folder to store the configuration file.
sudo mkdir /etc/apache2/hg
Then create the configuration file
sudo vi /etc/apache2/hg/hg.conf
and add the following lines to it…
WSGIScriptAliasMatch /hg /var/hg/hgweb.wsgi
allow from all
Now to add this to the current Apache configuration. I’m going to add it into the default Apache website that was created when Apache was installed. Lets open up the default site configuration file
sudo vi /etc/apache2/sites-available/default
and add the following line to the very end of the document after the line.
Save the file. We can now test to see if everything is working correctly so far by restarting Apache and trying to hit the Mercurial server’s directory. here’s how you restart the Apache server
sudo /etc/init.d/apache2 restart
Then open up a web browser and try to hit http://server.ip.address/hg If you don;t know the server’s IP address then you can type ip addr and it will show it to you on the eth0 line of the results.
In the next stage we will link Apache to our Domino LDAP server.