1

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.

mforsetti
  • 2,488
  • 2
  • 14
  • 20
Johann
  • 11
  • 2
  • I think [this question](https://stackoverflow.com/questions/19285355/nginx-403-error-directory-index-of-folder-is-forbidden) will be of particular interest to you. – tilleyc Mar 20 '21 at 18:25

1 Answers1

0

Thanks. The problem was solved on a another way. For the people who also have this problem. Somehow apache2 was still blocking something and the nginx didnt worked propertly. I should have removed the apache2 completely before. But now I have removed the nginx and did it with apache2. Now it works!

Johann
  • 11
  • 2