Vote Up 0 Vote Down

create subdomain in xampp linux

How to create a subdomain in localhost xampp which is in linux os ?
flag

Answers


Vote Up 1 Vote Down
* 1:*

Edit the httpd.conf in /opt/lampp/etc/ (In the localation differs) to the following :

NameVirtualHost 127.0.0.1:80


<virtualhost 127.0.0.1:80>
DocumentRoot "/opt/lampp/htdocs"
ServerName localhost
</virtualhost>

<virtualhost 127.0.0.1:80>
DocumentRoot "/opt/lampp/htdocs/projects/my_subdomain_directory"
ServerName mysubdomain.localhost
</virtualhost>


* 2:*

Edit the **hosts** in /etc to following

127.0.0.1 mysubdomain.localhost



Step 3:
Restart xampp using

/opt/lampp/lampp restart

Step 4:

Open the following link in the browser to see your subdomain.

**http://mysubdomain.localhost/**
flag | link |

Your Answer

Login before answering

Login with facebook