Solved

Cannot remotely access index.html on development server

Posted on 2004-03-29
13
302 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
  • 4
  • 4
  • 3
  • +1
13 Comments
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:sineadhartley
Comment Utility
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
Comment Utility
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
Comment Utility
Did that fix the problem?
-tcmv
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 2

Expert Comment

by:tcmv
Comment Utility
What was that index page's filename?
0
 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
as Alf666: your server does not parse the file
0
 

Author Comment

by:sineadhartley
Comment Utility
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
Comment Utility
Yes. At least if it's really PHP we're talking about.
0
 

Author Comment

by:sineadhartley
Comment Utility
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
Comment Utility
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
Comment Utility
Great will get to ask the admin guy tomorrow. Thanks a million for your help and speedy replies. Really appreciate it!
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Hello EE, Today we will learn how to send all your network traffic through Tor which is useful to get around censorship and being tracked all together to a certain degree. This article assumes you will be using Linux, have a minimal knowledge of …
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now