Posts Tagged ‘apache2’

Apache in Ubuntu 8.04

May 13, 2008 2 comments

Apache 2.28 is the current version that ships with Ubuntu 8.04.  There are several meaningful changes.  One of those changes is a much smaller apache2.conf configuration file.  When you look at the apache2.conf you will see one of those changes is that this file now contains only the Global Configuration options.  The config file is only 298 lines as you can see in the example.

291 # Include of directories ignores editors’ and dpkg’s backup files,
292 # see README.Debian for details.
294 # Include generic snippets of statements
295 Include /etc/apache2/conf.d/
297 # Include the virtual host configurations:
298 Include /etc/apache2/sites-enabled/

Ubuntu 8.04 Training CLICK HERE

Note the modular support, which was available in the past as well, but now is more important to understand.  The include statements will help fill out the configuration file with the options in /etc/apache2/conf.d/  provided so applications can add features to apache without directly modifying the file.  Also note that the configuration for virtual servers is found in /etc/apache2/sites-enabled.  These actually have symbolic links to files that you modify in sites-available.

For a tutorial on how to configure Virtual Hosting on Ubuntu 8.04 CLICK HERE.

The apache2.conf file also contains include statements that impact the ports that can be used by the web server and modules which can be used.  The mods-enabled directory contains those modules that have been made available for the web server.  The httpd.conf file is for compatibility with configurations that you may have had with Red Hat or CentOS based distros.

For a tutorial on CentOS Virtual Hosting CLICK HERE.  This will give you a good comparision of the different ways to set up apache.

184 # Include module configuration:
185 Include /etc/apache2/mods-enabled/*.load
186 Include /etc/apache2/mods-enabled/*.conf
188 # Include all the user configurations:
189 Include /etc/apache2/httpd.conf
191 # Include ports listing
192 Include /etc/apache2/ports.conf

The other include line you see is to set the ports that are available to the Web Server.  Looking at the file you can see the default is port 80 and the other SSL option is 443.

Listen 80

<IfModule mod_ssl.c>
Listen 443

Multi-Processing Modules
The MPM (multi-processing modules) are an additional feature for the modular design of apache to make it more flexible for various operating systems and for scalability for servers.  The prefork MPM is the default for Ubuntu 8.04 and provides basic settings that can be modified to help your server scale to whatever load you will need to work with.   Your apache web server will start with 5 web servers running by default.  Each user that comes to your server will need an instance of apache to be able to view your site.  That is why 5 are started immediately so that when users come there are severs already in memory to speed up the process for people to see your site.  If 10 people came at the same time, five new servers would have to be started which will take time, and be noticeable by those trying to view your site.  This is part of the scalability issues is that you need to decide how many people will be on your site at one time.  Just remember that each instance of apache takes resources from your hardware especially in the area of RAM so have sufficient RAM for the machine.  If you site in not very busy you could reduce the “StartServers” number to 3 and save on resources. If it was very busy you may need to increase to 20, etc.  You will need to modify the Minimum and Maximum numbers as well for you server.  The whole idea is to provide excellent scalability for your particular needs.

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
StartServers          5
MinSpareServers       5
MaxSpareServers      10
MaxClients          150
MaxRequestsPerChild   0


Get every new post delivered to your Inbox.

Join 53 other followers