Mailing List Archive

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 [ In reply to ]
On Wed, 13 Feb 2002 22:11:37 +0100
Patrick Atlas Patrick Atlas <p_atlas@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 [ In reply to ]
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
Re: Virtual host, again and again [ In reply to ]
>> 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 [ In reply to ]
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