Код: Выделить всё
Forbidden
You don't have permission to access this resource.
Apache/2.4.52 (Ubuntu) Server at 192.168.5.3 Port 80
Это на RPi4 под управлением Ubuntu с фиксированным IP-адресом 192.168.5.3
Я следовал этим инструкциям, немного смешанным с тем, что, как я обнаружил, изменилось за последние годы.
https://wiki.mercurial-scm. org/HgWebDirStepByStep
У меня в /etc/apache2/hg есть файл main.conf, который содержит следующее:
Код: Выделить всё
WSGIScriptAliasMatch ^/hg(.*) /var/hg/script/hgweb.wsgi$1
Order deny,allow
Allow from all
Код: Выделить всё
# 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
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
# 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
Include /etc/apache2/hg/main.conf
Options +ExecCGI
PassEnv LANG
AddHandler hgweb .cgi
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Код: Выделить всё
Include /etc/apache2/hg/main.conf & the section
Код: Выделить всё
# An example WSGI for use with mod_wsgi, edit as necessary
# See https://mercurial-scm.org/wiki/modwsgi for more information
# Path to repo or hgweb config to serve (see 'hg help hgweb')
config = "/var/hg/hgweb.config"
# Uncomment and adjust if Mercurial is not installed system-wide
# (consult "installed modules" path from 'hg debuginstall'):
#import sys; sys.path.insert(0, "/path/to/python/lib")
# Uncomment to send python tracebacks to the browser if an error occurs:
import cgitb; cgitb.enable()
# enable demandloading to reduce startup time
from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb import hgweb
application = hgweb(config)
/var/hg/hgweb.config содержит:
Код: Выделить всё
[paths]
bh0002 = /var/hg/bh0002
sam4sd32c_freertos=/var/hg/sam4sd32c_freertos
sqlforms=/var/hg/sqlforms
..snip..
логов находятся здесь:
Код: Выделить всё
tail -f /var/log/apache2/access.log
192.168.5.43 - - [06/Oct/2024:15:18:14 +0000] "GET /hg HTTP/1.1" 403 492 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0"
192.168.5.43 - - [06/Oct/2024:15:25:16 +0000] "GET /hg HTTP/1.1" 403 493 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0"
192.168.5.43 - - [06/Oct/2024:15:25:18 +0000] "GET /hg HTTP/1.1" 403 492 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0"
192.168.5.43 - - [06/Oct/2024:15:25:23 +0000] "GET /hg HTTP/1.1" 403 492 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0"
192.168.5.43 - - [06/Oct/2024:15:30:41 +0000] "GET /hg HTTP/1.1" 403 493 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0"
192.168.5.43 - - [06/Oct/2024:15:30:43 +0000] "GET /hg HTTP/1.1" 403 492 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0"
192.168.5.43 - - [06/Oct/2024:15:49:45 +0000] "GET /hg HTTP/1.1" 403 493 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0"
192.168.5.43 - - [06/Oct/2024:16:34:04 +0000] "GET /hg HTTP/1.1" 403 493 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0"
192.168.5.43 - - [06/Oct/2024:16:44:15 +0000] "GET /hg HTTP/1.1" 403 493 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0"
192.168.5.43 - - [06/Oct/2024:16:44:16 +0000] "GET /hg HTTP/1.1" 403 492 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0"
Подробнее здесь: https://stackoverflow.com/questions/790 ... -error-403
Мобильная версия