Forum

Mac OS X 10.7.3 UID issues

Siggi Gross
30 March 2012, 16:42


Hiawatha version: 8.1
Operating System: Mac OS X 10.7.3

i have some issues with hiawatha on mac osx .
the launchdaemon plist (/Library/LaunchDaemons/org.hiawatha-webserver.httpd.plist) sets the username to root

when i do:
sudo lsof -d cwd
it responds with:
lsof: no pwd entry for UID 65534
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
hiawatha 105 65534 cwd DIR 14,2 238 1060848 /usr/local/etc/hiawatha


static files are served, but cgi fails.

cgi permissions are OK, and the .cgi executes from command line.

stopping and restarting fromm settings menu has no effect.

if i kill hiawatha with
sudo kill 105
and restart with
sudo /usr/ ... hiawatha
it works fine.

tried to set the launchd plist to
UserName _www
with no effect.

LaunchDaemon plist file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>KeepAlive</key>
<false/>
<key>Label</key>
<string>org.hiawatha-webserver.httpd</string>
<key>Program</key>
<string>/usr/local/sbin/hiawatha</string>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>root</string>
<key>WorkingDirectory</key>
<string>/</string>
</dict>
</plist>


conf file:
# Hiawatha main configuration file
#
ConnectionsTotal = 150
ConnectionsPerIP = 10
SystemLogfile = /usr/local/var/log/hiawatha/system.log
GarbageLogfile = /usr/local/var/log/hiawatha/garbage.log


Binding {
Port = 9999
# Interface = 127.0.0.1
MaxKeepAlive = 30
TimeForRequest = 3,20
}

ExecuteCGI = yes
TimeForCGI = 5000
CGIextension = cgi

Hostname = 127.0.0.1
WebsiteRoot = /Library/Beap/wwwroot
StartFile = index.html
AccessLogfile = /usr/local/var/log/hiawatha/access.log
ErrorLogfile = /usr/local/var/log/hiawatha/error.log
Hugo Leisink
1 April 2012, 07:16
Change the user id via the ServerId setting in hiawatha.conf:
ServerId = _www


For each (virtual) host, you have to enable CGI execution. Add the following line to the end of hiawatha.conf:
ExecuteCGI = yes
Siggi Gross
1 April 2012, 15:03
thank you,
works fine now :-)

moved
ExecuteCGI = yes
to the bottom of the file.

is it important to be after the Host section to allow cgi execution globally?

from the doc i saw the ExecuteCGI inside the VirtualHost-block to enable it per VHost.
as i have only one main Host, i placed it with the other cgi settings.

best regards, siggi gross
Hugo Leisink
1 April 2012, 15:21
The ExecuteCGI is a setting per (virtual) host. It can be placed anywhere in the configuration file, but to make it more organized, it's better to place it near the other host-specific settings. Those are at the bottom of your configuration file, so it's best to place ExecuteCGI there also.
This topic has been closed.