Home > Back-end >  xampp with a specified port number not working with virtualhost
xampp with a specified port number not working with virtualhost

Time:01-21

I am trying to create a local domain name for my xampp project

But the dns is not resolving it is not redirecting correctly.

/hosts/etc

127.0.0.1:8081      mydomainname.test

virtualhost

<VirtualHost *:8081>
    DocumentRoot "C:/xampp/htdocs/sam"
    ServerName mydomainname.test
    ServerAlias mydomainname.test
    <Directory "C:/xampp/htdocs/sam">
    Options Indexes MultiViews FollowSymLinks
        AllowOverride All
        Order Deny,Allow
        Allow from all
    Options All
       Require all granted
    </Directory>
</VirtualHost>

CodePudding user response:

Change the file a little

Listen 8081

<VirtualHost *:8081>
    DocumentRoot "C:/xampp/htdocs/sam"
    ServerName mydomainname.test
    ServerAlias mydomainname.test
    <Directory "C:/xampp/htdocs/sam">
    Options Indexes MultiViews FollowSymLinks
        AllowOverride All
        Order Deny,Allow
        Allow from all
    Options All
       Require all granted
    </Directory>
</VirtualHost>

Read more here: https://httpd.apache.org/docs/trunk/vhosts/examples.html#port

CodePudding user response:

It's /etc/hosts. And it does not accept ports and should look like: mydomainname.test 127.0.0.1

  • Related