Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have just installed su_php on my server (amazon ec2 instance), It is required for 1 of my applications.

Now, I am getting a 500 Internal server error when visiting all of my hosted sites.

The error logs:

[error] [client ip] SoftException in Application.cpp:350: UID of script "/var/www/html/www.mywebsite.org.uk/index.php" is smaller than min_uid
[error] [client ip] Premature end of script headers: index.php

ls -l of the webroot show:

drwxrwxr-x  2 root     root 4096 Aug  7 14:23 aws.anothersite.co.uk
drwxrwxr-x  7 ec2-user root 4096 Oct  5 18:36 content.mywebsite.org.uk
drwxrwxr-x  5 root     root 4096 Sep 14 20:19 anothersite.co.uk
drwxrwxr-x  2 root     root 4096 Oct  5 18:51 logs
drwxrwxr-x  7 ec2-user root 4096 Oct  5 18:37 new.mywebsite.org.uk
drwxr-xr-x  9 root     root 4096 Aug  7 14:10 phpmyadmin
drwxrwxr-x  4 root     root 4096 Sep 10 20:39 wttw.anothersite.co.uk
drwxrwxr-x 27 ec2-user root 4096 Oct  5 18:26 www.mywebsite.org.uk

The three domains I want under su_php control (if possible) are:

drwxrwxr-x 27 ec2-user root 4096 Oct  5 18:26 www.mywebsite.org.uk
drwxrwxr-x  7 ec2-user root 4096 Oct  5 18:36 content.mywebsite.org.uk
drwxrwxr-x  7 ec2-user root 4096 Oct  5 18:37 new.mywebsite.org.uk

All of these sites are down and throwing a 500 Internal Server Error.

All anothersite.co.uk domains and subdomains, I want under normal mod_php control.

ls -l of the inside the directory www.mywebsite.org.uk

I removed most files, they all have the same perms as the below

-rw-rw-r--  1 ec2-user root     0 Oct  5 18:26 googleee78b20b75ffd653.html
drwxrwxr-x 23 ec2-user root 20480 Oct  5 18:26 images
drwxrwxr-x  2 ec2-user root  4096 Oct  5 18:26 includes
-r-x--x--x  1 ec2-user root  1956 Oct  5 18:59 index.php

My virtual hosts file is below: (as said above, I want only mywebsite.org.uk (& subdomains) under su_php:

<VirtualHost *:80>
    DocumentRoot "/var/www/html/www.mywebsite.org.uk/"
    ServerName www.mywebsite.org.uk
    ServerAlias mywebsite.org.uk
    ErrorLog "/var/www/html/logs/mywebsite.org.uk-error_log"
    CustomLog "/var/www/html/logs/mywebsite.org.uk-access_log" common
    suPHP_Engine on
    suPHP_UserGroup ec2-user ec2-user
    AddHandler x-httpd-php .php .php3 .php4 .php5
    suPHP_AddHandler x-httpd-php
</VirtualHost>

Any help would be much appreciated!

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I don't have a system to hand to check this on but I seem to recall that the whole tree from the docroot down has to be owned by UIDs > min_uid so if you configured

docroot=/var/www

then directories from (and including /var/www/...) need to be configured correctly.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.