I have created 2 sub-domin on my name server. And forward these to my OWN server(public ip). Now I have to configure my Local Server for virtual hosting.
My subdomins are:
a) opinion.dscebd.org ---> need to forward to "d:\xamp\htdocs\dsceopn"
b) library.dscebd.org ---> need to forward to "d:\xamp\htdocs\dsce"
I have already edited 3 following files as per different examples. Also add the code of these files here. But virtual hosting is not working.
1) host (sytem32) 2) httpd.conf (apache) 3) httpd-vhost.conf (apache)
Please help me to configure these files.
File#1) HOST FILE: (Location: C:\Windows\System32\drivers\etc\host)
- Code: Select all
# 127.0.0.1 localhost
127.0.0.1 opinion.dscebd.org
127.0.0.1 library.dscebd.org
File# 2) httpd.conf (location: D:\xampp\apache\conf\httpd.conf)
- Code: Select all
#Listen 12.34.56.78:80
Listen 80
ServerName localhost:80
#ServerName 180.234.212.27:80 // My Server Real IP
#ServerName 192.168.2.11:80 // My server's Local IP
DocumentRoot "D:/xampp/htdocs"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
File# 3) httpd-vhosts.conf (location: D:\xampp\apache\conf\extra\httpd-vhosts.conf)
- Code: Select all
## My Local Host ##
<VirtualHost *:80>
ServerName localhost
DocumentRoot D:\xampp\htdocs
</VirtualHost>
## My 1st Domain(sub-domain) ##
<VirtualHost *:80>
ServerName library.dscebd.org
ServerAlias http://library.dscebd.org/
DocumentRoot "D:\xampp\htdocs\dsce"
</VirtualHost>
## My 2nd Domain(sub-domain) ##
<VirtualHost *:80>
ServerName opinion.dscebd.org/
ServerAlias http://opinion.dscebd.org
DocumentRoot "D:\xampp\htdocs\dsceopn"
</VirtualHost>