7
votes

I'm not a complete beginner and sorry for posting an ambiguous question that has been posted in other slightly various forms so numerously. Anyway I get this error:

Forbidden
You don't have permission to access / on this server.
Apache/2.2.14 (Ubuntu) Server at gookie.localhost Port 80

I have apache2 proxying a tomcat6. here are the details:

  • the tomcat install is at /home/ae1/lib/java/apache-tomcat-6.0.29
  • ln -s /home/ae1/lib/java/apache-tomcat-6.0.29 /var/www/tomcat6
  • http.conf:

<Directory "/var/www/tomcat6/webapps/springapp">
    Options +Indexes FollowSymLinks +ExecCGI
    AllowOverride AuthConfig FileInfo
            Order allow,deny
    Allow from all
</Directory>
  • /etc/hosts has this entry: 127.0.0.1 localhost gookie.localhost
  • /etc/apache2/sites-available/gookie.localhost.conf

<VirtualHost *:80 >
  ServerName gookie.localhost
  DocumentRoot /var/www/tomcat6/webapps/springapp
  DirectoryIndex index.jsp index.html index.htm index.php

  ProxyPass / http://localhost:8080/springapp
  ProxyPassReverse / http://localhost:8080/springapp
</VirtualHost>

<Directory "/home/www/tomcat6/webapps/springapp">
        Options +Indexes FollowSymLinks +ExecCGI
        AllowOverride AuthConfig FileInfo
        Order allow,deny
        Allow from all
</Directory>
  • the /var/www/tomcat6/conf/server.xml file has:

<Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443"
           proxyName="gookie.localhost"
               />

I had proxyPort="80" in server.xml and still no luck.

Any thoughts on this?

2
And some more insight: localhost:8080 works okay, and localhost:8080/springapp redirects to gookie.localhost/springapp and gives the same 403 error. without this: ProxyPass / http://localhost:8080/springapp ProxyPassReverse / http://localhost:8080/springapp I get apache to show index.jsp without parsed <% %> tags at gookie.localhost, but as soon as I add the proxy directives it breaks. - Victor Pudeyev
Okay the solution was to change this file: /etc/apache2/mods-enabled/proxy.conf to display <IfModule mod_proxy.c> ProxyRequests Off <Proxy *> AddDefaultCharset off Order deny,allow Allow from all </Proxy> - Victor Pudeyev
Put it in an answer please, it's really confusing without any line breaks - Hubro

2 Answers

16
votes

The solution is to have this in /etc/apache2/mods-enabled/proxy.conf:

<IfModule mod_proxy.c>
    ProxyRequests Off
    <Proxy *>
        AddDefaultCharset off 
        Order deny,allow
        Allow from all 
    </Proxy>
</IfModule>
-6
votes

step1. You need to open file name “phpmyadmin.conf”. this is the phpmyadmin configuraiton file. where you need to replce the code.

<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
    Order Deny,Allow
Deny from all
Allow from 127.0.0.1

Replace code

<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
    Order Deny,Allow
Allow from all

Step2. Now you need to open another file file is you Apache “httpd.conf” file. This is also your Apache configuration file. You may find this file under “C:\wamp\bin\apache\Apache2.2.21\conf\” This path is again depend on the installation directory of you wamp server. Under this file you need to change the code. First search this code “# onlineoffline tag – don’t remove” You probable found this code in the mid of the file. And then remove “Allow from 127.0.0.1″ and replace “Deny from all” with Allow from all” And yes if possible create some unique password for your “phpmyadmin” so this will not accessible for outsider (ignore if you are using local machine).