?
Solved

Cannot remotely access index.html on development server

Posted on 2004-03-29
13
Medium Priority
?
320 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
Ransomware Attacks Keeping You Up at Night?

Will your organization be ransomware's next victim?  The good news is that these attacks are predicable and therefore preventable. Learn more about how you can  stop a ransomware attacks before encryption takes place with our Ransomware Prevention Kit!

 

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 500 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

770 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