This is part of a write-up of an attempt to use Linux as a "Small Business Server", and describes a simple Apache configuration.
The configuration of the www server is found in /etc/apache2/apache2.conf. This file will refer to a 'webroot' or to virtual directories which will be the root of the hosted websites, . Running a (well configured) web server is rather complex : it's publically accessible, so security is a major issue, and if you're running a 'real' web server, you'll be hosting multiple, most likely dynamic, database-driven web sites with server site scripts and what not.
We've just included a web server in our Small Business Server to allow our small office to run an intranet site - and it's not too complex just to get an intranet with Apache web serverup and running.
The main configuration file. For our intranet, we don't even need to change anything here. Note however the entry ServerRoot "/etc/apache2". In this directoryn you'll find a subdirectory '/etc/apache2/sites-enabled'
This directory contains the files that hold the properties of the sites that this web server can hosts. To create an intranet site, copy the 'default' to 'intranet', then edit it so it looks somthing like this. Mainly you just define the Virtual Host 'intranet' and tell the server that this site's content starts in /srv/http :
NameVirtualHost intranet <VirtualHost intranet> ServerAdmin webmaster@sillysoft DocumentRoot /srv/http/ <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /srv/http/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined ServerSignature On </VirtualHost>
the configuration in .../sites-available does not come online by itself. To enable the intranet site, you need to create a symbolic link in sites-enabled, pointing to the appropriate site in .../sites-available. This allows you to have several sites under development or on standby, and bring them online by simply creating symlinks
The easiest way is to replace the 000-default link by a link that points to your 'intranet' configuration.
populate the intranet
Now, create a home page (index.html) and put it in the document root of 'intranet' (i.e./srv/http).
For your clients to find the web site by name (http://intranet), you now need to add intranet to the DNS database. Then, restart the web server (/etc/init.d/apache2 restart).
Browse to http://intranet and lo and behold : your intranet is onlineWarning : this is the 'out of the box' approach : we've only enabled our intranet and rely completely on Apache's default configuration (including security).
Next steps
If you want a more advanced web server capable of serving dynamic web sites or possibly host a wiki, you'll want to setup apache with mysql and php.