# 1, if you open the virtual host, this must have (IP: port), found #NameVirtualHost *:80 modified to: Namevirtualhost 127.0.0.1:80 # 2, modify <directory "/var/www/html "> Change to <directory"/var/www "> # 3, add site # Default trap host, prohibit illegal binding, create a new nosite directory under the WWW directory <virtualhost 127.0.0.1:80> D Ocumentroot/var/www/nosite ServerName 127.0.0.1 <location/> Order allow,deny Deny from all </Location></VirtualHost> # huanhang.com<virtualhost 127.0.0.1:80> documentroot/var/www/ huanhang.com ServerName www.huanhang.com serveralias huanhang.com www.huanhang.com <directory "/var/www/huanha Ng.com "> Options-indexes followsymlinks allowoverride all Order Allow,deny </Directory> errorlog "/log/httpd/huanhang.com-error.log" Customlog "/log/httpd/access/huanhang.com-access. Log "Common</virtualhost> # blog.huanhang.com<virtualhost 127.0.0.1:80> documentroot/var/www/ Blog.huanhang.com ServerName blog.huanhang.com Serveralias blog.huanhang.com <directory "/var/www/blog.huanhang.com" > Options-indexes followsymlinks allowoverride all Order allow,deny allow from all </Directory> errorlog "/log/httpd/blog. Huanhang.com-error.log "Customlog"/log/httpd/access/blog.huanhang.com-access.log "Common</VirtualHost> # 4, restart apache# now access: Huanhang.com and blog.huanhang.com will show different content. # Note: # Please replace the above 127.0.0.1 with your server's IP, and other corresponding to replace it with your own.
A standalone server is one that can build multiple websites, an IP address, a port