我不是一个完整的初学者,很抱歉发布了一个模棱两可的问题,这个问题已经以其他稍微不同的形式发布了这么多。无论如何,我收到此错误:

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

我有 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>
    
  • /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>
    
  • /var/www/tomcat6/conf/server.xml 文件有:

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

    我在 proxyPort="80" 中有 server.xml 但仍然没有运气。

    对此有何想法?

    最佳答案

    解决方案是将其放在/etc/apache2/mods-enabled/proxy.conf 中:

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

    关于apache - 错误 403 Forbidden -- 对 apache2、tomcat6、mod_proxy 的权限,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/6643852/

    10-16 20:16