403 Error

nike_guy_man's picture

They have: 840 posts

Joined: Sep 2000

OK...
I obviously did someting wrong with Mandrake, so I went back with RedHat 7.1
I had backed up my important conf files, but I didn't use them right away once I loaded RH back up.
Every time I try to access my site, I get a 403 error.
I have permissions set correctly (644) and the user/group are set correctly (apache)
I've even tried using the old httpd.conf but that's not working either.
I have no idea what else could be wrong.
Please help!

Laughing out loud

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

Is there an index file to be accessed? If there is not an index.html file and you don't have directory browsing permissions, then you can get this error. If the index file is index.php, make sure that index.php is enabled in your httpd.conf file.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

nike_guy_man's picture

They have: 840 posts

Joined: Sep 2000

yes it is index.html

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

Can you access it by another way? I.e, instead of http://sitename.com/ , http://sitename.com/index.html .
Also is index.html listed in httpd.conf or is it listed as index.htm or something else under DirectoryIndex

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

nike_guy_man's picture

They have: 840 posts

Joined: Sep 2000

yes index.html is listed
No i cannot access it anywhere under any name.

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Is DocumentRoot correct?

nike_guy_man's picture

They have: 840 posts

Joined: Sep 2000

Yep... documentroot correct, everywhere it should be.

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

Okay, let's start at the beginning.

Are you using VirtualHosts settings in Apache?

What are your browser settings? I.e. what are you typing in your browser address bar? Does this match either your virtualhosts or WebRoot?

What is your user and group in httpd.conf?

If you changed anything in httpd.conf, like user and group, did you stop and restart apache?

What is the user and group for the directory that you are trying to access?

As an FYI, a 403 error means that your server is running and understood your request but refuses to honor it, usually a permission thing.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

nike_guy_man's picture

They have: 840 posts

Joined: Sep 2000

Already checked all that:
Yes to virtualhosts.
From the command line, i type lynx localhost or from the windows, I go to the IP of my linux box, i've tried the domain I have my IP to forward to, everything. What is WebRoot? Thats not in httpd.conf
User and group are apache
Yes I stopped/restarted apache
User and group of directory and files are apache
Knew that about 403 error.
I had this problem on the old linux box, and all I had to do was do chown apache:apache * for all my webserver files and chmod 644 * to all the same.
I'll keep trying whatever I can...
How do I restart httpd?
I usuall do killall httpd
httpd start

What else?
I've tried apachectl but it says command not found... is that a Mandrake command?
I'm using RedHat 7.1.
Thanks for your help so far.

Laughing out loud

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

Quote: Originally posted by nike_guy_man
Already checked all that:
Yes to virtualhosts.
From the command line, i type [b]lynx localhost
or from the windows, I go to the IP of my linux box, i've tried the domain I have my IP to forward to, everything. What is WebRoot? Thats not in httpd.conf
[/B]

Forget about WebRoot. Is anything mapped in /etc/hosts? If you had something like this:
httpd.conf

DocumentRoot /home/nikeman/www/
DirectoryIndex index.html index.php index.cgi

/etc/hosts (Linux and Windows Machine)
IP Address xxx.nikeman.com

I would access the server via typing http://xxx.nikeman.com in the browser. If I tried to go to access it by typing the IP address in the browser, it would probably try and resolve to whatever DocumentRoot was set to in httpd.conf. This could also cause this error. Check your error logs. Usually they are /apachedirectory/logs/error_log to see if this is the case.

Quote: Originally posted by nike_guy_man

How do I restart httpd?
I usuall do [b]killall httpd
httpd start

[/B]

You can do it that way. Or just kill the root process and all the others will die. I usually start apache via httpd -d /usr/local/apache

Quote: Originally posted by nike_guy_man

I've tried [b]apachectl
but it says command not found... is that a Mandrake command?
I'm using RedHat 7.1.
[/B]

Here is the man page telling all about apachect1.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

nike_guy_man's picture

They have: 840 posts

Joined: Sep 2000

Well...
I reformatted my Hard disk to re-install windows and Linux again.
After getting Windows and RH 7.1 reinstalled, I could access my home directory and files in it, but nothing else.
For example, I can get http://localhost/index.html and all other files in the localhost directory, but http://localhost/cgi-bin/test.cgi will not access.
Neither will http://localhost/backup/index.html
Do I have to do anything with them in httpd.conf?

Laughing out loud

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

You don't always have to re-install Windows/Linux. Just have a little patience.

It still looks like a permission thing.

What does your error log say?

Go ahead and do this:
chown -R *apacheuser /home/*DocumentRoot
*Replace apacheuser with the user that is in httpd.conf.
*Replace DocumentRoot with the directory that is listed for DocumentRoot in Apache.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

nike_guy_man's picture

They have: 840 posts

Joined: Sep 2000

I did have to reinstall it because I had incorrectly partitioned the drives and I was changing my settings...
I've been very patient with this.
Error log has nothing other than shutdown and start messages.
I did chown and chmod everything.
So confusing... thanks for trying so far...

Laughing out loud

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

Why don't you either post or email me these:

  • Virtualhosts section of httpd.conf and user, group.
  • The contents of your directory that you are trying to access along with permissions.
  • Your /etc/hosts file
  • What you type in the browser to access this site.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

nike_guy_man's picture

They have: 840 posts

Joined: Sep 2000

virtualhosts:

# General setup for the virtual host
DocumentRoot "/home/parrabal/"

# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine off

# SSL Cipher Suite:
# List the ciphers that the client is permitted to negotiate.
# See the mod_ssl documentation for a complete list.
#SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

User apache
Group apache
Contents of /home/parrabal:
index.html help.html links.html and the directory cgi-bin
Permissions are all 644
/etc/hosts:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.1.1 other.computer other
192.168.1.21 otherc.computer otherc

What I type from the command line:
lynx localhost

k?

Laughing out loud

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

Try this:

Change to or whatever else you want to call your site. The default port 80 is fine.

Change /etc/hosts to have a line like this
192.168.1.1 xxx.parrabel.com (if this is your IP of the machine).

Kill the apache daemon kill root process IDand restart httpd -d .../apache directory.

To get to the site type in:
for Linux - lynx xxx.parrabel.com
for Windows - edit the hosts file so that it has the same 192.168.1.1 xxx.parrabel.com . Connect in Windows browser by typing in http://xxx.parrabel.com

I use the xxx - prefix so that I can tell if I am on local or the Internet. Usually I build my site and gzip & tar it and upload to my host and inflate.

It could be the localhost that is screwing things up a bit.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.