【绝对能用】阿里云ECS上Centos7安装Apache(httpd)并实现多域名转不同tomcat配置

#安装
yum install httpd


#设置自启
systemctl enable httpd.service


#编辑httpd.conf就够了,httpd.conf在/etc/httpd/conf中。在底部加上虚拟主机
vim /etc/httpd/conf/httpd.conf


-------------------------------------------------------------------------------
NameVirtualHost *:80   
  
 
    ServerName www.xm10000.com.cn   
    ServerAlias xm10000.com.cn *.xm10000.com.cn   
    ProxyPreserveHost On
    ProxyRequests Off
 
    ProxyPass / http://www.xm10000.com.cn:81/
    ProxyPassReverse / http://www.xm10000.com.cn:81/
 
    ErrorLog logs/xm10000_error_log
    CustomLog logs/xm10000_access_log common



 
    ServerName www.titantec.cn   
    ServerAlias titantec.cn *.titantec.cn   
    ProxyPreserveHost On
    ProxyRequests Off
 
    ProxyPass / http://www.titantec.cn:82/
    ProxyPassReverse / http://www.titantec.cn:82/
 
    ErrorLog logs/titantec_error_log
    CustomLog logs/titantec_access_log common

-------------------------------------------------------------------------------

你可能感兴趣的:(09_阿里云ECS服务器配置)