I'm trying to get phpIPAM working on my Ubuntu but I have some problems: solving this 403 Forbidden error.
When I run tail -f /var/log/nginx/error.log
, I see this:
[error] 2898#2898: *1 directory index of "/var/www/html/phpipam/" is forbidden, client: IP, server: _, request: "GET /phpipam/ HTTP/1.1", host: "IP"
IP is given to the Client.
I'm using Ubuntu 20.04 and nginx using a guide described here.
This is my /var/www/html/config.php
:
$db['host'] = 'localhost';
$db['user'] = 'phpipam';
$db['pass'] = 'StrongDBPassword';
$db['name'] = 'phpipam';
$db['port'] = 3306;
I replaced StrongDBPassword
with the password I have given this database before in the first steps.
And then edit /etc/nginx/conf.d/phpipam.conf
:
server {
# root directory
root /var/www/html;
# phpipam
location /phpipam/ {
try_files $uri $uri/ /phpipam/index.php;
index index.php;
}
# phpipam - api
location /phpipam/api/ {
try_files $uri $uri/ /phpipam/api/index.php;
}
# php-fpm
location ~ \.php$ {
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
try_files $uri $uri/ index.php = 404;
include fastcgi_params;
}
}
At the end to give permisssion I run
sudo chown -R www-data:www-data /var/www/html
I can also reach the website from phpIPAM from other Clients and also ping the client, but I still getting the same error.
I have looked here and on other sites, but I couldn't solve this problem.
I'm quite new with Ubuntu so I appreciate any help.