LookupException in API_Linux.cpp:98: Could not lookup username “wwwrun”

In order to get suPHP to run you’ll need to edit the config file, which is by default stored in /etc/suphp/suphp.conf

If you’re getting the error

LookupException in API_Linux.cpp:98: Could not lookup username "wwwrun"

it means specifically that you probably have not uncommented the line webserver_user in that config file. If you’re on an Ubuntu server you will probably set that line to www-data but on other systems it perhaps needs to be set to apache or nobody.

You can view your list of users by using the command cat /etc/passwd, which will give you several lines in this format:

www-data:x:33:33:www-data:/var/www:/bin/sh

If you’re on Ubuntu you should see the line above, which shows the entry for the user www-data which has a user id and group id of 33 (the first two numbers).

If you see that then you should probably change your suphp.conf file to have the webserver_user set to www-data and also you should change the Minimum UID and Minimum GID to the matching numbers, probably 33 and 33

webserver_user=www-data

; Minimum UID
min_uid=33

; Minimum GID
min_gid=33

A decent guide for setting up suPHP on Ubuntu 11 can be found at http://websoftserbia.com/en/ubuntu/66-install-suphp-on-ubuntu-11-04.html

I would recommend walking through that guide first, so you know what you’re doing, but I’ll also give you an example of a configured suphp.conf file:

[global]
;Path to logfile
logfile=/var/log/suphp.log

;Loglevel
loglevel=info

;User Apache is running as
webserver_user=www-data

;Path all scripts have to be in
;docroot=/var/www:${HOME}/public_html

;Security options
allow_file_group_writeable=true
allow_file_others_writeable=false
allow_directory_group_writeable=true
allow_directory_others_writeable=false

;Check wheter script is within DOCUMENT_ROOT
; !! only change this to FALSE if your site files are outside of the standard directories 
; !! specified above in the docroot declaration. or change it for debugging but
; !! dont forget to change it back! :)
check_vhost_docroot=false

;Send minor error messages to browser
errors_to_browser=false

;PATH environment variable
env_path=/bin:/usr/bin

;Umask to set, specify in octal notation
umask=0077

; Minimum UID
min_uid=33

; Minimum GID
min_gid=33

[handlers]
;Handler for php-scripts
x-httpd-php=php:/usr/bin/php5-cgi

;Handler for CGI-scripts
x-suphp-cgi=execute:!self

;Path to chroot() to before executing script
;chroot=/mychroot

Related Posts:

This entry was posted in Linux, Server Admin, Server Administration, Web Development and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *