环境: 云服务器ECS,CENTOS7.4,Apache,PHP,MySQL 按网上一般的说明:
1. 设置域名解析 设置了crm.MyDomain.com, shop.MyDomain.com
2. httpd.conf里设置了: Include conf/extra/httpd-vhosts.conf
3. httpd-vhosts.conf里设置了: (只有www.MyDomain.com起作用) <VirtualHost MyIP:80>
ServerName www.MyDomain.com
ServerAlias MyDomain.com
DocumentRoot /data/www/default <Directory /data/www/default>
SetOutputFilter DEFLATE
Options FollowSymLinks
AllowOverride All
Order Deny,Allow
Require all granted
DirectoryIndex index.php index.html index.htm </Directory>
</VirtualHost>
<VirtualHost MyIP:80>
ServerName crm.MyDomain.com
ServerAlias crm.MyDomain.com
ServerAdmin admin@MyDomain.com
DocumentRoot /data/www/default/crm
ErrorLog /usr/local/apache/logs/crm/error_log
TransferLog /usr/local/apache/logs/crm/access_log </VirtualHost>
<VirtualHost MyIP:80>
ServerName shop.MyDomain.com
ServerAlias shop.MyDomain.com
ServerAdmin shopAdmin@MyDomain.com
DocumentRoot /data/www/default/shop
ErrorLog /usr/local/apache/logs/shop/error_log
TransferLog /usr/local/apache/logs/shop/access_log </VirtualHost>
- 上海wm
用方法B 用vhost.map
Centos中二级域名绑定二级目录的方法 https://www.aliyun.com/zixun/content/6_18_210082.html出错信息是一样的
- 光山居士
安装控制面板吧,参考这里https://bbs.aliyun.com/read/303411.html
题主您好,
建议将
<VirtualHost MyIP:80>
换成<VirtualHost *:80>
后试试。