Apache 2.4.7 403 Forbidden Error

I am trying to install the appass assembler as a web server with apache ( http://wiki.openstreetmap.org/wiki/Overpass_API/install )

Here is my 000-default.conf

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ExtFilterDefine gzip mode=output cmd=/bin/gzip
DocumentRoot /root/osm-3s_v0.7.4/html

# This directive indicates that whenever someone types http://www.mydomain.com/api/ 
# Apache2 should refer to what is in the local directory [YOUR_EXEC_DIR]/cgi-bin/
ScriptAlias /api/ /srv/osm3s/cgi-bin/


# This specifies some directives specific to the directory: [YOUR_EXEC_DIR]/cgi-bin/
<Directory "/srv/osm3s/cgi-bin/">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
            #SetOutputFilter gzip
            #Header set Content-Encoding gzip
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit, alert, emerg
LogLevel warn

CustomLog /var/log/apache2/access.log combined

However, when I try to run the command:

http://175.33.148.57/api/interpreter?data=%3Cprint%20mode=%22body%22/%3E

I get 403 Forbidden error.

I did it already

chmod 777 /srv/osm3s/cgi-bin/

But nothing works.

Please help, I am stuck on this for 3 days! Thanks in advance.

+4
source share
3 answers

Here's how I solved this problem for anyone who might have a similar one:

It seemed that the problem arose from the place where I installed the installation of the overpass ($ EXEC_DIR).

Therefore, I had to change the installation directories to:

$EXEC_DIR       /var/www/osm/
$DB_DIR         /var/www/osm/db/
$PLANET_FILE    /var/www/osm/planet.osm.bz2
$REPLICATE_DIR  /var/www/osm/rep/

default.conf:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ExtFilterDefine gzip mode=output cmd=/bin/gzip
    DocumentRoot /root/osm-3s_v0.7.4/html

    # This directive indicates that whenever someone types                         http://www.example.com/api/ 
    # Apache2 should refer to what is in the local directory         [YOUR_EXEC_DIR]/cgi-bin/
    ScriptAlias /api/ /var/www/osm/cgi-bin/


    # This specifies some directives specific to the directory: [YOUR_EXEC_DIR]/cgi-bin/
    <Directory "/var/www/osm/cgi-bin/">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
            #SetOutputFilter gzip
            #Header set Content-Encoding gzip
    </Directory>

    ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit, alert, emerg
    LogLevel warn

    CustomLog /var/log/apache2/access.log combined

</VirtualHost>

, . !

0

:

<Directory /www/mysite>
    Allow from All
</Directory>

<Directory /www/mysite>
    Require all granted
</Directory>
+5
try this as it is. don't add Order allow,deny or others

AddHandler cgi-script .cgi .py 
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Require all granted
    Allow from all
</Directory>
0
source

Source: https://habr.com/ru/post/1542240/


All Articles