Page 1 of 1

XAMP multiple "sub domain/virtual host" not working

PostPosted: 11. February 2014 12:18
by obayda1757
Dear Friends,
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>

Re: XAMP multiple "sub domain/virtual host" not working

PostPosted: 11. February 2014 14:24
by Altrea
Hi obayda1757,

ServerName and ServerAlias should not contain any information about protocol, slashes, subdirectories, etc.

best wishes,
Altrea

Re: XAMP multiple "sub domain/virtual host" not working

PostPosted: 12. February 2014 07:36
by obayda1757
Jajaka Allah
THANK YOU ALL
Almighty will give good rewards and hedayah to you all for your great effort to solve this issue.
Its being so difficult for us to get such support as we are living in third world

Re: XAMP multiple "sub domain/virtual host" not working

PostPosted: 15. February 2014 11:41
by obayda1757
But my "word press sites" links are not working

You can easily check the problem from live
site link: http://opinion.dscebd.org/

Re: XAMP multiple "sub domain/virtual host" not working

PostPosted: 15. February 2014 11:55
by Altrea
live environment & third party application
=> [INFO] How to not fail getting help here (section "Scope of support")

Re: XAMP multiple "sub domain/virtual host" not working

PostPosted: 15. February 2014 13:48
by Nobbie
It seems, that you installed WordPress under localhost, then created subdomain opinion.dscebd.org and finally moved your existing WordPress Installation from localhost to opinion.dscebd.org.

THIS DOES NOT WORK!!

You have to create all subdomains and folders first and finally you have to install WordPress into the desired subdomain and provide the appropriate informations into the WordPress Installer Dialog. You cannot move an existing WordPress Installation from one domain to another.

Re: XAMP multiple "sub domain/virtual host" not working

PostPosted: 15. February 2014 14:16
by Altrea

Re: XAMP multiple "sub domain/virtual host" not working

PostPosted: 15. February 2014 21:25
by Nobbie
Altrea wrote:You can, but you have to know what to change


--- was mir natürlich auch klar ist, aber das schafft obydaya1757 mit absoluter Sicherheit erst Recht nicht. Außerdem ist sein Server nackt bis zum geht nicht mehr, er hat wirklich Xampp im Originalzustand dort installiert (ich kann problemlos die Xampp Adminoberfläche aufrufen).

Ich schreibe das alles bewusst auf Deutsch, weil mir obydaya157 zum einen natürlich Leid tut, zum anderen muss man (= Du .....) ihm beibringen, dass man Xampp nicht einfach so Online einsetzen kann. Im Moment kann man mit ein wenig Phantasie (und sehr viel braucht man wirklich nicht) auf die Xampp Adminoberfläche (inkl. MySQL mit "root" ohne Passwort..... :shock: :shock: :shock: :shock: ) von außen zugreifen (und deswegen schreibe ich auf Deutsch, damit nicht irgendwelche Idioten das aus Versehen verstehen).

Re: XAMP multiple "sub domain/virtual host" not working

PostPosted: 16. February 2014 07:43
by obayda1757
@Nobbie
--- was mir natürlich auch klar ist, aber das schafft obydaya1757 mit absoluter Sicherheit erst Recht nicht. Außerdem ist sein Server nackt bis zum geht nicht mehr, er hat wirklich Xampp im Originalzustand dort installiert (ich kann problemlos die Xampp Adminoberfläche aufrufen).


vielen Dank für die Anregung. Ich bin mit der Website für die Test arbeiten. Aber du meine Augen zu öffnen für die Sicherheit

English: thanks a lot for the suggestion. I am working with the site for test. But you open my eyes for security

Re: XAMP multiple "sub domain/virtual host" not working

PostPosted: 17. February 2014 09:11
by obayda1757
Alhamdulillah!!
After all by the grace of Almighty Allah may be I have successfully implemented my Virtual Hosting and Web transformation.
Thank you all. With whose support help me to learn the guideline to implementation.

I have made a tutorial for the new comers in Web like me to know about
Virtual Hosting (in public domain) and Web site transformation

http://goo.gl/w0V9rw

Re: XAMP multiple "sub domain/virtual host" not working

PostPosted: 17. February 2014 17:32
by Altrea
I can not recommend to follow this tutorial