WEB开发网
开发学院服务器WEB服务器Apache httpd.conf设置一个IP两个域名的方法 阅读

httpd.conf设置一个IP两个域名的方法

 2008-10-20 00:00:00 来源:WEB开发网   
核心提示:我就是不晓得如何让两个域名对应同一个IP,然后能识别出不同的网站?NameVirtualHost 12.34.56.78# your ip address<VirtualHost 12.34.56.78>ServerName yourname1DocumentRoot yourpath1</Virtu

我就是不晓得如何让两个域名对应同一个IP,然后能识别出不同的网站?

NameVirtualHost 12.34.56.78 # your ip address
<VirtualHost 12.34.56.78>
    ServerName yourname1
    DocumentRoot yourpath1
</VirtualHost>
<VirtualHost 12.34.56.78>
    ServerName yourname2
    DocumentRoot yourpath2
</VirtualHost>

If you want to use 443

NameVirtualHost 12.34.56.78:80 # your ip address
NameVirtualHost 12.34.56.78:443 # your ip address
  
<VirtualHost 12.34.56.78:80>
    ServerName yourname1
    DocumentRoot yourpath1
</VirtualHost>
<VirtualHost 12.34.56.78:443>
    ServerName yourname1
    DocumentRoot yourpath1
</VirtualHost>

Tags:httpd conf 设置

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接