阿里云部署apache二级域名
添加DNS解析记录
到阿里云控制台->云解析DNS->域名解析->解析设置->添加记录
主机记录就是你的二级域名
记录类型为A——指向IPV4
解析路线默认
记录值为你的外网IP
配置Apache
编辑httpd.conf
注释掉虚拟目录外的DocumentRoot
添加
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin root@localhost
DocumentRoot "/var/www/your1"
ServerName two1.yourname
<Directory "/var/www/your1">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerAdmin root@localhost
DocumentRoot "/var/www/your2"
ServerName two2.yourname
<Directory "/var/www/your2">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
重启
service httpd restart