search

Home  >  Q&A  >  body text

Forbidden appears in apache+tomcat

Set wap.luger.me in apache to point to the wap project in tomcat. Forbidden

appears when accessing

You don't have permission to access / on this server.

This is not a problem of permissions. Tomcat is started as luger user. Apache is started as root user. Please tell me how to solve this problem. Thanks.

黄舟黄舟2834 days ago575

reply all(2)I'll reply

  • 天蓬老师

    天蓬老师2017-05-16 17:05:00

    I just happened to encounter this problem. There are many reasons for this problem. The method to solve this problem depends on your apache version. The solution is also different. If you installed it recently, the apache version should be 2.4. It configures the virtual directory differently than 2.2.
    Please read this article carefully: http://linux.cn/article-3164-1.html
    This is set in the apache default directory. If the virtual directory is not built in /var/www, then it must be set as follows:

    ServerName 127.0.0.1:80
    <Directory /home/hehongwei/wwwroot/>
            Options Indexes FollowSymLinks
            AllowOverride None
            Require all granted
    </Directory>
    <VirtualHost *:80>
            # The ServerName directive sets the request scheme, hostname and port that
            # the server uses to identify itself. This is used when creating
            # redirection URLs. In the context of virtual hosts, the ServerName
            # specifies what hostname must appear in the request's Host: header to
            # match this virtual host. For the default virtual host (this file) this
            # value is not decisive as it is used as a last resort host regardless.
            # However, you must set it for any further virtual host explicitly.
            #ServerName www.example.com
            ServerName unixmen1.local
            ServerAlias www.unixmen1.local
            ServerAdmin webmaster@localhost
            DocumentRoot /home/hehongwei/wwwroot
    
    
            # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
            # error, crit, alert, emerg.
            # It is also possible to configure the loglevel for particular
            # modules, e.g.
            #LogLevel info ssl:warn
    
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined
    
    
            # For most configuration files from conf-available/, which are
            # enabled or disabled at a global level, it is possible to
            # include a line for only one particular virtual host. For example the
            # following line enables the CGI configuration for this host only
            # after it has been globally disabled with "a2disconf".
            #Include conf-available/serve-cgi-bin.conf
    </VirtualHost>
    

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-16 17:05:00

    You don't have permission to access / on this server.

    No permission to access root directory

    It should be that the configuration file was written incorrectly. Is it written like this? Directory "/"

    reply
    0
  • Cancelreply