After upgrading Apache (using pkg) last Friday, I have since discovered my CGI scripts no longer run.
The error at my site's error log is:
The error at /var/log/httpd-error.log is:
/usr/local/etc/apache24/httpd.conf contains:
and in /etc/passwd:
So it looks as if mod_unixd isn't reading the correct UID.
Package details are:
I don't know what to try next. It was all working before!
Update: The error in the main server log resulted from this typo in httpd.conf:
I'm sure I didn't type that or it would never have worked! (And Apache was running as root from 4th May - 26th July 2015 as evidenced by ownership of created files. Is UID -1 meant by Apache to be nobody but parsed by FreeBSD as a negative user and treated as 0?)
The error in the site log was caused by the following in /usr/bin:
Unfortunately, perl is now at version 5.20.2! Changing these to point at /usr/local/bin/perl and /usr/local/bin/perl5 respectively seems more future-proof, even if it does mean following two links!
Ah well, at least I've found out why.
The error at my site's error log is:
Code:
[Wed Jul 22 14:14:05.401099 2015] [cgi:error] [pid 621] [client 10.0.2.100:42877] AH01215: (2)No such file or directory: exec of '/home/instabook/cgi-bin/evenas/test.cgi' failed: /home/instabook/cgi-bin/evenas/test.cgi
[Wed Jul 22 14:14:05.402415 2015] [cgi:error] [pid 621] [client 10.0.2.100:42877] End of script output before headers: test.cgi
The error at /var/log/httpd-error.log is:
Code:
[Wed Jul 22 13:21:25.432962 2015] [unixd:alert] [pid 621] (2)No such file or directory: AH02155: getpwuid: couldn't determine user name from uid -1, you probably need to modify the User directive
/usr/local/etc/apache24/httpd.conf contains:
Code:
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User www
Group www
and in /etc/passwd:
Code:
~]$ grep www /etc/passwd
www:*:80:80:World Wide Web Owner:/nonexistent:/usr/sbin/nologin
So it looks as if mod_unixd isn't reading the correct UID.
Package details are:
Code:
~]$ pkg info apache24
apache24-2.4.16
Name : apache24
Version : 2.4.16
Installed on : Fri Jul 17 13:41:35 BST 2015
Origin : www/apache24
Architecture : freebsd:9:x86:32
Prefix : /usr/local
Categories : www ipv6
Licenses :
Maintainer : apache@FreeBSD.org
WWW : http://httpd.apache.org/
Comment : Version 2.4.x of Apache web server
Options :
ACCESS_COMPAT : on
ACTIONS : on
ALIAS : on
ALLOWMETHODS : on
ASIS : on
AUTHNZ_FCGI : on
AUTHNZ_LDAP : off
AUTHN_ANON : on
AUTHN_CORE : on
AUTHN_DBD : on
AUTHN_DBM : on
AUTHN_FILE : on
AUTHN_SOCACHE : on
AUTHZ_CORE : on
AUTHZ_DBD : on
AUTHZ_DBM : on
AUTHZ_GROUPFILE: on
AUTHZ_HOST : on
AUTHZ_OWNER : on
AUTHZ_USER : on
AUTH_BASIC : on
AUTH_DIGEST : on
AUTH_FORM : on
AUTOINDEX : on
BUCKETEER : off
BUFFER : on
CACHE : on
CACHE_DISK : on
CACHE_SOCACHE : on
CASE_FILTER : off
CASE_FILTER_IN : off
CERN_META : on
CGI : on
CGID : on
CHARSET_LITE : on
DATA : on
DAV : on
DAV_FS : on
DAV_LOCK : on
DBD : on
DEFLATE : on
DIALUP : on
DIR : on
DUMPIO : on
ECHO : off
ENV : on
EXAMPLE_HOOKS : off
EXAMPLE_IPC : off
EXPIRES : on
EXT_FILTER : on
FILE_CACHE : on
FILTER : on
HEADERS : on
HEARTBEAT : on
HEARTMONITOR : on
IDENT : off
IMAGEMAP : on
INCLUDE : on
INFO : on
IPV4_MAPPED : off
LBMETHOD_BYBUSYNESS: on
LBMETHOD_BYREQUESTS: on
LBMETHOD_BYTRAFFIC: on
LBMETHOD_HEARTBEAT: on
LDAP : off
LOGIO : on
LOG_DEBUG : on
LOG_FORENSIC : on
LUA : off
LUAJIT : off
MACRO : on
MIME : on
MIME_MAGIC : on
MPM_EVENT : off
MPM_PREFORK : on
MPM_SHARED : on
MPM_WORKER : off
NEGOTIATION : on
OPTIONAL_FN_EXPORT: off
OPTIONAL_FN_IMPORT: off
OPTIONAL_HOOK_EXPORT: off
OPTIONAL_HOOK_IMPORT: off
PROXY : on
PROXY_AJP : on
PROXY_BALANCER : on
PROXY_CONNECT : on
PROXY_EXPRESS : on
PROXY_FCGI : on
PROXY_FDPASS : on
PROXY_FTP : on
PROXY_HTML : off
PROXY_HTTP : on
PROXY_SCGI : on
PROXY_WSTUNNEL : on
RATELIMIT : on
REFLECTOR : on
REMOTEIP : on
REQTIMEOUT : on
REQUEST : on
REWRITE : on
SED : on
SESSION : on
SESSION_COOKIE : on
SESSION_CRYPTO : on
SESSION_DBD : on
SETENVIF : on
SLOTMEM_PLAIN : on
SLOTMEM_SHM : on
SOCACHE_DBM : on
SOCACHE_DC : off
SOCACHE_MEMCACHE: on
SOCACHE_SHMCB : on
SPELING : on
SSL : on
STATUS : on
SUBSTITUTE : on
SUEXEC : off
UNIQUE_ID : on
USERDIR : on
USERTRACK : on
VERSION : on
VHOST_ALIAS : on
WATCHDOG : on
XML2ENC : off
Shared Libs required:
libpcre.so.1
libiconv.so.2
libgdbm.so.4
libexpat.so.1
libdb-5.3.so.0
libaprutil-1.so.0
libapr-1.so.0
Annotations :
cpe : cpe:2.3:a:apache:http_server:2.4.16:::::freebsd9:x86
repo_type : binary
repository : FreeBSD
Flat size : 22.6MiB
Description :
The Apache HTTP Server Project is an effort to develop and maintain an
open-source HTTP server for various modern desktop and server operating
systems, such as UNIX and Windows NT. The goal of this project is to
provide a secure, efficient and extensible server which provides HTTP
services in sync with the current HTTP standards.
The 2.x branch of Apache Web Server includes several improvements like
threading, use of APR, native IPv6 and SSL support, and many more.
WWW: http://httpd.apache.org/
I don't know what to try next. It was all working before!
Update: The error in the main server log resulted from this typo in httpd.conf:
Code:
<IfModule uinxd_module>
I'm sure I didn't type that or it would never have worked! (And Apache was running as root from 4th May - 26th July 2015 as evidenced by ownership of created files. Is UID -1 meant by Apache to be nobody but parsed by FreeBSD as a negative user and treated as 0?)
The error in the site log was caused by the following in /usr/bin:
Code:
lrwxr-xr-x 1 root wheel 25 Apr 28 15:34 perl -> /usr/local/bin/perl5.18.4
lrwxr-xr-x 1 root wheel 25 Apr 28 15:34 perl5 -> /usr/local/bin/perl5.18.4
Unfortunately, perl is now at version 5.20.2! Changing these to point at /usr/local/bin/perl and /usr/local/bin/perl5 respectively seems more future-proof, even if it does mean following two links!
Ah well, at least I've found out why.
Last edited: