Debian系apache2添加虚拟目录并指定Port

2020-05-15   782 次阅读


  • 环境介绍:
  • 操作系统:Debian系
  • 应用程序:apache2
  • 本文记录了debian系操作系统下对于apache2应用程序虚拟目录的添加以及指定监测port端口

1.修改位于apache2安装目录下的000-default.conf文件

nano sites-available/000-default.conf
#例如目录名称为:/media/ipxe-start
#例如监测端口为:670
<VirtualHost *:670>
	ServerAdmin webmaster@localhost
	DocumentRoot /media/ipxe-start

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

2.修改位于apache2安装目录下的ports.conf文件

nano ports.conf
# If you just change the port or add more ports here, you witl tikely also
# have to change the VirtuatHost statement in
# /etc/apache2/sites-enabled/00e-default.con
Listen 660 
Listen 670      #此处添加670端口即可
<IfModule ssL_module> 
	Listen 443
</IfModule>
<IfModule mod_anutts.c> 
	Listen 443
<IfModule>

#vim: syntax=apache ts=4 sw=4 sts-4 sr noet

脑无理想 枉活一世