Configure the Apache virtual host with the lamp environment

Source: Internet
Author: User

Apache Master configuration file/usr/local/apache2.4/conf/httpd.conf
定义网站根目录DocumentRoot "/usr/local/apache2.4/htdocs"定义网站域名ServerName www.example.com:80定义虚拟主机配置文件Include conf/extra/httpd-vhosts.conf定义默认索引页DirectoryIndex index.html index.php//如果一个目录下有两个索引页,默认显示排在前面的索引页
Virtual Host Concept
一台服务器可以访问多个网站,每个网站都是一个虚拟主机任何一个域名解析到这台机器,都可以访问的虚拟主机就是默认虚拟主机
Configuring a virtual Host
Include conf/extra/httpd-vhosts.conf  打开主配置文件中这一行vim /usr/local/apache2.4/conf/extra/httpd-vhosts.conf修改如下:<VirtualHost *:80>  #ServerAdmin [email protected]    DocumentRoot "/data/wwwroot/aaa.com"    ServerName aaa.com    ServerAlias www.aaa.com  www.abc.com    ErrorLog "logs/aaa.com-error_log"    CustomLog "logs/aaa.com-access_log" common</VirtualHost><VirtualHost *:80>  #ServerAdmin [email protected]    DocumentRoot "/data/wwwroot/bbb.com"    ServerName bbb.com    ServerAlias www.bbb.com    ErrorLog "logs/bbb.com-error_log"    CustomLog "logs/bbb.com-access_log" common

Configure the Apache virtual host with the lamp environment

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.