VirtualHosts / Subdomain problem
VirtualHosts / Subdomain problem
am 05.09.2007 16:07:00 von Burning_Ranger
I have a domain, let's call it www.example.com
I have set up my primary website on my home PC (Win32 Apache IP
address 192.168.1.64), done all the port forwarding etc and done
everything and it all works fine.
What I want to do now is setup a subdomain so I can create a blog on
the same machine and it will be accessible via wordpress.example.com
from the Internet.
This is what I have at the end of my httpd.conf file.
NameVirtualHost example.com
ServerName wordpress.example.com
DocumentRoot "E:/wordpress"
also tried
NameVirtualHost 11.22.33.44
ServerName wordpress.example.com
DocumentRoot "E:/wordpress"
where 11.22.33.44 is my external static IP, as well as various
combinations of IP addresses and hostnames, but nothing works.
I haven't done anything with DNS records, just the two basic A records
eexist for the main website. Do I need to? Nor have I touched the
hosts file on my PC since I want I want to access my blog subdomain
from the internet to verify it's working.
Any ideas?
Re: VirtualHosts / Subdomain problem
am 05.09.2007 16:10:25 von Burning_Ranger
On 5 Sep, 15:07, Burning_Ranger wrote:
> I have a domain, let's call itwww.example.com
>
> I have set up my primary website on my home PC (Win32 Apache IP
> address 192.168.1.64), done all the port forwarding etc and done
> everything and it all works fine.
>
> What I want to do now is setup a subdomain so I can create a blog on
> the same machine and it will be accessible via wordpress.example.com
> from the Internet.
>
> This is what I have at the end of my httpd.conf file.
>
> NameVirtualHost example.com
>
> ServerName wordpress.example.com
> DocumentRoot "E:/wordpress"
>
>
> also tried
>
> NameVirtualHost 11.22.33.44
>
>
> ServerName wordpress.example.com
> DocumentRoot "E:/wordpress"
>
Meant to say here:
NameVirtualHost example.com
ServerName wordpress.example.com
DocumentRoot "E:/wordpress"
Re: VirtualHosts / Subdomain problem
am 05.09.2007 16:13:41 von unknown
Post removed (X-No-Archive: yes)
Re: VirtualHosts / Subdomain problem
am 05.09.2007 16:34:47 von phantom
"Burning_Ranger" wrote in message
news:1189001220.651508.230660@r29g2000hsg.googlegroups.com.. .
>I have a domain, let's call it www.example.com
>
> I have set up my primary website on my home PC (Win32 Apache IP
> address 192.168.1.64), done all the port forwarding etc and done
> everything and it all works fine.
>
> What I want to do now is setup a subdomain so I can create a blog on
> the same machine and it will be accessible via wordpress.example.com
> from the Internet.
>
>
> This is what I have at the end of my httpd.conf file.
>
> NameVirtualHost example.com
>
> ServerName wordpress.example.com
> DocumentRoot "E:/wordpress"
>
>
But this is only one of the two domains, so not that helpful, if I assume
both your domains are on the same IP, it wants to be more like:
NameVirtualHost 1.2.3.4:80
ServerName www.example.com
...
ServerName wordpress.example.com
...
Although the '1.2.3.4:80' could be '*:80' or even '*' depending upon your
setup.
Re: VirtualHosts / Subdomain problem
am 05.09.2007 16:43:41 von Burning_Ranger
On 5 Sep, 15:13, Davide Bianchi wrote:
> > I haven't done anything with DNS records, just the two basic A records
> > eexist for the main website. Do I need to?
>
> You need to have resolution for bothwww.yourdomain.comand
> webpress.yourdomain.com.
Ok I'm using:
NameVirtualHost 87.194.XXX.XXX
DocumentRoot "E:/wordpress"
ServerName wordpress.example.com
87.194.XXX.XXX is my public IP. All incoming requests on port 80 are
forwarded to the LAN machine with apache.
Do I need to create a CNAME record for wordpress.example.com?
There are the records I have now:
@ A 87.194.XXX.XXX
wordpress CNAME 87.194.XXX.XXX
www A 87.194.XXX.XXX
It still doesn't work, or do CNAME records take time to propagate?
Re: VirtualHosts / Subdomain problem
am 05.09.2007 16:48:35 von unknown
Post removed (X-No-Archive: yes)
Re: VirtualHosts / Subdomain problem
am 05.09.2007 17:06:15 von Burning_Ranger
On 5 Sep, 15:48, Davide Bianchi wrote:
> As said before, just use '*', not a real IP (or a fake one)
>
> And where is the OTHER VirtualHost entry?
This is what I have now:
NameVirtualHost *:80
DocumentRoot "E:/apache"
ServerName example.com
DocumentRoot "E:/wordpress"
ServerName wordpress.example.com
> > Do I need to create a CNAME record for wordpress.example.com?
>
> Yes.
>
> > There are the records I have now:
> > @ A 87.194.XXX.XXX
>
> Well, this should be enough since everything is resolved to that IP.
>
> What exactly do you mean with 'it doesn't work'? What does it do when
> you try to access it from the browser?
It just gives me the usual "cannot display the page (i.e.) / server
not found (firefox)" when I try http://wordpress.example.com/
I'm using the latest WAMP server if that's any clue.. bugger...
Re: VirtualHosts / Subdomain problem
am 05.09.2007 17:06:45 von Burning_Ranger
On 5 Sep, 15:48, Davide Bianchi wrote:
> As said before, just use '*', not a real IP (or a fake one)
>
> And where is the OTHER VirtualHost entry?
This is what I have now:
NameVirtualHost *:80
DocumentRoot "E:/apache"
ServerName example.com
DocumentRoot "E:/wordpress"
ServerName wordpress.example.com
> > Do I need to create a CNAME record for wordpress.example.com?
>
> Yes.
>
> > There are the records I have now:
> > @ A 87.194.XXX.XXX
>
> Well, this should be enough since everything is resolved to that IP.
>
> What exactly do you mean with 'it doesn't work'? What does it do when
> you try to access it from the browser?
It just gives me the usual "cannot display the page (i.e.) / server
not found (firefox)" when I try http://wordpress.example.com/
I'm using the latest WAMP server if that's any clue.. bugger...
Re: VirtualHosts / Subdomain problem
am 05.09.2007 17:20:33 von Burning_Ranger
On 5 Sep, 15:48, Davide Bianchi wrote:
> As said before, just use '*', not a real IP (or a fake one)
>
> And where is the OTHER VirtualHost entry?
This is what I have now:
NameVirtualHost *:80
DocumentRoot "E:/apache"
ServerName example.com
DocumentRoot "E:/wordpress"
ServerName wordpress.example.com
> > Do I need to create a CNAME record for wordpress.example.com?
>
> Yes.
>
> > There are the records I have now:
> > @ A 87.194.XXX.XXX
>
> Well, this should be enough since everything is resolved to that IP.
>
> What exactly do you mean with 'it doesn't work'? What does it do when
> you try to access it from the browser?
It just gives me the usual "cannot display the page (i.e.) / server
not found (firefox)" when I try http://wordpress.example.com/
I'm using the latest WAMP server if that's any clue.. bugger...
Re: VirtualHosts / Subdomain problem
am 05.09.2007 17:30:09 von phantom
"Davide Bianchi" wrote in message
news:slrnfdtgcc.2pm.davideyeahsure@fogg.onlyforfun.net...
> On 2007-09-05, Burning_Ranger wrote:
>> On 5 Sep, 15:13, Davide Bianchi wrote:
>> There are the records I have now:
>> @ A 87.194.XXX.XXX
>
> Well, this should be enough since everything is resolved to that IP.
>
I don't know what DNS server you use, but for me that would *only* resolve
example.com but not .example.com.
Adding a wildcard entry like:
* CNAME example.com.
would resolve .example.com.
Re: VirtualHosts / Subdomain problem
am 05.09.2007 17:36:24 von Jim Hayter
Burning_Ranger wrote:
> I have a domain, let's call it www.example.com
>
> I have set up my primary website on my home PC (Win32 Apache IP
> address 192.168.1.64), done all the port forwarding etc and done
> everything and it all works fine.
>
> What I want to do now is setup a subdomain so I can create a blog on
> the same machine and it will be accessible via wordpress.example.com
> from the Internet.
>
>
> This is what I have at the end of my httpd.conf file.
>
> NameVirtualHost example.com
>
> ServerName wordpress.example.com
> DocumentRoot "E:/wordpress"
>
>
> also tried
>
> NameVirtualHost 11.22.33.44
>
>
> ServerName wordpress.example.com
> DocumentRoot "E:/wordpress"
>
>
> where 11.22.33.44 is my external static IP, as well as various
> combinations of IP addresses and hostnames, but nothing works.
>
> I haven't done anything with DNS records, just the two basic A records
> eexist for the main website. Do I need to? Nor have I touched the
> hosts file on my PC since I want I want to access my blog subdomain
> from the internet to verify it's working.
>
> Any ideas?
>
Are you testing this from the same internal network that the web server
is on? If so, does your router support you using the external IP
address from the internal network? Many do not (you have to put an
entry in the hosts file with the internal address).
You might try testing from outside your network.
Jim
Re: VirtualHosts / Subdomain problem
am 05.09.2007 18:02:19 von Burning_Ranger
On 5 Sep, 16:36, Jim Hayter wrote:
> Burning_Ranger wrote:
> > I have a domain, let's call itwww.example.com
>
> > I have set up my primary website on my home PC (Win32 Apache IP
> > address 192.168.1.64), done all the port forwarding etc and done
> > everything and it all works fine.
>
> > What I want to do now is setup a subdomain so I can create a blog on
> > the same machine and it will be accessible via wordpress.example.com
> > from the Internet.
>
> > This is what I have at the end of my httpd.conf file.
>
> > NameVirtualHost example.com
> >
> > ServerName wordpress.example.com
> > DocumentRoot "E:/wordpress"
> >
>
> > also tried
>
> > NameVirtualHost 11.22.33.44
>
> >
> > ServerName wordpress.example.com
> > DocumentRoot "E:/wordpress"
> >
>
> > where 11.22.33.44 is my external static IP, as well as various
> > combinations of IP addresses and hostnames, but nothing works.
>
> > I haven't done anything with DNS records, just the two basic A records
> > eexist for the main website. Do I need to? Nor have I touched the
> > hosts file on my PC since I want I want to access my blog subdomain
> > from the internet to verify it's working.
>
> > Any ideas?
>
> Are you testing this from the same internal network that the web server
> is on? If so, does your router support you using the external IP
> address from the internal network? Many do not (you have to put an
> entry in the hosts file with the internal address).
>
> You might try testing from outside your network.
>
> Jim
Strange thing is if I move the wordpress folder to the E:/apache
folder, and then try to access it internally (after having added the
relevant bit to the hosts file) it works fine. But it doesn't work if
I have the wordpress folder in paraell to the apache htdocs fodler (E:/
apache). It doesn't work at all from outside.
I have tried testing it from outside the network, but no luck (RDPed
into work PC).
Re: VirtualHosts / Subdomain problem
am 05.09.2007 18:12:19 von Jim Hayter
Burning_Ranger wrote:
> On 5 Sep, 16:36, Jim Hayter wrote:
>> Burning_Ranger wrote:
snip original post
>> Are you testing this from the same internal network that the web server
>> is on? If so, does your router support you using the external IP
>> address from the internal network? Many do not (you have to put an
>> entry in the hosts file with the internal address).
>>
>> You might try testing from outside your network.
>>
>> Jim
>
> Strange thing is if I move the wordpress folder to the E:/apache
> folder, and then try to access it internally (after having added the
> relevant bit to the hosts file) it works fine. But it doesn't work if
> I have the wordpress folder in paraell to the apache htdocs fodler (E:/
> apache). It doesn't work at all from outside.
>
> I have tried testing it from outside the network, but no luck (RDPed
> into work PC).
>
If you move the docroot for wordpress outside the E:/apache folder,
perhaps you need a Directory stanza allowing access to it.
Re: VirtualHosts / Subdomain problem
am 05.09.2007 18:13:10 von phantom
"Burning_Ranger" wrote in message
news:1189008139.023691.271370@57g2000hsv.googlegroups.com...
> Strange thing is if I move the wordpress folder to the E:/apache
> folder, and then try to access it internally (after having added the
> relevant bit to the hosts file) it works fine. But it doesn't work if
> I have the wordpress folder in paraell to the apache htdocs fodler (E:/
> apache). It doesn't work at all from outside.
>
aha, you might need:
order allow,deny
Allow from all
Re: VirtualHosts / Subdomain problem
am 06.09.2007 04:08:32 von Steve
On Wed, 05 Sep 2007 08:06:15 -0700, Burning_Ranger wrote:
> On 5 Sep, 15:48, Davide Bianchi wrote:
>> As said before, just use '*', not a real IP (or a fake one)
>>
>> And where is the OTHER VirtualHost entry?
>
> This is what I have now:
>
> NameVirtualHost *:80
>
> DocumentRoot "E:/apache"
> ServerName example.com
>
>
>
> DocumentRoot "E:/wordpress"
> ServerName wordpress.example.com
>
>
>> > Do I need to create a CNAME record for wordpress.example.com?
>>
>> Yes.
>>
>> > There are the records I have now:
>> > @ A 87.194.XXX.XXX
>>
>> Well, this should be enough since everything is resolved to that IP.
>>
>> What exactly do you mean with 'it doesn't work'? What does it do when
>> you try to access it from the browser?
>
> It just gives me the usual "cannot display the page (i.e.) / server
> not found (firefox)" when I try http://wordpress.example.com/
>
> I'm using the latest WAMP server if that's any clue.. bugger...
If you want to resolve both of these correctly, you'll have to use
dns/hosts to resolve the names to your server IP address, but obviously
the results will need to be different depending on whether you're internal
or external. It's pretty easy to do... I think it's called a 'split brain'
dns. As long as the names resolve correctly on the web server - whether
they be to the local or external ip address ( or probably anything else!
), the server will be happy. As long as dns points the name to the correct
IP address for your current location, everything will work.
I use this scenario to let customers test my web development stuff - a
wildcard dns entry globally points them to my adsl router, which forwards
traffic on port 80 to the web server. Internally, my dns server points the
same name to the local 192.168... address, and I can test from my
workstation.