Using nginx and php I need to create multiple sub domain in local host. How i can make it happen?
I am using ubuntu 12.04
and php5
withnginx
as webserver.
i Have tried *.servername.com
in my configuration file. BUt it is not working.
Using nginx and php I need to create multiple sub domain in local host. How i can make it happen?
I am using ubuntu 12.04
and php5
withnginx
as webserver.
i Have tried *.servername.com
in my configuration file. BUt it is not working.
In localhost you can make entry of subdomain in "hosts" file at dir of C:\Windows\System32\Drivers\etc (it may be at /etc of linux)
127.0.0.1 maindomain.com
127.0.0.1 one.maindomain.com
127.0.0.1 two.maindomain.com
After that you have to make entry in httpd.conf file
<VirtualHost 127.0.0.1:80>
DocumentRoot pathToMainDomain
ServerName maindomain.com
</VirtualHost>
<VirtualHost 127.0.0.1:80>
DocumentRoot pathToMainDomain
ServerName one.maindomain.com
</VirtualHost>
<VirtualHost 127.0.0.1:80>
DocumentRoot pathToMainDomain
ServerName two.maindomain.com
</VirtualHost>