You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Patrick Atlas <p_...@club-internet.fr> on 2002/02/13 22:11:37 UTC

Virtual host, again and again

Hello,

Something wrong about my Vhost configuration.

I have installed a mailing-list server on my linux server (sympa).
This mailing-list server has its own web cgi-bin scripts to manage the lists
and users.
I want to use a virtual host to execute these scripts with the apache
server.
So, I have a domain with an IP and a subdomain on this same IP.
But, as the apache server is running under apache/apache user/group, the
mailing-list server script must run under a sympa/sympa user/group.

The Vhost.conf:

<NameVirtualHost *>

<VirtualHost *>
ServerName www.domain.com
DocumentRoot /home/www/html
</VirtualHost>

<VirtualHost *>
ServerName subdomain.domain.com
User sympa
Group sympa
DocumentRoot /home/www/cgi-bin/script.cgi  (can I point to a script or must
I only write the folder name, assuming that the default name would be the
mailing-list script in a dedicated folder?)
</VirtualHost>

The suexec configuration is ok for the apache server.

The commonhttpd.conf:

User apache
Group apache
etc...

So the mailing-list cgi-bin script is not working, either the script is
forbidden, or a the script cannot open a configuration file.

-- 
Patrick Atlas

au choix:
mailto:p_atlas@club-internet.fr
mailto:pat_atlas@yahoo.fr
en cas d'urgence: mailto:patrick.atlas@orange.fr
Allez sur mon site : http://www.muzikomondo.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
For additional commands, e-mail: users-help@httpd.apache.org


Re: Virtual host, again and again

Posted by Raquel Rice <ra...@thericehouse.net>.
On Wed, 13 Feb 2002 22:11:37 +0100
Patrick Atlas Patrick Atlas <p_...@club-internet.fr> wrote:

> Hello,
> 
> Something wrong about my Vhost configuration.
> 
> I have installed a mailing-list server on my linux server (sympa).
> This mailing-list server has its own web cgi-bin scripts to manage
> the lists
> and users.
> I want to use a virtual host to execute these scripts with the
> apache
> server.
> So, I have a domain with an IP and a subdomain on this same IP.
> But, as the apache server is running under apache/apache
> user/group, the
> mailing-list server script must run under a sympa/sympa
> user/group.
> 
> The Vhost.conf:
> 
> <NameVirtualHost *>
> 
> <VirtualHost *>
> ServerName www.domain.com
> DocumentRoot /home/www/html
> </VirtualHost>
> 
> <VirtualHost *>
> ServerName subdomain.domain.com
> User sympa
> Group sympa
> DocumentRoot /home/www/cgi-bin/script.cgi  (can I point to a
> script or must
> I only write the folder name, assuming that the default name would
> be the
> mailing-list script in a dedicated folder?)
> </VirtualHost>
> 

I don't think you can point to any file as your "root directory". 
Perhaps you could set your DirectoryIndex for that subdomain to your
cgi script name?  Or, rename your script to "index.cgi"?

-- 
Raquel
============================================================
Trouble is a part of your life, and if you don't share it, you don't
give the person who loves you enough chance to love you enough.
  --Dinah Shore

                              
                              

---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


Re: Virtual host, again and again

Posted by Owen Boyle <ob...@bourse.ch>.
Patrick Atlas wrote:
> 
> Of course. I don't need the second virtualhost. And there is a first host.
> 
> > If you want to define a cgi script as the default action in your
> > VirtualHost, use "DirectoryIndex".
> 
> The DirectoryIndex is set.
> 
> > In summary, something like this should do what you want:
> >
> > DocumentRoot /home/www/empty-dir
> > ScriptAlias /cgi-bin /home/www/cgi-bin
> > DirectoryIndex /cgi-bin/script.cgi
> >
> > Read the docs for these directives for more info...
> 
> The docs are read and read again...
> Here is the problem:
> 
> I need to run a host under a sympa/sympa user/group, as the main host is
> running under apache/apache user/group.
> 
> I need also a cgi-bin folder to run some scripts under the sympa/sympa
> user/group.
> 
> I create a single folder with the option ExecCGI.
> I set the user and group as "sympa" in the VirtualHost directives.
> 
> But when I launch the http://subdomain.domain.com/script.cgi I get a
> FORBIDDEN page... There is no .htaccess.
> Is there something wrong with the user and group attribution of the folder
> or the scripts?

Nothing to do with that - it's to do with how you expect apache to
resolve the paths to your files and scripts.

Are you using ScriptAlias or AddHandler to define CGIs? ScritpAlias
defines a whole dir as CGI, AddHandler defines a type of extension
site-wide. (NB Options ExecCGI just allows CGIs to run, it doesn't
*cause* them to run - subtle difference).

Anyway, I would recommend something like this:

<VH defn.>
  ServerName subdomain.domain.com
  AddHandler cgi-script cgi
  DocumentRoot /path/to/dir/containing_script.cgi

As always, look in the error_log to see what apache is actually trying
to do and why it fails. The server messages are intentionally vague for
security reasons.

Rgds,

Owen Boyle.

---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


Re: ErrorDocument Internal Link

Posted by Joshua Slive <jo...@slive.ca>.
On Thu, 14 Feb 2002, SSleeper wrote:

> Hi, I have a problem, I added
>
> ErrorDocument 404 /nf.cfm
>
> Should work, but it did not in IE, however it did work in NS (Netscape), I
> add a .htaccess file to the root, and added
>
> ErrorDocument 404 /nf.cfm.
>
> This too, does the same thing, works for NS, but not IE, IE gets the 404.
>
> Through testing, we found that files over 500K, would work with IE the first
> time, but not again till the file was physically replaced. So it appears
> that IE can be fouled, at least once, with a speculative 512k file size, but
> with it not working after the first time, it does not help alot.

I assume you mean 500 bytes rather than 500K.  In fact, MSIE ignores error
messages that are "too small".  This is a browser problem not a server
problem.  The fact that IE goes back to the old error message after the
first time is probably a caching issue.  If not, it is surely another
browser issue.

If you want to see what apache is actually sending (as opposed to what
MSIE is showing you), you can try

telnet yourhost 80
GET /path/to/noexistant/file HTTP/1.0
Host: yourhost[enter][enter]

>
> I feel the Apache server is out of wack, with this inconsistant behavour.
> IIS runs this config just fine, with any file size, MS talking to MS, but it
> can't seem to get around sniffing the 404 from Apache.

There is a certain HTTP header you can send to turn off the MSIE behavior
of ignoring error messages.  IIS probably sends this by default.  Apache
chooses not to adopt stupid IIS standards.

Joshua.


---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


ErrorDocument Internal Link

Posted by SSleeper <SS...@iProsperOnline.com>.
Hi, I have a problem, I added

ErrorDocument 404 /nf.cfm

Should work, but it did not in IE, however it did work in NS (Netscape), I
add a .htaccess file to the root, and added

ErrorDocument 404 /nf.cfm.

This too, does the same thing, works for NS, but not IE, IE gets the 404.

Through testing, we found that files over 500K, would work with IE the first
time, but not again till the file was physically replaced. So it appears
that IE can be fouled, at least once, with a speculative 512k file size, but
with it not working after the first time, it does not help alot.

I feel the Apache server is out of wack, with this inconsistant behavour.
IIS runs this config just fine, with any file size, MS talking to MS, but it
can't seem to get around sniffing the 404 from Apache.

I'm running 1.3 on Solaris. I don't think I can use the Redirect_ServerName
syntax, as the first time I put in the directives, the server crashed, I
think that it is for v2.0 Apache.

Any thoughts, this should be an open and close case, but after 50 hours of
banging my head against the wall, I am calling out for some help.

Thanks
Victor Nichols



---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


Re: Virtual host, again and again

Posted by Patrick Atlas <p_...@club-internet.fr>.
>> Hello,
>> 
>> Something wrong about my Vhost configuration.
> 
> You're telling me...

Of course, I always need to introduce the problem...
 
>> The Vhost.conf:
>> 
>> <NameVirtualHost *>
> 
> This is a Directive - it doesn't go in <>'s. It might work, but why try
> something that's not necessary and not documented?

You're right. Mistake as I wrote the text.

>> 
>> <VirtualHost *>
>> ServerName www.domain.com
>> DocumentRoot /home/www/html
>> </VirtualHost>
>> 
>> <VirtualHost *>
>> ServerName subdomain.domain.com
>> User sympa
>> Group sympa
>> DocumentRoot /home/www/cgi-bin/script.cgi  (can I point to a script or must
>> I only write the folder name, assuming that the default name would be the
>> mailing-list script in a dedicated folder?)
> 
> DocumentRoot takes a directory as argument. Also, it won't magically
> pick out a default file from the docroot, even if it's the only one
> there...
> 
> Don't you have any static content in this VH at all? If not, at least
> set DocumentRoot to an empty directory - I've never tried running a VH
> with no DocRoot and can't be bothered experimenting.

Of course. I don't need the second virtualhost. And there is a first host.

> If you want to define a cgi script as the default action in your
> VirtualHost, use "DirectoryIndex".

The DirectoryIndex is set.

> In summary, something like this should do what you want:
> 
> DocumentRoot /home/www/empty-dir
> ScriptAlias /cgi-bin /home/www/cgi-bin
> DirectoryIndex /cgi-bin/script.cgi
> 
> Read the docs for these directives for more info...

The docs are read and read again...
Here is the problem:

I need to run a host under a sympa/sympa user/group, as the main host is
running under apache/apache user/group.

I need also a cgi-bin folder to run some scripts under the sympa/sympa
user/group.

I create a single folder with the option ExecCGI.
I set the user and group as "sympa" in the VirtualHost directives.

But when I launch the http://subdomain.domain.com/script.cgi I get a
FORBIDDEN page... There is no .htaccess.
Is there something wrong with the user and group attribution of the folder
or the scripts?

> Rgds,
> 
> Owen Boyle.

Thanks


---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


Re: Virtual host, again and again

Posted by Owen Boyle <ob...@bourse.ch>.
Patrick Atlas wrote:
> 
> Hello,
> 
> Something wrong about my Vhost configuration.

You're telling me...

> The Vhost.conf:
> 
> <NameVirtualHost *>

This is a Directive - it doesn't go in <>'s. It might work, but why try
something that's not necessary and not documented?

> 
> <VirtualHost *>
> ServerName www.domain.com
> DocumentRoot /home/www/html
> </VirtualHost>
> 
> <VirtualHost *>
> ServerName subdomain.domain.com
> User sympa
> Group sympa
> DocumentRoot /home/www/cgi-bin/script.cgi  (can I point to a script or must
> I only write the folder name, assuming that the default name would be the
> mailing-list script in a dedicated folder?)

DocumentRoot takes a directory as argument. Also, it won't magically
pick out a default file from the docroot, even if it's the only one
there...

Don't you have any static content in this VH at all? If not, at least
set DocumentRoot to an empty directory - I've never tried running a VH
with no DocRoot and can't be bothered experimenting.

If you want to define a cgi script as the default action in your
VirtualHost, use "DirectoryIndex".

In summary, something like this should do what you want:

DocumentRoot	/home/www/empty-dir
ScriptAlias	/cgi-bin	/home/www/cgi-bin
DirectoryIndex	/cgi-bin/script.cgi

Read the docs for these directives for more info...

Rgds,

Owen Boyle.

---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org