Friday, November 12, 2021

[SOLVED] Configuring apache to use 81 port

Issue

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 [email protected]
    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 ?


Solution

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 [email protected]
    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.



Answered By - ycsun