全部博文(263)
分类: 系统运维
2008-05-20 17:40:15
Apache features configurable , DBMS-based authentication databases, and content negotiation. It is also supported by several graphical user interfaces (GUIs) which permit easier, more intuitive configuration of the server.
Apache2 installation in debian
#apt-get install apache2
This will complete the installation of apache2 web server and now you need to know where the configuration files and document root for your apache web server.
By default all your configuration files are located at /etc/apache2
Default document root for apache2 is /var/www.If you want to change the default document root you need to edit the /etc/apache2/sites-available/default file and look for this line “DocumentRoot /var/www/” here you can change where ever you want to change.For example if you want to change /home/wwww the above line looks like this “DocumentRoot /home/www/”.
The main configuration file located at /etc/apache2/apche2.conf.
Installing php and cgi support for apache2
If you want to add support of php and install the following packages libapache2-mod-php4,php4-cli,php4-common,php4-cgi
#apt-get install libapache2-mod-php4 php4-cli php4-common php4-cgi
This will complete the installation of php support for apache2
If you want to allow the different index files types check for the following line in /etc/apache2/apache2.conf file DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.shtml
Restart the apache server
#/etc/init.d/apache2 restart
Testing your apache Server
You can access you using it should appear the following message
“If you can see this, it means that the installation of the Apache
web server software on this system was successful. You may now add
content to this directory and replace this page.
Recomended module
apache2-mpm-worker
The worker MPM provides a threaded implementation for Apache2. It is considerably faster than the traditional model,and is the recommended MPM.You can install this using the following command.
#apt-get install apache2-mpm-prefork
Other files and folder located under /etc/apache2
conf.d/
Files in this directory are included by this line in apache2.conf:# Include generic snippets of statements Include
/etc/apache2/conf.d
This is a good place to add additional configuration directives.
httpd.conf Empty file.
magic
Magic data for mod_mime_magic Apache module, documented in htdocs/manual/mod/mod_mime_magic.html. You probably don’t need to touch this.
mods-available/
This directory contains a series of .load and .conf files.The .load files contain the Apache configuration directive necessary to load the module in question. The respective .conf files contain configuration directives necessary to utilize the module in question.
mods-enabled/
To actually enable a module for Apache2, it is necessary to create a symlink in this directory to the .load (and .conf, if it exists) files associated with the module in mods-available/.For example:cgi.load -> /etc/apache2/mods-available/cgi.load ports.conf Configuration directives for which ports and IP addresses to listen to.
sites-available/
Like mods-available/, except it contains configuration directives for different that might be used with apache2. Note that the hostname doesn’t have to correspond exactly with the filename. ‘default’ is the default host.
sites-enabled/
Similar in functionality to mods-enabled/, sites-enabled contains symlinks to sites in sites-available/ that the admnistrator wishes to enable.
Example:test -> /etc/apache2/sites-available/test
Enable and Disable modules and sites in apache2
a2enmod and a2dismod are available for enabling and disabling modules utilizing the above configuration system.
a2ensite and a2dissite have been added, which do essentially the same thing as the above tools, but for sites rather than modules.