Answers for "XAMPP virtual host"

2

adding virtual host xampp

Step 1:

Open httpd.conf file present in C:xamppapacheconfhttpd.conf
Remove the #(hash) sign present to include the “httpd-vhosts.conf” file in httpd.conf file.


# Virtual hosts
#Include conf/extra/httpd-vhosts.conf

To


# Virtual hosts
Include conf/extra/httpd-vhosts.conf

Step 2:

Create a virtualhost file. Open “httpd-vhosts.conf” file. And copy the below lines of code.


<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot <PATH_TO_PROJECT_DIRECTORY_HERE>
ServerName <SERVER_NAME like local.pos.com>
</VirtualHost>

Replace PATH_TO_PROJECT_DIRECTORY_HERE & SERVER_NAME with appropriate values, Save the file.

Step3:

Open C:WindowsSystem32driversetchosts

Add the below line at the end of file.

127.0.0.1      <SERVER_NAME like local.pos.com>
Posted by: Guest on April-25-2020
0

access virtual host from lan xampp

NameVirtualHost *:80

<Directory "D:/websites/">
    AllowOverride All
    Order Deny,Allow
    Allow from all
    </Directory>
<VirtualHost 127.0.0.1>
    DocumentRoot "D:/websites/wamp/www/"
    ServerName localhost
</VirtualHost>


<VirtualHost 127.0.0.1>
    DocumentRoot "D:/websites/project1/"
    ServerName www.project1.com
</VirtualHost>


<VirtualHost 127.0.0.1>
    DocumentRoot "D:/websites/project2/"
    ServerName www.project2.com
</VirtualHost>
Posted by: Guest on June-21-2020

Browse Popular Code Answers by Language