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 asked a question which was related to this but not same,

I have a centos VPS, which has two wordpress websites, one is mbas.co.in and another is onlinemba123.com, now for virtual hosting using just ONE IP ADDRESS, first I started mbas.co.in, which is working fine, when I added onlinemba123.com then, it is loading default Centos page instead of my website, and I am just testing my onlinemba123 website, I haven't configured DNS for it, I am testing it through editing my PC's hosts file,

My website folder names are also same as in the conf file below

Now my question is how can I load my website instead of Default page, is my virtual host config fine?

My virtual host config:

NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /var/www/html/www.mbas.co.in
    ServerName mbas.co.in
    ErrorLog logs/mbas.co.in-error_log
    CustomLog logs/mbas.co.in-access_log common
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /var/www/html/www.onlinemba123.com
    ServerName www.onlinemba123.com
    ErrorLog logs/onlinemba123-error_log
    CustomLog logs/onlinemba123-access_log common
</VirtualHost>

My computers host file is:

xx.xxx.xxx.xxx  www.onlinemba123.com
share|improve this question

3 Answers 3

up vote 1 down vote accepted

Put an index file in the document root for the virtual host(s) in question.

share|improve this answer
    
index file? You mean the index file which is inside that wordpress(onlinemba123) folder? –  ntechi Feb 11 '11 at 5:29
    
One of the filenames given in the DirectoryIndex directive. –  Ignacio Vazquez-Abrams Feb 11 '11 at 5:31
    
@Ignacio Vazquez-Abrams I am still not getting which Index File, sorry for been a jerk but I am learning something new –  ntechi Feb 11 '11 at 5:47
    
Try putting a file called index.html or index.php in place. –  Ignacio Vazquez-Abrams Feb 11 '11 at 5:49
    
@Ignacio Vazquez-Abrams OK I inserted one inex.html file into folder www.onlinemba123.com and when I checked it, then I am getting that index.html instead of Centos Default page, So it means that my wordpress is having problems, am I rite? –  ntechi Feb 11 '11 at 5:59

Just add index.php or index.html(depend upon the priority order) the file in the document root for the virtual host mentioned in question. For PHP based website its should work.

share|improve this answer
1  
Thanks, but this does appear to be the same answer that was accepted 3 years ago. –  Felix Frank Jun 21 at 11:15

Or maybe your Apache is not rightly set up for working with php. Put a file named index.php and in there put <?php phpinfo(); ?>. If you see this line right this way then your apache needs to be configured to work with php, else if you see a phpinfo page - something like a page with a blue bar at the top - then your apache is ok to php, so there´s something wrong with your wordpress files. See the index.php file from it. Success for you.

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.