An Apache configuration installation
1. Uninstall RPM package before installation
RPM-E httpd--nodeps
2. Compile and install 4 steps:
(1) Tar zxf httpd-2.2.17.tar.gz-c/usr/src/
(2) cd/usr/src/httpd-2.2.17
./configure--prefix=/usr/local/httpd--enable-so--enable-rewrite--enable-charset-lite--enable-cgi
(3) Make && make install
3. Optimizing the Path
Ln-s/usr/local/httpd/bin/*/usr/local/bin/
4. Adding system Services
(1) cp/usr/local/httpd/bin/apachectl/etc/init.d/httpd
(2) VIM/ETC/INIT.D/HTTPD
CHKCONFIG:35 85 15
# description: Startup script for the Apache HTTP Server
(3) Chkconfig--add httpd
5.apache Access Log
/usr/local/httpd/logs/access_log
Two Apache Virtual Hosting
1. Enable domain-based virtual hosts
Vim/usr/local/httpd/conf/httpd.conf
Navigate to line 388 and remove #
Conf/extra/httpd-vhosts.conf
2. Configure the virtual host file
Vim/usr/local/httpd/conf/extra/httpd-vhosts.conf
Namevirtualhost : 80
<virtualhost >
Documentroot/var/www/html/benetcom
ServerName www.benet.com
</VirtualHost>
<virtualhost *>
Documentroot/var/www/html/accpcom
ServerName www.accp.com
</VirtualHost>
3. Restart the configuration file
/usr/local/httpd/bin/apachectl restart
Common configuration commands for Apache in Linux