Common configuration commands for Apache in Linux

Source: Internet
Author: User
Tags apache access log

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.