Cannot remotely access index.html on development server

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?

sineadhartleyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ahoffmannCommented:
you either need to change the configuration in httpd.conf, or check what is in .htaccess (if exists)
0
Alf666Commented:
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
tcmvCommented:
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
What were the top attacks of Q1 2018?

The Threat Lab team analyzes data from WatchGuard’s Firebox Feed, internal and partner threat intelligence, and a research honeynet, to provide insightful analysis about the top threats on the Internet. Check out our Q1 2018 report for smart, practical security advice today!

sineadhartleyAuthor Commented:
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
Alf666Commented:
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
tcmvCommented:
Did that fix the problem?
-tcmv
0
tcmvCommented:
What was that index page's filename?
0
ahoffmannCommented:
as Alf666: your server does not parse the file
0
sineadhartleyAuthor Commented:
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
Alf666Commented:
Yes. At least if it's really PHP we're talking about.
0
sineadhartleyAuthor Commented:
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
Alf666Commented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sineadhartleyAuthor Commented:
Great will get to ask the admin guy tomorrow. Thanks a million for your help and speedy replies. Really appreciate it!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Security

From novice to tech pro — start learning today.