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

I am using nginx and apache server, only one apache server is running with usr/local/lib/apache (cpanel default apache server)

and when i call the document root folder like this it

$_SERVER['DOCUMENT_ROOT']

gives me the

/usr/local/apache/htdocs

while the correct location should have been the

/home/xxx/public_html/

any idea on how to fix this ? is this nginx problem or php settings problem or the apache configuration problem ?

share|improve this question
add comment

2 Answers

Can you explain why you are running two different servers on the same system? I assume connecting the Apache port is returning

/usr/local/apache/htdocts

Is Apache or Nginx supposed to return

/home/xxx/public_html?

share|improve this answer
    
only one apache server is running with usr/local/lib/apache (cpanel default apache server) –  user1179459 Sep 25 '12 at 5:52
    
So what about Nginx? –  mitnosirrag Sep 25 '12 at 6:01
    
my idea on was that nginx is a frontend proxy server.. anyhow i just need to know what will be PHP will be using in this type of a case... and how to modify that ... –  user1179459 Sep 25 '12 at 6:20
add comment

Apache is using whatever is defined as your DocumentRoot in /usr/local/apache/conf/httpd.conf

Usually /home/ user folder roots are the result of WHM virtual hosting accounts. Do you have access to WHM admin or just CPanel access? In a non-CPanel scenario, you would just redefine the DocumentRoot in httpd.conf or otherwise uncomment the vhosts include and define sites in /usr/local/apache/conf/extra/http-vhosts.conf, but with CPanel many apache conf files can be autogenerated so its best to define sites through CPanel

share|improve this answer
add comment

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.