修改/etc/httpd/conf/httpd.conf,在文件的最后加入:
ServerName 58.130.17.168
NameVirtualHost 58.130.17.168
<VirtualHost 58.130.17.168>
ServerName domain1.com
DocumentRoot /var/www/domain1.com
<Directory "/var/www/domain1.com">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost 58.130.17.168>
ServerName domain2.com
DocumentRoot /var/www/domain2.com
<Directory "/var/www/domain2.com">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
然后在/var/www/domain1.com和/var/www/domain2.com下创建不同的index.html文件!
声明: 此文观点不代表本站立场;转载须要保留原文链接;版权疑问请联系我们。