Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Virtual Hosts on different ports

0 views
Skip to first unread message

Aethaelweard

unread,
Nov 13, 2009, 12:20:04 PM11/13/09
to
Hi, I've been struggling for days with virtual hosts.. We have a new
install of apache 2 on Suse. I've managed to get one virtual host
working with a domain. But I'm trying to add a second virtual host
that'll answer to the address with port number 8008.

In httpd.conf I've got

Include /etc/apache2/vhosts.d/*.conf

telling apache to look for virtual host configuration files in that
directory. That seems to work OK.

In listen.conf I've got

Listen 80
Listen 8008

and

NameVirtualHost {the IP number}:8008

In my vhosts.d directory I've got two files. One, for the main
website, has

<VirtualHost *:80>
ServerName {the domain name}
DocumentRoot /srv/www/htdocs/{site directory}
etc.

This seems to work OK and sends visitors to the right place when they
request the main address.

I also wanted to have a separate site under 8008, so in a second file
in vhosts.d I say

<VirtualHost {the IP number}:8008>
DocumentRoot /srv/www/htdocs/{other site directory}
ServerName {the domain name}:8008
</VirtualHost>

But requests to the domain name with port 8008 and to the IP number
with port 8008 get no response.

I've tried every variation of address and IP number I can think of.
Can some kind person please tell me where I'm going wrong?

Cheers
Fred

Jan C. Faerber

unread,
Nov 13, 2009, 12:52:03 PM11/13/09
to
On Nov 13, 6:20 pm, Aethaelweard <andfina...@gmail.com> wrote:
> But I'm trying to add a second virtual host
> that'll answer to the address with port number 8008.

Here is that doc:
http://httpd.apache.org/docs/2.0/vhosts/examples.html#port

> In listen.conf I've got
>
> Listen 80
> Listen 8008
>
> and
>
> NameVirtualHost {the IP number}:8008

In my listen.conf I find that section as an annotation:
# Use name-based virtual hosting
#
# - on a specified address / port:
#
#NameVirtualHost 12.34.56.78:80
#
# - name-based virtual hosting:
#
#NameVirtualHost *:80
#
# - on all addresses and ports. This is your best bet when you are on
# dynamically assigned IP addresses:
#
#NameVirtualHost *

Are you doing name-based virtual hosting?

> I also wanted to have a separate site under 8008, so in a second file
> in vhosts.d I say
>
> <VirtualHost {the IP number}:

>         ServerName {the domain name}:8008

In the given url above they don't write a port here in the end.
But here: <VirtualHost {the IP number}:8008>

> But requests to the domain name with port 8008 and to the IP number
> with port 8008 get no response.

Try to set a firewall rule allowing access to your machine on port
8008.

Jan C. Faerber

unread,
Nov 14, 2009, 11:57:35 AM11/14/09
to
On Nov 13, 6:52 pm, "Jan C. Faerber" <faerber....@gmail.com> wrote:

> Are you doing name-based virtual hosting?

I am not sure about that.

> Try to set a firewall rule allowing access to your machine on port
> 8008.

Another thing I just found out:
I had to set up my router aswell!
Do you use any routers as "gateway" to the www?
Then you have to add probably a virtual server on your private static
ip with port 8008/8008.

Davide Bianchi

unread,
Nov 15, 2009, 2:56:56 AM11/15/09
to
On Nov 13, 6:20 pm, Aethaelweard <andfina...@gmail.com> wrote:
> But requests to the domain name with port 8008 and to the IP number
> with port 8008 get no response.

It sounds like a firewall problem. Check if your httpd is listening on
port 8008 (netstat -an | grep 8008 will tell you) and if it is, check
if you have a firewall that prevent connections on port 8008.

Davide

Aethaelweard

unread,
Nov 18, 2009, 4:13:54 AM11/18/09
to
Many thanks for your help Jan and Davide - firewall was indeed
blocking that port. Thanks for setting me right again guys!

Fred

0 new messages