Apache监听其他端口方法,apache监听端口


安装完apache之后,默认地址127.0.0.1访问的是80端口,如果想其他端口也能访问到,需要特殊设置一下

1、找到apache目录下的配置文件httpd.conf

找到Listen 80 这一句,然后在后面加上Listen 9999

2、找到虚拟机配置文件httpd-vhosts.conf

加上一个配置,配置到自己希望访问的目录

<VirtualHost *:9999>
  ServerName localhost
  DocumentRoot "D:/server/Apache/htdocs/localhost/9999_port"
  <Directory "D:/server/Apache/htdocs/localhost/9999_port">
  DirectoryIndex index.html index.htm index.php	
</Directory>
3、重启apache之后试着访问127.0.0.1不带端口后和带端口号9999的,得到的就是对应地址下的信息


相关内容

    暂无相关文章