[SOLVED] WP subdomains, What to add to httpd-vhost.config ?

Problems with the Windows version of XAMPP, questions, comments, and anything related.

[SOLVED] WP subdomains, What to add to httpd-vhost.config ?

Postby Dennisxxx » 27. January 2014 11:59

Hi,

I run a few single wordpress installs on my localhost and trying to create a wpms site but when trying to add subdomain to my wpms site I run into problems.

I've found a few sites providing very good how to info, however, I spent all the weekend trying to get this to work but no luck! Apache won't start, this is the last info I followed:
http://www.codingcereal.com/2011/05/set ... ing-xampp/

I added the following to httpd-vhost.config, when restarting Apache it wont start. If I remove this code from the file, Apache starts up just fine and I can access my single installs. Seems as all other settings is ok?

Code: Select all
<VirtualHost *:80>
    DocumentRoot “C:/xampp/htdocs/mysite.com”
    ServerName subname.mysite.com
</VirtualHost>


I wonder what it is I am doing wrong and what I need to do to get access to the subdomain?
Does it matter if I add the code to the httpd-vhost.config after I created the sub or should I add the code first and then create the sub?
Last edited by Dennisxxx on 28. January 2014 13:28, edited 1 time in total.
Dennisxxx
 
Posts: 5
Joined: 27. January 2014 11:27
Operating System: w8

Re: WP subdomains, What to add to httpd-vhost.config ?

Postby Altrea » 27. January 2014 12:16

Seems like you are not using valid double-quotes to cover your DocumentRoot path.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: WP subdomains, What to add to httpd-vhost.config ?

Postby Dennisxxx » 27. January 2014 15:56

yes thank you, the double quota was the issue but, I still cannot access the sub domain.

I've tried all versions of this code:

Code: Select all
<VirtualHost *:80>
DocumentRoot “E:/SERVER-XAMPP/xampp/htdocs”
ServerName localhost
</VirtualHost>


This tells our apache the folder path for our default http://localhost

Code: Select all
<VirtualHost *:80>
DocumentRoot “E:/SERVER-XAMPP/xampp/htdocs/subdomain”
ServerName subdomain.localhost.com
</VirtualHost>


This tells our apache the folder path for our new subdomain http://subdomain.localhost.com

Now, go back to your XAMPP control panel and restart apache by clicking the designated stop button then afterwards the start button.

Go to your browser and type in the address bar : http://subdomain.localhost.com

That should be working perfectly


But still get this error all of the time when I try to go the the wpms subdomain:

The server at localhost.mysub can't be found, because the DNS lookup failed. DNS is the network service that translates a website's name to its internet address. This error is most often caused by having no connection to the internet or a misconfigured network. It can also be caused by an unresponsive DNS server or a firewall preventing Opera from accessing the network.


What might be the problem as I can access my single installs?
Dennisxxx
 
Posts: 5
Joined: 27. January 2014 11:27
Operating System: w8

Re: WP subdomains, What to add to httpd-vhost.config ?

Postby Altrea » 27. January 2014 15:58

Can you ping your subdomain?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: WP subdomains, What to add to httpd-vhost.config ?

Postby Nobbie » 27. January 2014 16:10

Dennisxxx wrote:The server at localhost.mysub can't be found, because the DNS lookup failed. DNS is the network service that translates a website's name to its internet address. This error is most often caused by having no connection to the internet or a misconfigured network. It can also be caused by an unresponsive DNS server or a firewall preventing Opera from accessing the network.


What might be the problem as I can access my single installs?


The problem is this problem (as described). There is no DNS entry for localhost.mysub. Instead of using a DNS Server you may also provide localhost.mysub to your Windows Host file. But you did not do either. Therefore, TCPIP (and Apache) cannot translate localhost.mysub into a valid IP.

Anyway, youre description is extremely confusing and bad. On the one hand, you show us VirtualHosts for "localhost", "subdomain.localhost.com" and "subname.mysite.com", but then you show us an error message for "localhost.mysub", what is not part of any configuration.

Are you sure you have any idea of what you are doing there??
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: WP subdomains, What to add to httpd-vhost.config ?

Postby Dennisxxx » 28. January 2014 11:52

It took me some time but I've solved this issue. As stated on the page I link to in my first post, add this code in hosts file:

Code: Select all
127.0.0.1 subdomain.localhost.com

but this is what worked for me

Code: Select all
127.0.0.1 subdomain.localhost

without .com

But now I cannot login to wp admin, I know that's not xampp issue but, I've searched for solution but not found any answers that works, if anyone know how to solve that issue, please share :roll:
Dennisxxx
 
Posts: 5
Joined: 27. January 2014 11:27
Operating System: w8

Re: WP subdomains, What to add to httpd-vhost.config ?

Postby Nobbie » 28. January 2014 15:54

Dennisxxx wrote:But now I cannot login to wp admin, I know that's not xampp issue but, I've searched for solution but not found any answers that works, if anyone know how to solve that issue, please share :roll:


Aha.

Its always a brilliant idea to provide as less information as possible. Most important: do not tell any error message, do not describe the behaviour. Use common phrases like "i cannot" or "does not work" or similar - all this gives you the guarantee, that definately nobody can help you, as nobody knows only the slightest facts about your installation and what is going wrong. :(
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 77 guests