Redhat Enterprise Linux (including CentOS Linux) is the most widely used Linux server, and a large number of Web applications are deployed on it. 1. Open the file/etc/httpd/conf/httpd.conf, search for VirtualHost example, find the code as follows:##VirtualHost Example:#almost any Apache directive could go into a VirtualHost container.#The first VirtualHost section was used for requests without a known#server name.##<virtualhost *:80>#ServerAdmin [email protected]#documentroot/www/docs/dummy-host.example.com#ServerName dummy-host.example.com#errorlog Logs/dummy-host.example.com-error_log#Customlog Logs/dummy-host.example.com-access_log Common#</VirtualHost>2. In the example, add a piece of code to specify a domain name for the site.##DocumentRoot is the root directory where the Web site files are stored#ServerName is a site domain name that needs to be consistent with DNS-directed domain names#<virtualhost *:80>ServerAdmin [email protected]-host.example.com documentroot/var/www/httpdocs/demo_neoease_com ServerName Demo. Neoease.com errorlog logs/demo.neoease.com-error.LogCustomlog Logs/demo.neoease.com-access.LogCommon</virtualhost>3. Restart the httpd service and execute the following statement.Service httpd Restart
Apache Virtual Host
Redhat Enterprise Linux (including CentOS Linux) is the most widely used Linux server, and a large number of Web applications are deployed on it.
1. Open the file/etc/httpd/conf/httpd.conf, search for VirtualHost example, find the following code:
## VirtualHost example:# almost any Apache directive could go into a VirtualHost container.# the first Virtualho St section was used for requests without a known# server name.##<virtualhost *:80># ServerAdmin [Email protec ted]# documentroot/www/docs/dummy-host.example.com# ServerName dummy-host.example.com# errorlog logs/dummy-host.
example.com-error_log# customlog logs/dummy-host.example.com-access_log common#</virtualhost> |
2. As an example, add a section of code to specify a domain name for the site.
## documentroot is the root directory of the Web site files # ServerName is the site domain name, need to be consistent with the DNS point to the domain name #<virtualhost *:80> ServerAdmin [email& Nbsp;protected] documentroot/var/www/httpdocs/demo_neoease_com ServerName demo.neoease.com errorlog logs/demo.ne
Oease.com-error.log customlog logs/demo.neoease.com-access.log common</virtualhost> |
3. Restart the httpd service and execute the following statement.
Environment Installation linux+apache+php