开发者社区> 问答> 正文

ECS,CENTOS7.4,Apache 子域名设置不成功

已解决

环境: 云服务器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>

crm.MyDomain.com, shop.MyDomain.com 出错信息:
sundomain

展开
收起
上海wm 2018-04-26 11:22:29 2832 0
3 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
云服务器可观测能力的探索与实践 立即下载
CentOS Nginx PHP JAVA 多语言镜像使用手 立即下载
CentOS Nginx PHP JAVA多语言镜像使用手册 立即下载

相关镜像