You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Tapas Mishra <mi...@gmail.com> on 2010/07/14 11:23:41 UTC

[users@httpd] beginner problem in setting up apache2

I am having different websites in a folder
/var/www/
as
/var/www/atutor
/var/www/dokeos
/var/www/docebolms
.
.
.
/var/www/efront

When I am on lan trying to access these sites as

http://192.168.1.5/dokeos or http://192.168.1.5/docebolms

I am getting a 404 not found page.
The requested URL /dokeos was not found on this server.

here are the response headers to the above said request
http://pastebin.com/g1XDtu1R



another application is dokeos
and response headers which I captured in FireFox when trying to access it

as http://192.168.1.5/docebolms

http://pastebin.com/tiFTRh0A




When I type http://192.168.1.5/
I expect to get a directory listing of different websites which are
present in my /var/www

as per this page http://httpd.apache.org/docs/2.0/mod/core.html#options
where it said if there is no index.html page in that directory
mod_autoindex will generate a directory index.

instead of getting a directory listing I am getting a response from a vhost
atutor

which I should get when I type http://192.168.1.5/atutor
(because apache serves vhosts in alpha numeric order)

in /etc/apache2/sites-available/atutor
I do have a
<Directory /var/www>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>


the complete configuration is here

http://pastebin.com/VpvHdkSP



on lan when ever I am typing http://192.168.1.5/
I am getting response or website which I should get when I type
i.e. http://192.168.1.5/atutor
and if I am typing http://192.168.1.5/docebolms or http;//192.168.1.5/dokes
then URL not found error.

same results with localhost also
-- 
Tapas

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] beginner problem in setting up apache2

Posted by Eric Covener <co...@gmail.com>.
On Wed, Jul 14, 2010 at 8:39 AM, Tapas Mishra <mi...@gmail.com> wrote:
> Thanks a lot Eric it did worked the way you said.
> But please do answer my query which I just before posted.

Specifically?

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] beginner problem in setting up apache2

Posted by Tapas Mishra <mi...@gmail.com>.
Thanks a lot Eric it did worked the way you said.
But please do answer my query which I just before posted.

-- 
Tapas

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] beginner problem in setting up apache2

Posted by Jonas Eckerman <jo...@frukt.org>.
On 2010-07-14 17:41, Tapas Mishra wrote:

> how is localhost hooked up

Usually the hostname "localhost" is resolved through the "hosts" file
(/etc/hosts on unix-like systems), and then resolves to 127.0.0.1.

> because when I am requesting
> http://localhost I am not requesting any  particular vhost which
> contains
> ServerName localhost or ServerAlias localhost.

Yes you are. You are requesting pages from the host called "localhost"
at port 80 at the IP address "localhost" resolves to (normally 127.0.0.1).

If there is no host with servername or serveralias "localhost" at that
address you will get a response from the default host at that address.

/Jonas
-- 
Jonas Eckerman
Fruktträdet & Förbundet Sveriges Dövblinda
http://www.fsdb.org/
http://www.frukt.org/
http://whatever.frukt.org/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] beginner problem in setting up apache2

Posted by Tapas Mishra <mi...@gmail.com>.
Yes Jonas I have read the links you gave  me.
I have finally been able to solve the problem with your and help of
people on this forum.
Here is a link
http://ubuntuforums.org/showthread.php?t=1530746
some one had said to post it on Ubuntu forum since apache2 packages
which are shipped by these OS vendors or default configurations are
changed by the OS developers.
I have finally posted the complete solution to my problem with my
understanding of the documents which you had posted.
I will say that
http://httpd.apache.org/docs/2.2/vhosts/details.html#hostmatching
is difficult part of the process.
Thanks for your  help.



-- 
Tapas
http://mightydreams.blogspot.com
http://wiki.xensource.com/xenwiki/Xen_on_4_app_servers

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] beginner problem in setting up apache2

Posted by Jonas Eckerman <jo...@frukt.org>.
On 2010-07-14 17:41, Tapas Mishra wrote:

>> The filename affects the order the system returns results for an
>> Include directive with a wildcard.

> Can you give a link to what you just mentioned.

Did you actually try to read any of the documentation I gave you links to?

This is documented in the documentation for the Include directive, at:
<http://httpd.apache.org/docs/2.2/mod/core.html#include>

> I want to read more about how apache handles vhost so that in future I
> do not have such problems.If you know some link please share here.

Again: Did you try to read the documentation I gave you links to?

Virtual Hosts are documented at:
<http://httpd.apache.org/docs/2.2/vhosts/>
and more specifically named base virtual hosts, wich you are currently
trying to use, are documented at:
<http://httpd.apache.org/docs/2.2/vhosts/name-based.html>

As a general rule, the Apache httpd documentation, wich can be found
through the Apache httpd home page, contains the documentation for
Apache httpd. In that documentation you can read about how to configure
Apache httpd.

The documentation for Apache httpd 2.2 is at:
<http://httpd.apache.org/docs/2.2/>

The Apache httpd home page is at:
<http://httpd.apache.org/>

/Jonas
-- 
Jonas Eckerman
Fruktträdet & Förbundet Sveriges Dövblinda
http://www.fsdb.org/
http://www.frukt.org/
http://whatever.frukt.org/

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] beginner problem in setting up apache2

Posted by Tapas Mishra <mi...@gmail.com>.
On Wed, Jul 14, 2010 at 6:36 PM, Eric Covener <co...@gmail.com> wrote:

> The filename affects the order the system returns results for an
> Include directive with a wildcard.
Can you give a link to what you just mentioned.

>
> It's really only significant for "the very first one" vs. "all
> others", in the case where your request does not match any specific
> ServerName/ServerAlias -- the first vhost will be used.
>
> If you intentionally create virtualhosts with overlapping ServerName
> and ServerAlias directives, maybe the order matters there too.    The
> primary means for figuring out which name-based vhost to use is based
> on the ServerName/ServerAlias of course.
what ServerName/ServerAlias should I use for default vhost.
I am asking this question because when on localmachine i.e. webserver
in browser we type http://localhost
on Ubuntu based systems we get an html page saying it works.
localhost in this case as per our discussion if I understand correctly
is being served by the default vhost configuration.
which on Ubuntu systems is
http://pastebin.com/gKsmUeJa
how is localhost hooked up because when I am requesting
http://localhost I am not requesting any  particular vhost which
contains
ServerName localhost or ServerAlias localhost.
I want to read more about how apache handles vhost so that in future I
do not have such problems.If you know some link please share here.

-- 
Tapas
http://mightydreams.blogspot.com
http://wiki.xensource.com/xenwiki/Xen_on_4_app_servers

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] beginner problem in setting up apache2

Posted by Eric Covener <co...@gmail.com>.
On Wed, Jul 14, 2010 at 8:34 AM, Tapas Mishra <mi...@gmail.com> wrote:
> On Wed, Jul 14, 2010 at 5:41 PM, Eric Covener <co...@gmail.com> wrote:
>
>> If you want a default that's not the same as any other current
>> virtualhost, add a virtualhost to act as the default.  If you're using
>> a debian-like configuration, prefix your vhost filenames with numbers
>> to control the order.
>  I am using a Debian based setup it is Ubuntu.
> You mean to say the choice of filename for vhost affects the order in
> which vhosts are looked by apache2.

The filename affects the order the system returns results for an
Include directive with a wildcard.

> Meaning a vhost
> with name 000-tapas will be served before the vhost file whose name is tapas.
> Is this the case.

It's really only significant for "the very first one" vs. "all
others", in the case where your request does not match any specific
ServerName/ServerAlias -- the first vhost will be used.

If you intentionally create virtualhosts with overlapping ServerName
and ServerAlias directives, maybe the order matters there too.    The
primary means for figuring out which name-based vhost to use is based
on the ServerName/ServerAlias of course.


-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] beginner problem in setting up apache2

Posted by Tapas Mishra <mi...@gmail.com>.
On Wed, Jul 14, 2010 at 5:41 PM, Eric Covener <co...@gmail.com> wrote:

> If you want a default that's not the same as any other current
> virtualhost, add a virtualhost to act as the default.  If you're using
> a debian-like configuration, prefix your vhost filenames with numbers
> to control the order.
 I am using a Debian based setup it is Ubuntu.
You mean to say the choice of filename for vhost affects the order in
which vhosts are looked by apache2.
Meaning a vhost
with name 000-tapas will be served before the vhost file whose name is tapas.
Is this the case.


-- 
Tapas
http://mightydreams.blogspot.com
http://wiki.xensource.com/xenwiki/Xen_on_4_app_servers

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] beginner problem in setting up apache2

Posted by Eric Covener <co...@gmail.com>.
> does that mean I need to have following line
>  ServerName default

No, it's just the default because it's the first one listed (for a
given set of NameVirtualHosts.

If you want a default that's not the same as any other current
virtualhost, add a virtualhost to act as the default.  If you're using
a debian-like configuration, prefix your vhost filenames with numbers
to control the order.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] beginner problem in setting up apache2

Posted by Tapas Mishra <mi...@gmail.com>.
I forgot to mention in previous message why is it taking atutor as default.
http://httpd.apache.org/docs/2.2/vhosts/details.html
is the document I am trying to understand but a default virtualhost
thing is not clear to me.

Following lines
" the request is served from the _default_ vhost if there is such a
vhost for the port to which the client sent the request. If there is
no matching _default_ vhost the request is served from the
main_server."

does that mean I need to have following line
 ServerName default

which tells that this is the default vhost to be served.
I just got a reply from some one on a different problem
http://www.spinics.net/lists/apache-users/msg95700.html
but this is  some how related to this problem also.
I am not able to understand how does Apache sees the vhosts i.e. how
does it decided which vhost it has to serve first and which vhost it
has to serve later.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] beginner problem in setting up apache2

Posted by Tapas Mishra <mi...@gmail.com>.
On Wed, Jul 14, 2010 at 4:12 PM, Eric Covener <co...@gmail.com> wrote:

> And what does your error log say when you get this 404, exactly?
The error logs are blank.

>> When I type http://192.168.1.5/
>> I expect to get a directory listing of different websites which are
>> present in my /var/www
>
> Include apachectl -S / apache2ctl -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80                   is a NameVirtualHost
         default server atutor (/etc/apache2/sites-enabled/atutor:1)
         port 80 namevhost atutor (/etc/apache2/sites-enabled/atutor:1)
         port 80 namevhost claroline (/etc/apache2/sites-enabled/claroline:1)
         port 80 namevhost docebolms (/etc/apache2/sites-enabled/docebolms:1)
         port 80 namevhost dokeos (/etc/apache2/sites-enabled/dokeos:1)
         port 80 namevhost efront (/etc/apache2/sites-enabled/efront:1)
         port 80 namevhost olat (/etc/apache2/sites-enabled/olat:1)
         port 80 namevhost mydomain.com
(/etc/apache2/sites-enabled/mydomain.com:1)
         port 80 namevhost sakai (/etc/apache2/sites-enabled/sakai:1)
Syntax OK


>along with the full contents of
> the virtual host you think is going to give you a directory listing.
I am not clear on this part.I read this
http://httpd.apache.org/docs/2.2/vhosts/details.html
and in the section where it is talking about Hash Table lookups

I could not understand the meaning of this line
"If the lookup fails (the IP address wasn't found) the request is
served from the _default_ vhost if there is such a vhost for the port
to which the client sent the request. If there is no matching
_default_ vhost the request is served from the main_server."

the configuration of atutor which is being served by default always
is
http://pastebin.com/x5pDyiqt

Which virtualhost shoud serve the request by default I am not clear on
this part as each time the server name has to be different.




-- 
Tapas

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] beginner problem in setting up apache2

Posted by Eric Covener <co...@gmail.com>.
On Wed, Jul 14, 2010 at 5:23 AM, Tapas Mishra <mi...@gmail.com> wrote:
> http://192.168.1.5/dokeos or http://192.168.1.5/docebolms
>
> I am getting a 404 not found page.

And what does your error log say when you get this 404, exactly?

> When I type http://192.168.1.5/
> I expect to get a directory listing of different websites which are
> present in my /var/www

Include apachectl -S / apache2ctl -S along with the full contents of
the virtual host you think is going to give you a directory listing.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org