FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 02-13-2009, 04:49 AM
Zach Uram
 
Default serving wrong index.html ?

Hi,

I added name based vhosts to my Apache2 install on Debian lenny, but
now when I go to my site:
http://www.jesujuva.org or http://jesujuva.org instead of serving up
/var/www/index.html it serves /var/www/bach/index.html ! Here are my
files:

debian:/etc/apache2# ls sites-available/
bach darcs netrek wiki wp
debian:/etc/apache2# ls sites-enabled/
bach darcs netrek wiki wp

debian:/etc/apache2# cat sites-enabled/bach
<VirtualHost *:80>
ServerName bach.jesujuva.org
DocumentRoot /var/www/bach
</VirtualHost>

Zach


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-13-2009, 07:54 AM
Dennis Kramer
 
Default serving wrong index.html ?

Hi Zach,

For getting name based vhosts to work properly you should use
NameVirtualHost.


e.g.
NameVirtualHost *:80
<VirtualHost *:80>
ServerName bach.jesujuva.org
DocumentRoot /var/www/bach
</VirtualHost>


On Fri, 13 Feb 2009, Zach Uram wrote:


Hi,

I added name based vhosts to my Apache2 install on Debian lenny, but
now when I go to my site:
http://www.jesujuva.org or http://jesujuva.org instead of serving up
/var/www/index.html it serves /var/www/bach/index.html ! Here are my
files:

debian:/etc/apache2# ls sites-available/
bach darcs netrek wiki wp
debian:/etc/apache2# ls sites-enabled/
bach darcs netrek wiki wp

debian:/etc/apache2# cat sites-enabled/bach
<VirtualHost *:80>
ServerName bach.jesujuva.org
DocumentRoot /var/www/bach
</VirtualHost>

Zach


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org




--
M.D. Kramer
Fingerprint: 7A29 D2CD AFC0 6871 EA6E 0D0E 2DAF EE6B 9926 5743
"When you have eliminated the impossible, whatever remains, however improbable, must be the truth"


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-13-2009, 10:30 AM
Dennis Kramer
 
Default serving wrong index.html ?

Hi Zach,

My current configuration of name based vhost file is restricted to one
file (instead of multiples, like yours).


You could put al your vhosts in one file, e.g.:

#cat /etc/apache2/sites-available/default
NameVirtualHost *:80
<VirtualHost *:80>
ServerAlias bach.jesujuva.org
DocumentRoot /var/www/bach
</VirtualHost>

<VirtualHost *:80>
ServerAlias darcs.jesujuva.org
DocumentRoot /var/www/darcs
ErrorLog /var/log/apache2/error.log
TransferLog /var/log/apache2/access.log
</VirtualHost>

<VirtualHost *:80>
ServerAlias netrek.jesujuva.org
DocumentRoot /var/www/netrek
ErrorLog /var/log/apache2/error.log
TransferLog /var/log/apache2/access.log
</VirtualHost>

<VirtualHost *:80>
ServerAlias wiki.jesujuva.org
DocumentRoot /var/lib/mediawiki1.7
ErrorLog /var/log/apache2/error.log
TransferLog /var/log/apache2/access.log
</VirtualHost>

<VirtualHost *:80>
ServerAlias blog.jesujuva.org
DocumentRoot /var/www/wordpress
ErrorLog /var/log/apache2/error.log
TransferLog /var/log/apache2/access.log
</VirtualHost>

See if that works out for you.

On Fri, 13 Feb 2009, Zach Uram wrote:


Hoi Dennis,

I followed your suggestion and added that NameVirtualHost statement to
each of my 4 vhost files in /etc/apache2/sites-available and now I get
many warnings:

debian:/etc/apache2/sites-available# /etc/init.d/apache2 restart
Restarting web server: apache2[Thu Feb 12 18:33:33 2009] [warn]
NameVirtualHost *:80 has no VirtualHosts
[Thu Feb 12 18:33:33 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
[Thu Feb 12 18:33:33 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
[Thu Feb 12 18:33:33 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
[Thu Feb 12 18:33:33 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
... waiting [Thu Feb 12 18:33:35 2009] [warn] NameVirtualHost *:80
has no VirtualHosts
[Thu Feb 12 18:33:35 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
[Thu Feb 12 18:33:35 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
[Thu Feb 12 18:33:35 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
[Thu Feb 12 18:33:35 2009] [warn] NameVirtualHost *:80 has no VirtualHosts

Without adding that NameVirtualHost all my vhosts work fine the only
problem is when i enter http://www.jesujuva.org or http://jesujuva.org
it will serve /var/www/bach/index.html instead of /var/www/index.html
so how can I fix this?

Here are my vhost files:


<snip>

--
M.D. Kramer
Fingerprint: 7A29 D2CD AFC0 6871 EA6E 0D0E 2DAF EE6B 9926 5743

"When you have eliminated the impossible, whatever remains, however improbable, must be the truth"


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 02-13-2009, 11:02 PM
Freddy Freeloader
 
Default serving wrong index.html ?

Zach Uram wrote:

Hi,

I added name based vhosts to my Apache2 install on Debian lenny, but
now when I go to my site:
http://www.jesujuva.org or http://jesujuva.org instead of serving up
/var/www/index.html it serves /var/www/bach/index.html ! Here are my
files:

debian:/etc/apache2# ls sites-available/
bach darcs netrek wiki wp
debian:/etc/apache2# ls sites-enabled/
bach darcs netrek wiki wp

debian:/etc/apache2# cat sites-enabled/bach
<VirtualHost *:80>
ServerName bach.jesujuva.org
DocumentRoot /var/www/bach
</VirtualHost>

Zach



Apache is doing exactly what you are asking it to do. You are pointing
to /var/www/bach as the DocumentRoot for jesujuva.org. So, of course
it is going to be serving /var/www/back/index.html. If you want to
serve a different set of files you have to point Apache to that set of
files. For example, if the index.html file for jesujuva.org is inside
the /var/www/jesujuva directory you would use that directory as your
DocumentRoot. If the DocumentRoot for jesujuva.org is in /var/www then
that is where you would point Apache.

I agree with one of the other people who replied here. It's much easier
to put the configuration for all your sites in a single file.



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 05:11 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org