You are not logged in.
Hello. I'm tried to put www folder into different hard disk for use it with Nginx server.
Actual directory /var/www
New directory /mnt/tempDisk/www
tempDisk is an HDD format by NTFS
So:
$ sudo mv /var/www /mnt/tempDisk/
$ sudo ln -s /mnt/tempDisk/www /var/But now if I visit a page I get "file not found":
$ cat /var/log/nginx/sample.test-error.log
2023/10/19 19:09:05 [error] 6722#6722: *7 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 127.0.0.1, server: sample.test, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.1-fpm.sock:", host: "sample.test"$ cat /etc/nginx/sites-available/sample
server {
listen 80;
#listen 443 ssl http2;
server_name .sample.test;
root "/var/www/sample/";
index index.html index.htm index.php;
charset utf-8;
client_max_body_size 512M;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
error_log /var/log/nginx/sample.test-error.log error;
sendfile off;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
}
location ~ /\.ht {
deny all;
}
#ssl_certificate /etc/nginx/ssl/sample.test.crt;
#ssl_certificate_key /etc/nginx/ssl/sample.test.key;
}$ ls /var/ | grep www
lrwxrwxrwx 1 root root 17 Oct 19 19:04 www -> /mnt/tempDisk/www$ sudo chown -R lorenzo:http /var/www
$ ls /var/ | grep www
lrwxrwxrwx 1 lorenzo http 17 Oct 19 19:04 www -> /mnt/tempDisk/www$ sudo chown -R lorenzo:http sample/
$ ls | grep sample
drwxr-x--- 1 lorenzo lorenzo 4.0K Oct 19 19:03 sample
$ sudo chown -R lorenzo:http /mnt/tempDisk/www/sample
$ ls /mnt/tempDisk/www/ | grep sample
drwxr-x--- 1 lorenzo lorenzo 4.0K Oct 19 19:03 sample$ whoami
lorenzo
$ cat /etc/nginx/nginx.conf | grep user
user http http;
$ cat /etc/hosts | grep sample.test
127.0.0.1 sample.testOffline
Okay ... and why are you using a symlink? If you want to serve content from /mnt/tempDisk/www just do that. I'm not sure if NTFS itself will cause permission issues, but I am sure that the symlink isn't helping you any.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Okay ... and why are you using a symlink? If you want to serve content from /mnt/tempDisk/www just do that. I'm not sure if NTFS itself will cause permission issues, but I am sure that the symlink isn't helping you any.
Ok I remove the symlink and fix nginx conf but I still have the same problem.
I can't change permission... NTFS trouble?
$ sudo chown -R lorenzo:http /mnt/tempDisk/www/sample
$ ls /mnt/tempDisk/www/ | grep sample
drwxr-x--- 1 lorenzo lorenzo 4.0K Oct 19 19:03 sampleOffline
Thanks - how are you mounting the ntfs partition? What's the output of `mount`?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
"I solved it" by formatting in ext4.
Offline