简体   繁体   English

apache中具有相同ip和端口的多个域

[英]Multiple domain with the same ip and port in apache

I want to bind two different domain in my VPS with the same ip and port, here is my httpd.conf : 我想在我的VPS中使用相同的ip和端口绑定两个不同的域,这是我的httpd.conf

<VirtualHost 106.187.96.123:80>
    DocumentRoot /home/roy/sobuhu
    ServerName aaa.com
</VirtualHost>

<VirtualHost 106.187.96.123:80>
    DocumentRoot /disk1/allen/www
    ServerName bbb.com
</VirtualHost>

<VirtualHost 106.187.96.123:80>
    DocumentRoot /disk1/allen/www
    ServerName www.bbb.com
</VirtualHost>

Can I config the ServerName use syntax like *.bbb.com ? 我可以配置像@ .bbb.com这样的ServerName使用语法吗? so I can access www.bbb.com、bbs.bbb.com with the DocumentRoot /disk1/allen/www . 所以我可以使用DocumentRoot /disk1/allen/www访问www.bbb.com,bbs.bbb.com。

Now I visit bbs.bbb.com, it will turn to /home/roy/sobuhu . 现在我访问bbs.bbb.com,它将转向/home/roy/sobuhu

NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot /home/roy/sobuhu
    ServerName aaa.com
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot /disk1/allen/www
    ServerName bbb.com
    ServerAlias *.bbb.com
</VirtualHost>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 多个apache子域-主域和子域都具有相同的CNAME,IP和PORT。 一个子域有效,另一个不起作用 - Multiple apache subdomains - main domain and subs all same CNAME, IP and PORT. One subdomain works, the other doesn't 将来自不同主机的多个IP地址指向具有不同端口的同一域名 - Pointing multiple IP address from different hosts to a same domain name with different port 同一个apache服务器的多个域名 - Multiple domain names for the same apache server 将域名连接到 ip:port - connecting a domain name to a ip:port 将多个域名解析到同一WAN IP上的不同虚拟机 - Resolving multiple domain names to different virtual machines on the same WAN IP 我们可以将多个域名指向同一个 IP 地址吗? - Can we point multiple domain names to the same IP address? 域名代替IP Apache - Domain name instead of IP Apache 将域名指向带有端口号的 IP 地址 - To point domain name to IP address with port number Apache服务器无法在单个公共IP上托管多个域,错误:“未在此服务器上找到请求的URL。” - Apache Server Unable to host multiple domain on single Public IP Error : “Not Found The requested URL / was not found on this server.” Apache和IIS在同一服务器/端口上 - Apache and IIS on the same server/port
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM