本文的目的:在同一个域名下,通过配置不同的端口,让网站的根目录不同。从而可以访问多个站点

 

1. 修改/etc/httpd/conf/httpd.conf

   --点击listen端口,这些端口要提前在阿里云上开通

Apache PHP7 多站点 多端口的配置

 

  --在httpd.conf中添加虚拟的host

 

Apache PHP7 多站点 多端口的配置

   --ServerName 添加 阿里云公网IP

Apache PHP7 多站点 多端口的配置

--新建的站点的路径“var/www_empire” 的访问权限要开通

Apache PHP7 多站点 多端口的配置

2 httpd-vhost.conf

安装下图的配置添加内容。 

Apache PHP7 多站点 多端口的配置

 

3 重启apache 

/usr/local/apache/bin    

apachectl stop

apachectl start

相关文章:

  • 2021-11-03
  • 2021-09-17
  • 2020-01-04
  • 2022-01-07
  • 2022-01-07
  • 2021-07-14
  • 2021-11-18
猜你喜欢
  • 2021-09-17
  • 2021-11-21
  • 2022-01-12
  • 2021-09-17
  • 2021-11-18
  • 2021-10-19
  • 2021-11-28
  • 2022-01-01
相关资源
相似解决方案