apache virtualhost configuration (ubuntu)
apache virtualhost configuration (ubuntu)
am 15.08.2007 12:31:24 von henri
Hi,
First post in this group and not exactly a noob in apache configuration;
BUT having a hard time setting up a virtual host.
Right now I'm accessing http://localhost. In addition to this I want to
set up a virtual host, say www.vh.com. The idea is to get both
http://localhost and http://www.vh.com
So, along with the "default" file sitting in sites-available, I have
created a vh.com file and enable it via a2ensite vh.com
I have also enabled the vhost_alias mod.
The vh.com file is this:
NameVirtualHost vh.com
DocumentRoot /var/www/htdocs/vh/
ServerName www.woop.com
ServerAdmin webmaster@woop.com
Options Indexes +FollowSymLinks ExecCGI
But I can't seem to get it working since when directing my browser to
www.vh.com it fails to catch the virtual host and lead me to some
www.vh.com park-page out there.
I've been struggling with that since yesterday.
Can a kind and apache-savvy soul help me?
Henri
Config: Apache/2.2.3 (Ubuntu) PHP/5.2.1 mod_perl/2.0.2 Perl/v5.8.8 Server
Re: apache virtualhost configuration (ubuntu)
am 15.08.2007 12:42:41 von mat
Hi henri,
I *am* a bit of a noob at this, but thought I would respond anyway! Feel
free to ingnore/slander.
Surely when you type the address into your browser your browser goes to
a DNS server and then gets redirected to the park page from that,
without consulting apache on any other program on your local machine. To
remedy this, I think you need to put an entry in your hosts file that
directs www.vh.com to localhost and then apache can pick up the slack
from there.
Oh... I should say I'm a linux noob to - that having been said, ubuntu
does seem to have a hosts file:
"The Ubuntu Linux hosts file is usually at. /etc/hosts"
Hope that helps.
mat
henri wrote:
> Hi,
>
> First post in this group and not exactly a noob in apache configuration;
> BUT having a hard time setting up a virtual host.
> Right now I'm accessing http://localhost. In addition to this I want to
> set up a virtual host, say www.vh.com. The idea is to get both
> http://localhost and http://www.vh.com
> So, along with the "default" file sitting in sites-available, I have
> created a vh.com file and enable it via a2ensite vh.com
> I have also enabled the vhost_alias mod.
>
> The vh.com file is this:
>
> NameVirtualHost vh.com
>
> DocumentRoot /var/www/htdocs/vh/
> ServerName www.woop.com
> ServerAdmin webmaster@woop.com
>
> Options Indexes +FollowSymLinks ExecCGI
>
>
>
> But I can't seem to get it working since when directing my browser to
> www.vh.com it fails to catch the virtual host and lead me to some
> www.vh.com park-page out there.
>
> I've been struggling with that since yesterday.
>
> Can a kind and apache-savvy soul help me?
>
> Henri
>
> Config: Apache/2.2.3 (Ubuntu) PHP/5.2.1 mod_perl/2.0.2 Perl/v5.8.8 Server
Re: apache virtualhost configuration (ubuntu)
am 15.08.2007 12:45:44 von unknown
Post removed (X-No-Archive: yes)
Re: apache virtualhost configuration (ubuntu)
am 15.08.2007 12:53:49 von David McKenzie
Davide Bianchi wrote:
> On 2007-08-15, henri wrote:
>> NameVirtualHost vh.com
>
> You only need ONE NameVirtualHost directive, if you already have one
> in another part of your configuration remove this. The directive must
> specify an ipaddress or '*' to match any IP address on the machine,
> since what you want is to be able to use a NAME and not an IP, I suggest
> you stick with '*' (this if there isn't another NameVirtualHost
> directive).
> Davide
>
Couldn't have said it better myself. One thing to add, though, make sure
you check the DNS is pointing to the right IP. This is done through the
following command:
$ dig www.vh.com
--
DM davidm@cia.com.au
'It would go against respecting principles and truth if you have to
respect and accept anything just because it is the other side's view.'
- Kim Jung Ill
Re: apache virtualhost configuration (ubuntu)
am 15.08.2007 13:19:02 von henri
On Wed, 15 Aug 2007 11:42:41 +0100, mat wrote:
> Hi henri,
>
> I *am* a bit of a noob at this, but thought I would respond anyway! Feel
> free to ingnore/slander.
>
> Surely when you type the address into your browser your browser goes to
> a DNS server and then gets redirected to the park page from that,
> without consulting apache on any other program on your local machine. To
> remedy this, I think you need to put an entry in your hosts file that
> directs www.vh.com to localhost and then apache can pick up the slack
> from there.
>
> Oh... I should say I'm a linux noob to - that having been said, ubuntu
> does seem to have a hosts file:
>
> "The Ubuntu Linux hosts file is usually at. /etc/hosts"
>
> Hope that helps.
>
> mat
>
>
>
> henri wrote:
>> Hi,
>>
>> First post in this group and not exactly a noob in apache configuration;
>> BUT having a hard time setting up a virtual host.
>> Right now I'm accessing http://localhost. In addition to this I want to
>> set up a virtual host, say www.vh.com. The idea is to get both
>> http://localhost and http://www.vh.com
>> So, along with the "default" file sitting in sites-available, I have
>> created a vh.com file and enable it via a2ensite vh.com
>> I have also enabled the vhost_alias mod.
>>
>> The vh.com file is this:
>>
>> NameVirtualHost vh.com
>>
>> DocumentRoot /var/www/htdocs/vh/
>> ServerName www.woop.com
>> ServerAdmin webmaster@woop.com
>>
>> Options Indexes +FollowSymLinks ExecCGI
>>
>>
>>
>> But I can't seem to get it working since when directing my browser to
>> www.vh.com it fails to catch the virtual host and lead me to some
>> www.vh.com park-page out there.
>>
>> I've been struggling with that since yesterday.
>>
>> Can a kind and apache-savvy soul help me?
>>
>> Henri
>>
>> Config: Apache/2.2.3 (Ubuntu) PHP/5.2.1 mod_perl/2.0.2 Perl/v5.8.8 Server
ok, now that was rather stupid of me to overlook that... the hosts file...
thanks mat
although I'm not entirely happy since it looks like this virtual host acts
just like a redirect, eg, when I type http://www.vh.com my browser
leads me to http://localhost/vh/. Which is the right place, but shouldn't
the url stay www.vh.com/ or should I put some rewrite rule in an .htaccess?
henri
Re: apache virtualhost configuration (ubuntu)
am 15.08.2007 13:35:12 von mat
henri wrote:
> On Wed, 15 Aug 2007 11:42:41 +0100, mat wrote:
>
>> Hi henri,
>>
>> I *am* a bit of a noob at this, but thought I would respond anyway! Feel
>> free to ingnore/slander.
>>
>> Surely when you type the address into your browser your browser goes to
>> a DNS server and then gets redirected to the park page from that,
>> without consulting apache on any other program on your local machine. To
>> remedy this, I think you need to put an entry in your hosts file that
>> directs www.vh.com to localhost and then apache can pick up the slack
>> from there.
>>
>> Oh... I should say I'm a linux noob to - that having been said, ubuntu
>> does seem to have a hosts file:
>>
>> "The Ubuntu Linux hosts file is usually at. /etc/hosts"
>>
>> Hope that helps.
>>
>> mat
>>
>>
>>
>> henri wrote:
>>> Hi,
>>>
>>> First post in this group and not exactly a noob in apache configuration;
>>> BUT having a hard time setting up a virtual host.
>>> Right now I'm accessing http://localhost. In addition to this I want to
>>> set up a virtual host, say www.vh.com. The idea is to get both
>>> http://localhost and http://www.vh.com
>>> So, along with the "default" file sitting in sites-available, I have
>>> created a vh.com file and enable it via a2ensite vh.com
>>> I have also enabled the vhost_alias mod.
>>>
>>> The vh.com file is this:
>>>
>>> NameVirtualHost vh.com
>>>
>>> DocumentRoot /var/www/htdocs/vh/
>>> ServerName www.woop.com
>>> ServerAdmin webmaster@woop.com
>>>
>>> Options Indexes +FollowSymLinks ExecCGI
>>>
>>>
>>>
>>> But I can't seem to get it working since when directing my browser to
>>> www.vh.com it fails to catch the virtual host and lead me to some
>>> www.vh.com park-page out there.
>>>
>>> I've been struggling with that since yesterday.
>>>
>>> Can a kind and apache-savvy soul help me?
>>>
>>> Henri
>>>
>>> Config: Apache/2.2.3 (Ubuntu) PHP/5.2.1 mod_perl/2.0.2 Perl/v5.8.8 Server
>
> ok, now that was rather stupid of me to overlook that... the hosts file...
> thanks mat
>
> although I'm not entirely happy since it looks like this virtual host acts
> just like a redirect, eg, when I type http://www.vh.com my browser
> leads me to http://localhost/vh/. Which is the right place, but shouldn't
> the url stay www.vh.com/ or should I put some rewrite rule in an .htaccess?
>
> henri
Hi henri - sorry, this is where I bow out due to insufficient knowledge!
I remember an article on this however, that may help...
http://www.mezzoblue.com/archives/2004/08/05/virtual_host/
Or perhaps some of the guys in the other branch of this thread could help.
Sorry,
Mat
Re: apache virtualhost configuration (ubuntu)
am 15.08.2007 14:27:19 von unknown
Post removed (X-No-Archive: yes)
Re: apache virtualhost configuration (ubuntu)
am 16.08.2007 15:26:36 von henri
On Wed, 15 Aug 2007 12:35:12 +0100, mat wrote:
> henri wrote:
>> On Wed, 15 Aug 2007 11:42:41 +0100, mat wrote:
>>
>>> Hi henri,
>>>
>>> I *am* a bit of a noob at this, but thought I would respond anyway! Feel
>>> free to ingnore/slander.
>>>
>>> Surely when you type the address into your browser your browser goes to
>>> a DNS server and then gets redirected to the park page from that,
>>> without consulting apache on any other program on your local machine. To
>>> remedy this, I think you need to put an entry in your hosts file that
>>> directs www.vh.com to localhost and then apache can pick up the slack
>>> from there.
>>>
>>> Oh... I should say I'm a linux noob to - that having been said, ubuntu
>>> does seem to have a hosts file:
>>>
>>> "The Ubuntu Linux hosts file is usually at. /etc/hosts"
>>>
>>> Hope that helps.
>>>
>>> mat
>>>
>>>
>>>
>>> henri wrote:
>>>> Hi,
>>>>
>>>> First post in this group and not exactly a noob in apache configuration;
>>>> BUT having a hard time setting up a virtual host.
>>>> Right now I'm accessing http://localhost. In addition to this I want to
>>>> set up a virtual host, say www.vh.com. The idea is to get both
>>>> http://localhost and http://www.vh.com
>>>> So, along with the "default" file sitting in sites-available, I have
>>>> created a vh.com file and enable it via a2ensite vh.com
>>>> I have also enabled the vhost_alias mod.
>>>>
>>>> The vh.com file is this:
>>>>
>>>> NameVirtualHost vh.com
>>>>
>>>> DocumentRoot /var/www/htdocs/vh/
>>>> ServerName www.woop.com
>>>> ServerAdmin webmaster@woop.com
>>>>
>>>> Options Indexes +FollowSymLinks ExecCGI
>>>>
>>>>
>>>>
>>>> But I can't seem to get it working since when directing my browser to
>>>> www.vh.com it fails to catch the virtual host and lead me to some
>>>> www.vh.com park-page out there.
>>>>
>>>> I've been struggling with that since yesterday.
>>>>
>>>> Can a kind and apache-savvy soul help me?
>>>>
>>>> Henri
>>>>
>>>> Config: Apache/2.2.3 (Ubuntu) PHP/5.2.1 mod_perl/2.0.2 Perl/v5.8.8 Server
>>
>> ok, now that was rather stupid of me to overlook that... the hosts file...
>> thanks mat
>>
>> although I'm not entirely happy since it looks like this virtual host acts
>> just like a redirect, eg, when I type http://www.vh.com my browser
>> leads me to http://localhost/vh/. Which is the right place, but shouldn't
>> the url stay www.vh.com/ or should I put some rewrite rule in an .htaccess?
>>
>> henri
>
> Hi henri - sorry, this is where I bow out due to insufficient knowledge!
> I remember an article on this however, that may help...
>
> http://www.mezzoblue.com/archives/2004/08/05/virtual_host/
nice site
>
> Or perhaps some of the guys in the other branch of this thread could help.
>
> Sorry,
>
> Mat
ok, everything's working now, the "redirect" problem was due to one perl
script that did not take into into account the new virtual host
henri