You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Doug Baber <do...@yahoo.com> on 2000/12/12 05:37:54 UTC
config/6959: User directive must come before VirtualHost directive when specifying a named virtual host
>Number: 6959
>Category: config
>Synopsis: User directive must come before VirtualHost directive when specifying a named virtual host
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: apache
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: doc-bug
>Submitter-Id: apache
>Arrival-Date: Mon Dec 11 20:40:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: douglas_va@yahoo.com
>Release: Apache/1.3.9 (NetRevolution Advanced Extranet Server/Linux-Mandrake)
>Organization:
apache
>Environment:
Linux angi 2.2.14-15mdk #1 Tue Jan 4 22:24:20 CET 2000 i586 unknown
This is perl, version 5.005_03 built for i386-linux
>Description:
When configuring a named virtual host, the User directive must be specified before the VirtualHost directive, or a User directive must be included within the VirtualHost directive. I was configuring a virtual named virtual host. The host served web pages fine, but had a problem when executing a perl cgi script. The error messages below is what was generated in the ScriptLog.
%stderr
[Mon Dec 11 21:47:12 2000] [error] [client 192.168.1.2] (2)No such file or directory: getpwuid: invalid userid -1
[Mon Dec 11 21:47:12 2000] [error] (2)No such file or directory: exec of /home/httpd/jec/dev/cgi-bin/test.pl failed
The getpwuid error seemed to indicate that it couldn't find the user name in the /etc/passwd file. I'm assuming it was trying to use a null user name to run the CGI program. Once I moved the User directive above the VirtualHost directive, it knew which user to run the CGI script as, and it worked fine. It also worked when I left the User directive after the VirtualHost directive, but put a User entry within the VirtualHost section.
>How-To-Repeat:
Set up an httpd.conf file with the above scenario and run the test.pl script that comes with Apache.
>Fix:
Add information to the documentation about this issue.
>Release-Note:
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, you need]
[to include <ap...@Apache.Org> in the Cc line and make sure the]
[subject line starts with the report component and number, with ]
[or without any 'Re:' prefixes (such as "general/1098:" or ]
["Re: general/1098:"). If the subject doesn't match this ]
[pattern, your message will be misfiled and ignored. The ]
["apbugs" address is not added to the Cc line of messages from ]
[the database automatically because of the potential for mail ]
[loops. If you do not include this Cc, your reply may be ig- ]
[nored unless you are responding to an explicit request from a ]
[developer. Reply only with text; DO NOT SEND ATTACHMENTS! ]