简体   繁体   中英

Configuring apache to use 81 port

some applications started to use my 80 port and it's became impossible to use xampp.

in host file I have

127.0.0.1   a1.com

So I changed httpd.conf to

Listen 81
ServerName 127.0.0.1:81

In httpd-vhosts.conf I also made changes

<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 .

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:

Listen 81

And in httpd-vhosts.conf I have:

<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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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