Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have DirectAdmin installed on my dedicated host.

What I'm trying to achieve is set up a subdomain on domain "", which belongs to user "C", so that its document root is a directory in another user's (P) directory tree

|*if SUB="mysubdomain"|

This works as long as I try to view flat HTML files, i.e.
// Hello World!

Whenever I try to view a PHP file, I get a 500 error, i.e.
// Internal Server Error

The index.php is simple and should not throw any errors, right?


I can't view the log files for reasons that would take too much space to describe. Also I'm not that familiar with DirectAdmin, but I have managed to set up other subdomains in that have DocumentRoot within user C's directory tree and that run PHP exactly as I would expect them to.

Main question:

Am I right that the problem is pointing the DocumentRoot to some other user's directory tree?

Secondary question:

Are there any simple configuration tweaks available to make this work as intended?


locked by HopelessN00b Apr 3 '15 at 17:37

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

closed as off-topic by HopelessN00b Apr 3 '15 at 17:37

  • This question does not appear to be about server, networking, or related infrastructure administration within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 1 down vote accepted

I guess you're running PHP with suPHP instead of mod_php. That means that PHP scripts are executed under the user which owns the domain (in this case, user C). But if the PHP files are owned by a different user (in this case, user P), suPHP will throw an error (which should be logged on your subdomain's error log) and return a 500 HTTP error.

What you would need to do is change the configuration of the SuexecUserGroup variable in the virtual host of that subdomain. For that you can try the following (in Custom HTTPD configuration of Directadmin):

|*if SUB="mysubdomain"|

That should work if your virtual host template has a line like this:

SuexecUserGroup |USER| |GROUP|

I have never tried this, but in theory it should work. Also note that PHP files should have its permissions set to 0644 and the folders which contain PHP script should be set to 0755 (or 0711). If you have broader permissions suPHP will throw another error and return a 500 HTTP status.

I've switched jobs since the question was posted, so can't verify the solution works, but will mark this as accepted answer in the hope that if it's incorrect, someone will let me know. Thanks! – bububaba Dec 21 '12 at 21:52

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