Why my local website display Apache2 Test Page
Solution 1
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.
Solution 2
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.
Related videos on Youtube
Tấn Triển Nguyễn
Updated on September 18, 2022Comments
-
Tấn Triển Nguyễn over 1 year
I've installed
httpd
,mysql
andphp
on my CentOS 6.4 server. I've setup Virtual host 80 and 443 for trien.abcMy 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?
-
Tấn Triển Nguyễn over 10 yearsi've restart apache and it still doesn't work.
-
Tấn Triển Nguyễn over 10 years"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?
-
Unnikrishnan over 10 yearsTry accessing the absolute path of the page and keep posted here..like www.domainname.com/index.html
-
Tấn Triển Nguyễn over 10 yearswhen i try this link: domainname.com/index.html => The requested URL /index.html was not found on this server. I don't know why...
-
Unnikrishnan over 10 yearsYou said you have an index.html in the document root. Now you are saying about index.php. What is the file actually?
-
Tấn Triển Nguyễn over 10 yearshtml.. so sorry about this.
-
Unnikrishnan over 10 yearsIt means you have not placed the index file in the right location. Please check the Document Root path and the path by which you have your index file
-
Tấn Triển Nguyễn over 10 yearsi've just checked. Document Root path is like the path which index.html located.?