You are not logged in.

#1 2020-01-05 06:51:22

Arctiopaser
Member
Registered: 2020-01-05
Posts: 5

[SOLVED] How to move websites to home folder(nginx + php - fpm)

Hi everyone, earlier i just install webserver(pacman -S nginx php-fpm mariadb) then i restarting nginx php-fpm under my user(edit /etc/nginx/nginx.conf, /etc/php/php-fpm.d/www.conf) and after this all my websites is working from my home folder, but this time something changed and  i get error - file not found in my browser
error log - 2020/01/05 09:48:33 [error] 8109#8109: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 127.0.0.1, server: adminer, request: "GET /adminer.php HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/php-fpm.sock:", host: "adminer"

nginx.conf
server {
        listen       80;
        server_name  adminer;
        root /home/56/websites/adminer;
        index index.php index.html index.htm;
        charset utf-8;

        #access_log  logs/host.access.log  main;

        location / {
            try_files $uri $uri/ =404;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /usr/share/nginx/html;
        }

        location ~ \.php$ {
            #fastcgi_pass 127.0.0.1:9000; (depending on your php-fpm socket configuration)
            fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
            #fastcgi_index index.php;
            include fastcgi.conf;
        }

}

html files is work
if i running nginx php-fpm after default user http and run sites from /usr/share/nginx/html/ sites too work, once - i must write full patch to address field in browser, example - "adminer/index.php", "adminer/" not will work, in this way i can't easy editing my files

i hope you understand me true, english is not native language, thanks

SOLVED

Last edited by Arctiopaser (2020-01-11 07:00:42)

Offline

#2 2020-01-05 11:31:34

loqs
Member
Registered: 2014-03-06
Posts: 17,196

Re: [SOLVED] How to move websites to home folder(nginx + php - fpm)

Offline

#3 2020-01-05 14:03:45

Arctiopaser
Member
Registered: 2020-01-05
Posts: 5

Re: [SOLVED] How to move websites to home folder(nginx + php - fpm)

ok, that's work, thak you, first i can't find /etc/systemd/system/multi-user.target.wants/php-fpm.service then i enabled php-fpm(systemctl enable php-fpm.service nginx.service mysqld.service) and find him, changed trueto false - ProtectHome=false

that's normal? security for desktop local server?

Offline

Board footer

Powered by FluxBB