使用Apache将多个域名配置到同一个IP的linux服务器上
如何将多个域名配置到同一个IP的linux服务器上
1.安装httpd
yum install httpd
2.配置httpd.conf
vim /etc/httpd/conf/httpd.conf
ServerRoot "/etc/httpd"
Listen 80
LoadModule ssl_module modules/mod_ssl.so
LoadModule rewrite_module modules/mod_rewrite.so
Include /etc/httpd/conf.d/ssl.conf
Include conf.modules.d/*.conf
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
allow from all
</Directory>
#域名一:
<VirtualHost *:80>
ServerName test1.domain.cn
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order Deny,Allow
Allow from all
</Proxy>
ProxyPass / http://xxx.xxx.xxx.xxx:8081
ProxyPassReverse / http://xxx.xxx.xxx.xxx:8081
</VirtualHost>
#域名一:
<VirtualHost *:80>
ServerName test2.domain.cn
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order Deny,Allow
Allow from all
</Proxy>
ProxyPass / http://xxx.xxx.xxx.xxx:8082
ProxyPassReverse / http://xxx.xxx.xxx.xxx:8082
</VirtualHost>
- 本文标签: Linux
- 本文链接: https://www.jimmy2k.top/article/357
- 版权声明: 本文由JimmyZ的个人博客原创发布,转载请遵循《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》许可协议授权