简体   繁体   English

配置apache以使用81端口

[英]Configuring apache to use 81 port

some applications started to use my 80 port and it's became impossible to use xampp. 一些应用程序开始使用我的80端口,而无法使用xampp。

in host file I have 在主机文件中

127.0.0.1   a1.com

So I changed httpd.conf to 所以我将httpd.conf更改为

Listen 81
ServerName 127.0.0.1:81

In httpd-vhosts.conf I also made changes 在httpd-vhosts.conf中,我也进行了更改

<VirtualHost a1.com:81>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "D:/Work/XAMPP/htdocs/a1.com/web/"
    ServerName a1.com
    <Directory "D:/Work/XAMPP/htdocs/a1.com/">
        Options Indexes FollowSymLinks
        AllowOverride all
        Order Deny,Allow
        Deny from all
        Allow from all
    </Directory>
</VirtualHost>

I saved everything , started Apache, Apache started successfully, tried to open page using a1.com , but received 404 - Not Found . 我保存了所有内容,启动了Apache,Apache成功启动,尝试使用a1.com打开页面,但收到404-Not Found

Is there a way to solve this problem ? 有办法解决这个问题吗?

I have a similar configuration. 我有类似的配置。 In the hosts file I have: 在主机文件中,我有:

127.0.0.1     local.home.com

In httpd.conf I have: 在httpd.conf中,我有:

Listen 81

And in httpd-vhosts.conf I have: 在httpd-vhosts.conf中,我有:

<VirtualHost *:81>
    ServerAdmin webmaster@home.com
    DocumentRoot "D:\PATH\TO\MY\FILES"
    ServerName local.home.com
    ErrorLog "logs/home-error.log"
    CustomLog "logs/home-access.log" common
    <Directory "D:\PATH\TO\MY\FILES">
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Hope this works for you. 希望这对您有用。

you should add the port on the browser. 您应该在浏览器中添加端口。 http://localhost:81 HTTP://本地主机:81

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM