Error 403 Forbidden -- permissions on apache2, tomcat6, mod_



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

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/输入/网站/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>

step1。您需要打开文件名"phpmyadmin.conf"。这是phpmyadmin配置文件。需要替换代码的地方

<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

替换代码

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

步骤2。现在你需要打开另一个文件文件是你的Apache " httpd.conf " 文件。这也是您的Apache配置文件。您可以在"C:wampbinapacheApache2.2.21conf"下找到此文件。这个路径同样取决于您的wamp服务器的安装目录。在这个文件下,您需要更改代码。首先搜索此代码" # onlineoffline tag - don 't remove " 您可能在文件中间找到了这段代码。然后删除" Allow from 127.0.0.1″"并将" Deny from all "替换为" Allow from all " 是的,如果可能的话,为你的"phpmyadmin"创建一些唯一的密码,这样外人就无法访问(如果你使用的是本地机器,则忽略)。

最新更新