We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now


Cannot remotely access index.html on development server

Medium Priority
Last Modified: 2012-05-04
Am in a new job position and trying to set up and move files to a development server allowing me to view comapany's website. When I put in its IP address in my local web browser I get the following error:
You don't have permission to access / on this server.
The developement server is running Linux redhat and using Apache web server. How can I modify the access permissions to allow me to remotely access its site through my browser?

Watch Question

you either need to change the configuration in httpd.conf, or check what is in .htaccess (if exists)

It might just be that you don't have an index.html in your DocumentRoot directory.
Bet that your site begins with an Index.htm or something like that.

If this is the case, either move Index.htm to index.html, or change the following in your httpd.conf :

DirectoryIndex index.html Index.htm default.htm index.php

(or whatever index file you're interested in).

Like they said above ... Or one of the following:

- the entire directory structure does not exist (e.g. /var/www/htdocs)
  -- check by looking in the apache config (e.g. /etc/apache/httpd.conf)
  -- find the Directory statement
  -- peruse your file system for that directory
- the entire directory structure is not readable/executable
  -- the output of "ls -alh" should be similar to: "dr-x r-x r-x   apache  apache  /var/www/htdocs"
  -- if not run (as owner of directory or root) chmod 555 /var/www/htdocs
- the index page does not exist
  -- like Alf mentioned look for the 'DirectoryIndex' directive in the apache config file
  -- perhaps it's dependent upon a module like php, and the directive doesn't include "index.php"
  -- peruse file system to see if it exists
- the index page is not readable
  -- ouput of "ls -alh" should also be similar to: "-r-x r-x r-x   apache  apache  index.html"
  -- if not run "chmod 555 index.html"
- the order is set to deny
  -- run "cat /etc/apache/httpd.conf | grep -n order" to find the directives
  -- a typical order should be like:
      Order allow,deny
      Allow from all
- the directory is set up with authentication
  -- look in the Directory statement in the config file for the "AllowOverride AuthConfig"
  -- Removing it temporarily fixes the problem, but gets rid of access control
  -- Look in the directory for a .htaccess file
  -- if it exists, open in a text editor, or rename it so apache won't use its access control

If you think it's an index page problem, then allowing this inside a directory statement will temporarily let you know: "Options Indexes" ... but it will leave your filesystem exposed to anyone who peruses the directory ... only a quick fix, don't use it permanently!

* Remember ... anytime you make changes to apache's config file, it must be restarted.  Run (as root or superuser) "apachectl restart" to bounce apache.

If those don't solve the problem, then post your apache config file ... and possibly the "ls -alh /var/www/htdocs" or of whichever location your config is set up for ...

Hope that helps ...



Thanks AHoffman, Alf666 and tcmv for all your replies. I removed an old test .htaccess file which allowed me to get to see the index page but unfortunately all I am seeing is the script content of the index page and not the viewable page if you know what i mean. When i type the ip address of the server into my browser this is all i see (below). AM very confused as really new to server side admin!!
Could any of you help??
external // var - variants are context specific. For example, "print" is a variant that indicates // that the page should be rendered in a printer friendly format. // require "root.inc"; require "/cgi$WEBROOT/cenv.inc"; require "/cgi$WEBROOT/error.inc"; $env = new cEnv; $level = isset($_GET['level']) ? $_GET['level'] : 1; // Trap any deviants trying to break our program if (!preg_match('/^\d$/', $level)) { $level = 1; } elseif ($level < 1 or $level > 5) { $level = 1; } switch ($level) { case 1: include "lvl1.html"; break; case 2: include "lvl2.html"; break; case 3: include "lvl4.html"; // Level 3 not longer valid, handled at level 4 break; case 4: include "lvl4.html"; break; case 5: include "lvl5.html"; break; } ?>

This looks like a php script.

Then move it to index.php, and, if you did what I suggested :

DirectoryIndex index.html Index.htm default.htm index.php

Then it should work (provided your Apache has php included).

Did that fix the problem?

What was that index page's filename?
as Alf666: your server does not parse the file


Hey , am only getting around to trying it now. The file index name is index.html and in the apache config file the

DirectoryIndex index.html index.html.var

So I have my index.html in var/www/html. So are you saying that i need to change the name of that index.html to index.php and then add that to the DirectoryIndex in the apache config file?? This is all very new to me so thanks for all your help guys!

Yes. At least if it's really PHP we're talking about.


Hi Alf666
Have added index.php to DirectoryIndex in httpd.conf file. Also changed name of index file to index.php in my document root. Now when i try to connect through the browser i get the following message

"Unable to find/connect to the database server."
So any suggestions as to what i can do?
Thanks alot
Unlock this solution and get a sample of our free trial.
(No credit card required)


Great will get to ask the admin guy tomorrow. Thanks a million for your help and speedy replies. Really appreciate it!
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.