设置文件地址为 :/etc/apache2/sites-available/default

添加:
<VirtualHost *:80>
      ServerName www.php.com #定义域名
      DocumentRoot /home/linux/www/php #定义主目录
</VirtualHost>
 
<VirtualHost *:80>
      ServerName www.web.com
      DocumentRoot /home/linux/www/web
</VirtualHost>
注:如不使用80端口,还需在apache.conf文件中添加对端口的监听,然后重启

相关文章:

  • 2022-01-02
  • 2021-11-22
  • 2021-06-25
  • 2022-01-31
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-15
  • 2021-09-19
  • 2021-05-17
  • 2021-06-16
  • 2021-11-05
  • 2022-12-23
  • 2021-08-07
相关资源
相似解决方案