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 > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 10-09-2008, 03:47 PM
Mike -- EMAIL IGNORED
 
Default NameVirtualHost and CGI Problems

On: Centos 5.2, with httpd-2.2.3-11.el5_1.centos.3

I tried to bring up a web server using an
httpd.con that runs well

on: Fedora 8, with httpd-2.2.8-1.fc8

as well as several earlier versions, going
back to Fedora 4.

On the Centos version, I cannot successfully:
run a NameVirtualHost;
execute a CGI.

I can bring up a simple page if I avoid the
above.

Suggestions would be much appresiated.
Thanks,
Mike.

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-09-2008, 03:51 PM
Ralph Angenendt
 
Default NameVirtualHost and CGI Problems

Mike -- EMAIL IGNORED wrote:
> On: Centos 5.2, with httpd-2.2.3-11.el5_1.centos.3
>
> I tried to bring up a web server using an
> httpd.con that runs well
>
> On the Centos version, I cannot successfully:
> run a NameVirtualHost;
> execute a CGI.
>
> I can bring up a simple page if I avoid the
> above.

Don't we all like puzzles? All those hundreds of pieces which look
similar? Is that blue one there sky or is it the water? The green one
over there - is it a tree? Is it a part of that house which has been
painted green?

If you want to solve that puzzle, it often helps to look at the picture
on the top of the box.

IOW: What did you try to do? What happened? What did you expect to
happen? What does your config look like? Are there any errors in the log
file?

Ralph
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-09-2008, 04:59 PM
Mike -- EMAIL IGNORED
 
Default NameVirtualHost and CGI Problems

On Thu, 09 Oct 2008 17:51:54 +0200, Ralph Angenendt wrote:

[...]
> Don't we all like puzzles? All those hundreds of pieces which look
> similar? Is that blue one there sky or is it the water? The green one
> over there - is it a tree? Is it a part of that house which has been
> painted green?
>
> If you want to solve that puzzle, it often helps to look at the picture
> on the top of the box.
>
> IOW: What did you try to do? What happened? What did you expect to
> happen? What does your config look like? Are there any errors in the log
> file?
>
> Ralph
[...]

Indeed. Here is a summary:

ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
...
NameVirtualHost 192.168.9.21:80
NameVirtualHost 127.0.0.1:80
...
<VirtualHost 192.168.9.21:80>
<Location />
Order allow,deny
# Allow from All
Deny from all
</Location>
</VirtualHost>

<VirtualHost 192.168.9.21:80 127.0.0.1:80>
ServerName new.rosemike.net
Options -All SymLinksIfOwnerMatch ExecCGI
DocumentRoot "/var/www/html/www"
DirectoryIndex index.cgi
RewriteEngine on
RewriteOptions Inherit
...
RewriteRule ^/$ - [L]
...
</VirtualHost>

All access attempts are with http://new.rosemike.net/
with that name appropriately defined in hosts files, as
verified by ping.

Now run as shown, the client gets:
"You don't have permission to access / on this server."
If you comment out the first VirtualHost block:
you get the same thing
If you then add to the second virtual host block:
<Location />
Allow from All
</Location>
you get:
"You don't have permission to access /index.cgi on this server."
(note that there are links to index.cgi in all directories.)
if you comment out Servername
nothing changes
If you now expose the first VirtualHost block and change to
Allow from All
Deny from None
you get the page displayed, but not via the CGI, as verified
by absence debug text the CGI would have added, as well as
nothing in a log the CGI writes.

Well, you asked. BTW, I emphasize that this configuration works
well on Fedora, which you can see at www.rosemike.net .

Thanks for your interest.
Mike.

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-09-2008, 05:14 PM
Jerry Franz
 
Default NameVirtualHost and CGI Problems

Mike -- EMAIL IGNORED wrote:

On Thu, 09 Oct 2008 17:51:54 +0200, Ralph Angenendt wrote:

[...]


[...] IOW: What did you try to do? What happened? What did you expect to
happen? What does your config look like? Are there any errors in the log
file?

Ralph



[...]

Indeed. Here is a summary:
[...]



What do you get in the error_log?

--
Benjamin Franz
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-09-2008, 06:07 PM
Mike -- EMAIL IGNORED
 
Default NameVirtualHost and CGI Problems

On Thu, 09 Oct 2008 10:14:54 -0700, Jerry Franz wrote:

[...]

> What do you get in the error_log?

I found the CGI problem (mia culpa), and the CGI
is now working, but the NameVirtualHost still has
a problem.

NameVirtualHost 192.168.9.21:80
NameVirtualHost 127.0.0.1:80
...

<VirtualHost 192.168.9.21:80>
<Location />
Order allow,deny
Allow from None
Deny from All
</Location>
</VirtualHost>

<VirtualHost 192.168.9.21:80 127.0.0.1:80>
ServerName new.rosemike.net
Options -All SymLinksIfOwnerMatch ExecCGI
DocumentRoot "/var/www/html/www"
DirectoryIndex index.cgi
RewriteEngine on
...

With the above I get:
[client 192.168.9.10] client denied by server configuration:
/var/www/html/www/
[client 192.168.9.10] client denied by server configuration:
/var/www/error/noindex.html

If I comment out the first VirtualHost block I get correct
function. Most notably, "correct function" persists if I
comment out the ServerName line. It appears the ServerName line
is ignored in all cases. I also tried changing the order of
the VirtualHost blocks. No change.

Thanks again for your interest.
Mike.

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-09-2008, 07:28 PM
Mike -- EMAIL IGNORED
 
Default NameVirtualHost and CGI Problems

On Thu, 09 Oct 2008 18:07:08 +0000, Mike -- EMAIL IGNORED wrote:

[...]

I have additional information that ServerName is not working.
My system requires two virtual hosts with different values of
ServerName. If they share an IP address, the system fails.
But if each virtual host has a unique IP address, the system
works.

In other words, ServerName alone fails to distinguish two
named virtual hosts.

Mike.

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-09-2008, 07:31 PM
Kai Schaetzl
 
Default NameVirtualHost and CGI Problems

what's the purpose of that whole confusing configuration? If you want to
use IP-based virtualhosts *any* of them needs a servername. And why do you
enclose the Location statement in a virtualhost? Why don't you simply
specify the real location? And I would use <Location "/"> to make it look
less like XML.

> Options -All SymLinksIfOwnerMatch ExecCGI
you don't need to remove All

>From my perspective you aim at a really hard to read and understand
configuration. I wouldn't ever dare to mix the IP-based hosts like you try
to do. Simplify your config and it will work.

Kai

--
Kai Schätzl, Berlin, Germany
Get your web at Conactive Internet Services: http://www.conactive.com



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-09-2008, 07:43 PM
Kai Schaetzl
 
Default NameVirtualHost and CGI Problems

Mike -- EMAIL IGNORED wrote on Thu, 9 Oct 2008 19:28:39 +0000 (UTC):

> In other words, ServerName alone fails to distinguish two
> named virtual hosts.

Oh, it sure does. If it is present in both - which it isn't in your
config.



Kai

--
Kai Schätzl, Berlin, Germany
Get your web at Conactive Internet Services: http://www.conactive.com



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-09-2008, 07:48 PM
Mike -- EMAIL IGNORED
 
Default NameVirtualHost and CGI Problems

On Thu, 09 Oct 2008 21:31:19 +0200, Kai Schaetzl wrote:

> what's the purpose of that whole confusing configuration? If you want to
> use IP-based virtualhosts *any* of them needs a servername. And why do
> you enclose the Location statement in a virtualhost? Why don't you
> simply specify the real location? And I would use <Location "/"> to make
> it look less like XML.
>
>> Options -All SymLinksIfOwnerMatch ExecCGI
> you don't need to remove All
>
>>From my perspective you aim at a really hard to read and understand
> configuration. I wouldn't ever dare to mix the IP-based hosts like you
> try to do. Simplify your config and it will work.
>
> Kai

If I understand you correctly, you indicate that I
should remove the VirtualHost that does not contain
a ServerName, advice in the delivered httpd.config
file notwithstanding. In fact, that is how I now
have it, thereby eliminating the protection against
IP address access, which I would rather have.

In any case, as I indicate in another post, it still
fails to properly distinguish on the basis of
ServerName.

Mike.

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-09-2008, 08:14 PM
Mike -- EMAIL IGNORED
 
Default NameVirtualHost and CGI Problems

On Thu, 09 Oct 2008 21:43:24 +0200, Kai Schaetzl wrote:

> Mike -- EMAIL IGNORED wrote on Thu, 9 Oct 2008 19:28:39 +0000 (UTC):
>
>> In other words, ServerName alone fails to distinguish two named virtual
>> hosts.
>
> Oh, it sure does. If it is present in both - which it isn't in your
> config.
>
>
>
> Kai

Yes, a retest confirms your observation. I am therefore
left with the need to remove the VirtualHost that
has no ServerName. I can access the site with an
IP address, which, I think, this is meant to prevent.

Mike.

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 10:24 AM.

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