PDA

View Full Version : Can't Access localhost in apache (403 Error)


johntp
2007-01-02, 01:59 AM CST
Hey all,

when I point my browser to http://localhost/index.php I get a "403 Error, you dont' have permission to access index.php on this server" I tried chmodding 0777 /var/www/html but that didn't seem to work. Any suggestions?

Thanks too much!


-John

johno12345
2007-01-02, 02:00 AM CST
have you tried using your local ip address instead of localhost?

johntp
2007-01-02, 02:04 AM CST
http://127.0.0.1/index.php

Still same reply... Error 403 Permissions etc.

httpd.conf

DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl

Looks like that. Probably doesn't mean anything but just in case... ;)

johno12345
2007-01-02, 02:11 AM CST
try
chmod -R 755 /var/www/html

the -R (note the uppercase) is for recursive

johntp
2007-01-02, 02:16 AM CST
PERFECT!!!! Thanks!

The only problem now is that it's showing

"<?php
print "HI";
?>"

instead of "HI". It's not parsing it.

Any suggestions?

Can you explain what your little chmod thing did to me so I can learn and maybe know where to use it in the future.


Thanks so much,

-John

johno12345
2007-01-02, 02:30 AM CST
basically when you typed chmod 777 /var/www/html it applied read write execute permissions on the directory not the contents
the -R turns the command into being recursive so it also applies to the contents.

I know its a daft question but have you installed php?

rpm -qa |grep php

should tell you what php rpms are installed

johntp
2007-01-02, 02:41 AM CST
Hey man,


Yeah, I got it working now. The tutorial I follwed to set up my LAMP server had me comment some stuff out that made it not work. Not sure the purpose... but other than that it was a good tutorial. Anyway, anytime I add a new file into that directory I need to run the "chmod -R 0755 /var/www/html command"


Also, I have another question for you since you seem to knwo a ton about this. (at least a great deal more than me). I installed phpmyadmin (not a bit deal) but when I was configuring it one of the pages alerted me to the fact that I wasn't using a secure server (I knew this) but then I wondered. How would I configure apache if I wanted it to include https:// requests? I'm a web-developer of sorts and there will definately be a time I want to use this. Do you kinda know what I'm saying? Anyway, thanks for the help.


-John

johno12345
2007-01-02, 02:50 AM CST
everytime you add a file just run a chmod on that file for example


chmod 775 /var/www/html/index.php


as for https i'm probably not the best person to ask about this, but i'm sure if you have a gander through (or even create a new topic) someone will be able to help. I think its something to do with a directive in the /etc/httpd/conf/httpd.conf that you will need to set to make certain directories secure.