Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

apache proxy module gives 403 forbidden error

I am trying to use the apache's proxy module for working with xmpp on ubuntu desktop. For this i did the following things -

1) enabled mod_proxy by creating a symlink of proxy.conf, proxy.load and proxy_http.load from /etc/apache2/mods-available/ in the mods-enabled directory.

2) Added the following lines to the vhost

    <Proxy http://mydomain.com/httpbind>
     Order allow,deny
     Allow from all
   </Proxy>

   ProxyPass /httpbind http://mydomain.com:7070/http-bind/
   ProxyPassReverse /httpbind http://mydomain.com:7070/http-bind/

I am new to using the proxy module but what i can make from the above lines is that requests to http://mydomain.com/httpbind will be forwarded to http://mydomain.com:7070/http-bind/. Kindly correct if wrong.

3) added rule Allow from .mydomain.com in /mods-available/proxy.conf

Now i try to access http://mydomain.com/httpbind and it shows 403 Forbidden error..

What am i missing here ? Please help. thanks

Edit : The problem got solved when i changed the following code in mods_available/proxy.conf

    <Proxy *>
            AddDefaultCharset off
            Order deny,allow
    Deny from all 
    Allow from mydomain.com                        
    </Proxy>

to

    <Proxy *>
            AddDefaultCharset off
            Order deny,allow
    #Deny from all 
    Allow from all                         
    </Proxy>

Didnt get what was wrong with the initial code though

like image 511
naiquevin Avatar asked Aug 19 '10 10:08

naiquevin


People also ask

Is 403 a proxy error?

A 403 error code, however, means your access to the site is forbidden. The request was understood, but the site did not want to grant admittance. In some cases, the site will provide an explanation, but in others the site may merely respond with a 403 error code itself with no reasoning whatsoever.

How do you fix 403 forbidden access to this resource on the server is denied?

A 403 Forbidden Error occurs when you do not have permission to access a web page or something else on a web server. It's usually a problem with the website itself. However, you can try refreshing the page, clearing your cache and cookies, and disconnecting from any VPN you might be using.

Why do I keep seeing 403 Forbidden?

The 403 Forbidden error appears when your server denies you permission to access a page on your site. This is mainly caused by a faulty security plugin, a corrupt . htaccess file, or incorrect file permissions on your server.


1 Answers

I know this is an old question, but I came accross it in a google search. Just a quick explaination of why the code didn't work initially.

In your proxy definition, you define "Order deny,allow". This means that deny statements will take precedence over allow statements. You had "Deny from all" in your config. As this takes precedence, it doesn't matter if you have "allow from all", it would still deny all.

like image 172
Alex Avatar answered Sep 24 '22 21:09

Alex