错误403 Forbidden - 对apache2,tomcat6,mod_proxy的权限

Vic*_*box 7 apache proxy tomcat

不是一个完全的初学者,并且抱歉发布了一个模糊的问题,这个问题已经以其他各种各样的形式发布了.无论如何,我得到这个错误:

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

我有apache2代理tomcat6.这是详细信息:

  • tomcat安装位于/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>
Run Code Online (Sandbox Code Playgroud)
  • / etc/hosts有这个条目: 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>
Run Code Online (Sandbox Code Playgroud)
  • /var/www/tomcat6/conf/server.xml文件具有:

<Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443"
           proxyName="gookie.localhost"
               />
Run Code Online (Sandbox Code Playgroud)

proxyPort="80"server.xml和仍然没有运气.

有什么想法吗?

Vic*_*box 16

解决方案是在/etc/apache2/mods-enabled/proxy.conf中使用它:

<IfModule mod_proxy.c>
    ProxyRequests Off
    <Proxy *>
        AddDefaultCharset off 
        Order deny,allow
        Allow from all 
    </Proxy>
</IfModule>
Run Code Online (Sandbox Code Playgroud)