Search code examples
apachecentos6document-root

Setup a default PHP page in the DocumentRoot of CentOS 6.4 web server


I'm trying to set up my web site in a hosting server which is running CentOS 6.4. The domain has been already set up.

I have checked the DocumentRoot in the Apache config file. It is var/www/html. So, I added a new file "index.php" in that directory. The file is just echoing phpinfo().

<?php
echo phpinfo();
?>

But, when I browse mydomain.com, I just see the Web Server's Default Page with Parallels Panel. I think var/www/html/index.php should be running.

What I still need to configure?


Solution

  • I found my domain needs a hosting setup. When I set up a hosting for the domain, I got a document root /var/www/vhosts/mydomain.com/httpdocs and it FTP information. I think it is just like a virtual host setup. Eventually, /var/www/vhosts/mydomain.com/httpdocs/index.php is made running from mydomain.com.

    When I add a new sub-domain, I got /var/www/vhosts/mydomain.com/mysubdomain.com/ as a document root for that sub-domain.