This article mainly describes the Apache binding domain name under CentOS and Apache binding multiple domain names, first of all to find Apache configuration file httpd.conf location. CentOS operating systems are typically under/etc/httpd/conf, and some Linux operating system versions are in/etc/apache2/conf or/usr/local/etc/apache folders, All that remains to be done is to modify the configuration file httpd.conf, which has the following binding domain name description at the bottom of the general configuration file:
# VirtualHost Example: # Almost any Apache directive could go into a virtualhost container. # the ' The ' the ' I VirtualHost ' used for requests without a known # server name. # #<virtualhost *:80> # ServerAdmin webmaster@dummy-host.example.com # 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>
We can according to gourd painting gourd, can also be combined with the relevant syntax to add their own configuration instructions, the following is my worry-free program profile: 1, * asterisk modified to its own web site IP address 2, serveradmin Administrator mailbox (optional) 3, DocumentRoot Web site files Specify log file storage paths on the server's directory path 4, servername bound corresponding domain name 5, Serveralias domain resolution binding subdomain 6, errorlog, and Customlog.
<virtualhost 175.102.8.117:80> adddefaultcharset gbk documentroot/chengxu ServerName 66php.com ServerAlias *. 66php.com Errorlog/sym/logs/66php.com-error_log Customlog/sym/logs/66php.com-access_log Common </VirtualHost >
If a server binds multiple domain names instead of adding multiple domain names in ServerName, ServerName can only add one domain name after the other, you need to add more virtualhost modules to repeat the binding.
Reprint: http://www.66php.com/66.html