# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # This contains hits at making apache2 work on ubuntu 14.04. It may help with other releases, too, but that's where I've tested this stuff. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Installation: To make sure the server is properly installed, run: : apt-get update : apt-get install apache2 If you run "ps -ef", you should now see an "apache2" process in a ps listing. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Enabling user directories: : a2enmod userdir : service apache2 restart A lot of online docs about enabling CGI don't mention this, and they don't pay much attention to the use of CGI scripts by users. Some of them actually say you shouldn't allow this. It's also a good idea now to edit /etc/group, and add your userid to any group with "www" in its name. This has been just "www" in the past, but "www-data" now seems common. I'm testing the use of both, with identical uids and gids. So far, this seems to work and makes it unnecessary to change old scripts that use "www". (Changing "www-data" to "www" everywhere also seems to work fine, though hunting down all the uses can take time.) 2016 update: I ran across a case where a newly-installed apache2 failed to start due to use of "www" and "www-data" as the user and/or group id in different places. The simplest solution is probably something like: find . -type f | xargs grep -l www-data This will tell you all the files that contain "www-data", and you can edit them to be just "www". Or if you like www-data, you can search for just www and edit all those files. ;-) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Enabling .htaccess files: The install and config stuff is in the /etc/apache2 directory. It's best to make a backup copy of every file here before editing it, so you can use diff to see what's changed, and to revert to the original easily if you really mess things up. : cd /etc/apache2 : mv apache2.conf apache2.conf-orig : cp apache2.conf-orig apache2.conf : vi apache2.conf Then I find all the uses of AllowOverride, and change the None to All, so I can use .htaccess files to control what happens in web directories. You'll also need to edit mods-enabled/userdir.conf and change the line AllowOverride FileInfo AuthConfig Limit Indexes to AllowOverride All Without this, .htaccess files won't work, and you'll get fatal errors in the server's log file for any directory with a .htaccess file. Don't forget: : service apache2 restart # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Enabling CGI scripts: : a2enmod cgi : service apache2 restart # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Setting up Virtual Hosts: Newer versions of apache2 use /var/www/ as the document root directory, and the virtual-host setup also starts in the same place. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # SSI (Server-Side Includes): Getting this working can be very difficult, because it doesn't seem to be fully documented anywhere. The biggest problem is that when you follow the guides, you often see total failure, with the only sypmtom being "AH00082: an unknown filter was not added: includes" in the error.log file. Most mentions of this say little more than "You must have done something wrong", and suggest that you go over all the details again to see what you missed, which doesn't solve the problem. What I found finally fixed it was noticing that one of the steps (I didn't notice which one) created the file mods-available/include.load in /etc/apache2, and various comments about the changes in apache2's 2.4 directory structures is that to be effective, such files need to be in both the mods-available directory and the mods-enabled directory. A coherent explanation of this is still lacking, but when I tried: ln /etc/apache2/mods-available/include.load /etc/apache2/mods-enabled and restarted the server, SSI commands suddenly started working. A tricky part of this is that the guides all suggest including AddType text/html .shtml AddOutputFilter INCLUDES .shtml to the httpd.conf file. First off, there is no such file in the apache2 2.4.7 that I have. There is an apache2.conf, which seems to contain the same stuff, including these two lines commented out, and SSI doesn't work. If you uncomment the AddType command, no errors appear, but SSI fails as before. If you uncomment the AddOutputFilter command, the "unknown filter" message appears in error.log, and SSI still fails. But you get the error both during server restart and when a download of the .shtml file comes in. So the problem has something to do with something with "include" in its name. The include.load file turns out to be the culprit, which gets installed in only one of the two places where it should be found. Of course, I don't understand much of this yet, so there might be a better explanation of it all somewhere that I don't know about. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #