Before asking for help please read "How to request help" by clicking on that tab above here.
  • Page:
  • 1

TOPIC:

Install Problems 2 weeks 14 hours ago #1

  • davec
  • davec's Avatar Topic Author
  • Offline
  • New
  • New
  • Posts: 11
Hi,
I've just installed webtrees on a brand new Centos 8 VM after installing nginx and PHP. I can browse to my test php files on the root of the web site, but I get 'forbidden' when I try to browse /webtrees and 'access denied' when I browse /webtrees/index.php'
I have created two test files nginx/html/webtrees/hello.php and nginx/html/test/hello.php - both folders have the same permissions and owners, as do the files.
I can browse the /test/hello.php file but not the /webtrees/hello.php file.

I'm new to nginx and php - anyone any ideas?

Regards,
Dave

Please Log in or Create an account to join the conversation.

Install Problems 2 weeks 4 hours ago #2

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 13603
What error messages are written to the nginx error log? It may tell you why it couldn't access the file.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

Install Problems 1 week 6 days ago #3

  • davec
  • davec's Avatar Topic Author
  • Offline
  • New
  • New
  • Posts: 11
This is the error if I browse the webtrees folder:
[error] 5244#0: *8 open() "/usr/share/nginx/html/webtrees" failed (13: Permission denied), client: x.x.x.x, server: _, request: "GET /webtrees HTTP/1.1", host: "x.x.x.x"

This is the error if I browse my test file webtree/hello.php:
[error] 5244#0: *9 FastCGI sent in stderr: "Unable to open primary script: /usr/share/nginx/html/webtrees/hello.php (Permission denied)" while reading response header from upstream, client: x.x.x.x, server: _, request: "GET /webtrees/hello.php HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "x.x.x.x"

There is no error if I browse a copy of my test file test/hello.php

Please Log in or Create an account to join the conversation.

Install Problems 1 week 5 days ago #4

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 13603
>open() "/usr/share/nginx/html/webtrees" failed (13: Permission denied)

Then I guess that nginx does not have permission to this folder.

> Centos 8

Are you using selinux? I cannot remember if it is enabled by default on centos. (It is with redhat).
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

Install Problems 1 week 5 days ago #5

  • davec
  • davec's Avatar Topic Author
  • Offline
  • New
  • New
  • Posts: 11
I can't even browse the apple-touch-icon.png in the webtrees folder, but I can if I copy it to the test folder.
The folders:
drwxr-xr-x. 2 nginx nginx 51 Oct 16 23:39 test
drwxr-xr-x. 11 nginx nginx 4096 Oct 16 23:38 webtrees
The files:
-rw-r--r--. 1 nginx nginx 5709 May 11 13:24 webtrees/apple-touch-icon.png
-rw-r--r--. 1 nginx nginx 5709 Oct 16 23:39 test/apple-touch-icon.png

Please Log in or Create an account to join the conversation.

Install Problems 1 week 5 days ago #6

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 13603
> Are you using selinux?

Try "ls -lZ" instead of "ls -l".
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

Install Problems 1 week 5 days ago #7

  • davec
  • davec's Avatar Topic Author
  • Offline
  • New
  • New
  • Posts: 11
Yes, it was SELinux (enabled by default on Centos 8) - sorry, not used Linux much in a very long time!
I've set permissive mode on httpd_t context, restarted nginx and I can now start the Webtrees wizard.
Thanks for pointing me in the right direction.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum