Solved

403 - Forbidden

Posted on 2006-06-09
8
428 Views
Last Modified: 2010-03-04
aaaarrrrrrgh....
I am getting a 403 error for some unknown reason. i have tried everythng that i could think of. I gave read permissions to ALL users and allowed access from anywhere using .htaccess. don't know what to do now. :-(

I can access the last site setup in httpd.conf (testing.domain.com). it gives sql errors for known reasons but i dont see why i cannot see other sites.

========================
% cd $WEBROOT
% ls -ld
drwxrwxr-x  16 allstateforms  allstateforms  512 Apr  5 13:52 .

========================
% ls -l
total 60
...
-rw-rw-r--   1 allstateforms  allstateforms  8571 Mar 22 12:00 index.php
...

========================
% cat .htaccess
Order Deny,Allow

Allow from 00.000.00.0
Allow from 11.111.11.11

Deny from all

RewriteEngine On

RewriteRule ^([^/]+)\.html?(.*)$ index.php?_html_url=$1$2 [L,QSA]

RewriteRule .+\.pdf(.*)$ index.php?page=convert_to_pdf&cmd=download$1 [L,QSA]

========================

/****** relevant part from http.conf ******/

NameVirtualHost 00.000.00.00:80

<VirtualHost 00.000.00.00:80>
        ServerName www.domain.com
        ServerAlias nuppinc.com www.domain.com
        DocumentRoot /home/allstateforms/web
        ErrorLog /home/allstateforms/logs/error_log
        CustomLog /home/allstateforms/logs/access_log common
        Options +Indexes
        Redirect permanent /bugzilla https://dev.domain.com/bugzilla
</VirtualHost>

NameVirtualHost 00.000.00.00:80

<VirtualHost 00.000.00.00:80>
        ServerName dev.domain.com
        DocumentRoot /home/allstateforms/testweb/dev
        ErrorLog /home/allstateforms/logs/dev_error_log
        CustomLog /home/allstateforms/logs/dev_access_log common
        Options +Indexes
        Redirect permanent /bugzilla https://dev.domain.com/bugzilla/
        Alias /phpMyAdmin/ "/home/allstateforms/tools/phpMyAdmin/"
</VirtualHost>

<Directory /home/allstateforms/tools/bugzilla>
        AddHandler cgi-script .cgi
        Options +Indexes +ExecCGI +FollowSymLinks
        DirectoryIndex index.cgi
        AllowOverride Limit
</Directory>

NameVirtualHost 00.000.00.00:8080
<VirtualHost 00.000.00.00:8080>
        DocumentRoot /home/testers/web
        ServerName testing.domain.com
        ErrorLog /home/testers/web/err.log
        TransferLog /home/testers/web/access.log
        Alias /phpMyAdmin/ "/home/testers/db/phpMyAdmin/"
</VirtualHost>
0
Comment
Question by:jhshukla
  • 4
  • 2
8 Comments
 
LVL 15

Expert Comment

by:periwinkle
ID: 16873527
Try moving Deny from all to above your allow commands...
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 16873586
Wait, I think you have the wrong order statement:

Deny,Allow
    The Deny directives are evaluated before the Allow directives. Access is allowed by default. Any client which does not match a Deny directive or does match an Allow directive will be allowed access to the server.
Allow,Deny
    The Allow directives are evaluated before the Deny directives. Access is denied by default. Any client which does not match an Allow directive or does match a Deny directive will be denied access to the server.

see:

http://httpd.apache.org/docs/2.0/mod/mod_access.html

for examples.

I think you want:

Order Allow,Deny
Allow from 00.000.00.00/29
Allow from 11.111.11.11
Deny from all

... It's the first one matched that will be returned;  in this case, the allows take precedence over the denies.
0
 
LVL 9

Author Comment

by:jhshukla
ID: 16874052
oh i forgot to mention... i haven't modified the .htaccess file.
it was working before i started working here, i added the last virtual host in the httpd.conf and the problems began. btw, deny by default is intentional. the site is still pre-alpha and we want to test it before we make it public. and obviously, we don't want competitors to look at it until the it is launched.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 15

Expert Comment

by:periwinkle
ID: 16880555
This section:

<Directory /home/allstateforms/tools/bugzilla>
        AddHandler cgi-script .cgi
        Options +Indexes +ExecCGI +FollowSymLinks
        DirectoryIndex index.cgi
        AllowOverride Limit
</Directory>

is outside of a VirtualHost container -- why?
0
 
LVL 9

Author Comment

by:jhshukla
ID: 16886292
beat me to death ... plz. server was looking at the wrong .htaccess file.

DocumentRoot /home/allstateforms/testweb/dev
should have been
DocumentRoot /home/allstateforms/dev

thx.
0
 
LVL 15

Expert Comment

by:periwinkle
ID: 16890104
Works for me!
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 16932404
Closed, 125 points refunded.
Netminder
Site Admin
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

810 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