Solved

Cannot remotely access index.html on development server

Posted on 2004-03-29
13
318 Views
Last Modified: 2012-05-04
Hi,
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:
**********************************************
Forbidden:
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?

0
Comment
Question by:sineadhartley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 3
  • +1
13 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 10704521
you either need to change the configuration in httpd.conf, or check what is in .htaccess (if exists)
0
 
LVL 9

Expert Comment

by:Alf666
ID: 10707936
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).
0
 
LVL 2

Expert Comment

by:tcmv
ID: 10709427
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 ...

-tcmv
www.mvix.net
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 

Author Comment

by:sineadhartley
ID: 10724999
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; } ?>
************************************************************************
0
 
LVL 9

Expert Comment

by:Alf666
ID: 10725128
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).
0
 
LVL 2

Expert Comment

by:tcmv
ID: 10725173
Did that fix the problem?
-tcmv
0
 
LVL 2

Expert Comment

by:tcmv
ID: 10725175
What was that index page's filename?
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 10726273
as Alf666: your server does not parse the file
0
 

Author Comment

by:sineadhartley
ID: 10739153
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!
0
 
LVL 9

Expert Comment

by:Alf666
ID: 10739841
Yes. At least if it's really PHP we're talking about.
0
 

Author Comment

by:sineadhartley
ID: 10741570
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
0
 
LVL 9

Accepted Solution

by:
Alf666 earned 125 total points
ID: 10741812
This means it now works and you have to check why your PHP can not connect to your DB backend.

But it's a bit beyond this question.
You should check with your local DB Admin and/or PHP developpers.
0
 

Author Comment

by:sineadhartley
ID: 10741936
Great will get to ask the admin guy tomorrow. Thanks a million for your help and speedy replies. Really appreciate it!
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

​Being a Managed Services Provider (MSP) has presented you  with challenges in the past— and by meeting those challenges you’ve reaped the rewards of success.  In 2014, challenges and rewards remain; but as the Internet and business environment evol…
BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (https://kb.isc.org/article/AA-01272), affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question