Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've installed httpd, mysql and php on my CentOS 6.4 server. I've setup Virtual host 80 and 443 for trien.abc

My client (windows 7) still displays Apache2 test page. Where did I go wrong?

My Apache config file containing the VirtualHost definition is located in: /etc/httpd/vhosts/common/trien.conf:

<VirtualHost *:80>
  DocumentRoot /var/www/vhosts/testing.page
  ServerName trien.abc
  ServerAlias trien.abc
  ErrorLog /var/log/httpd/trien.error.log common
  LogFormat "%v %h %l %u %t \"%r\" %>s %b %f" common
  CustomLog /var/log/httpd/trien.access.log common
  AddDefaultCharset UTF-8

  <Directory "/var/www/vhosts/testing.page">
    AllowOverride All
    Allow from all
    Options -Indexes
  </Directory>
</VirtualHost>

The DocumentRoot /var/www/vhosts/testing.page just has one file: index.html. The contents of the file is "Welcome, trien".

It can't display the contents of the file, instead it displays the Apache2 test page.

Could you please help me?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

This could happen because of many reasons..Some of the possible reasons are the following

  • Check the selinux context of the index file. Try loading the page after setting selinux to permissive.

  • Check permissions of the index file. It should be readable to others

  • Have you restarted httpd after making changes?

    .

  • Check the DirecoryIndex in your httpd.conf. In your case, it must be

DirectoryIndex index.html

Please check your errorlog. paste it here if you cant troubleshoot.

share|improve this answer
    
"Check the selinux context of the index file. Try loading the page after setting selinux to permissive." -> i've disabled selinux. "Check permissions of the index file. It should be readable to others ."-> the permission of index.html is 0777. "Check the DirecoryIndex in your httpd.conf. In your case, it must be" -> maybe this cause from here. i've check in /var/log/httpd/ there's no .error.log common at all. Do you know why? –  Tấn Triển Nguyễn Oct 16 '13 at 9:03
    
Try accessing the absolute path of the page and keep posted here..like www.domainname.com/index.html –  Unnikrishnan Oct 16 '13 at 9:08
    
when i try this link: domainname.com/index.html => The requested URL /index.html was not found on this server. I don't know why... –  Tấn Triển Nguyễn Oct 16 '13 at 9:13
    
You said you have an index.html in the document root. Now you are saying about index.php. What is the file actually? –  Unnikrishnan Oct 16 '13 at 9:16
    
html.. so sorry about this. –  Tấn Triển Nguyễn Oct 16 '13 at 9:17

You haven't updated your index.html/index.php or more accurately where you go when you go to the root of your seite - the stock one Apache 2 is the 'test' page. Update your document root to the appropriate location and it should work.

Don't forget to enable the virtualhosts and restart apache.

share|improve this answer
    
i've restart apache and it still doesn't work. –  Tấn Triển Nguyễn Oct 16 '13 at 8:52

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.