Nginx the "user" directive - nginx

My Nginx server threw the warning:
nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
I created nginx-group and nginx-user
groupadd --system --gid 7447 nginx-group
adduser --system --gid 7447 --uid 7447 nginx-user
The Nginx process owned by my user "nginx-user"
bash-4.2$ ps -ef | grep [n]ginx
nginx-u+ 1 0 0 08:05 ? 00:00:00 nginx: master process nginx -g daemon off;
nginx-u+ 7 1 0 08:05 ? 00:00:00 nginx: worker process
The /etc/nginx folder and content owned by the root user
bash-4.2$ ls -la /etc/nginx
total 20
drwxr-xr-x 1 root root 20 Aug 1 07:33 .
drwxr-xr-x 1 root root 41 Aug 1 08:05 ..
drwxr-xr-x 1 root root 54 Aug 1 07:33 conf.d
-rw-r--r-- 1 root root 1007 May 24 15:35 fastcgi_params
-rw-r--r-- 1 root root 3957 Aug 1 07:05 mime.types
lrwxrwxrwx 1 root root 29 Aug 1 07:33 modules -> ../../usr/lib64/nginx/modules
-rw-r--r-- 1 root root 2200 Aug 1 07:05 nginx.conf
-rw-r--r-- 1 root root 636 May 24 15:35 scgi_params
drwxr-xr-x 1 root root 22 Aug 1 07:33 sites-available
drwxr-xr-x 1 root root 22 Aug 1 07:33 sites-enabled
-rw-r--r-- 1 root root 664 May 24 15:35 uwsgi_params
Anyone can help to fix this warning ?

Related

I can't use R CMD BUILD because I have no build file in R\R-3.4.0\bin

I have not build file in the binary of my version of R. Should I try to get it to be able to use R CMD BUILD (how?) or should I try to build a package in another way?
While INSTALL is capitalized (to avoid clashes with the existing /usr/bin/install, as are a few others as shown below), the build command is not:
edd#rob:~$ ls -l /usr/lib/R/bin/
total 488
-rwxr-xr-x 1 root root 1837 Jul 2 19:39 BATCH
-rwxr-xr-x 1 root root 350 Jul 2 19:39 build
-rwxr-xr-x 1 root root 317 Jul 2 19:39 check
-rwxr-xr-x 1 root root 2165 Jul 2 19:39 COMPILE
-rwxr-xr-x 1 root root 11377 Jul 2 19:39 config
drwxr-xr-x 2 root root 4096 Jul 15 20:25 exec
-rwxr-xr-x 1 root root 3618 Jul 2 19:39 f77_f2c
-rwxr-xr-x 1 root root 823 Jul 2 19:39 INSTALL
-rwxr-xr-x 1 root root 14530 Jul 2 19:39 javareconf
-rwxr-xr-x 1 root root 355913 Jul 2 19:39 libtool
-rwxr-xr-x 1 root root 1442 Jul 2 19:39 LINK
-rwxr-xr-x 1 root root 3496 Jul 2 19:39 mkinstalldirs
-rwxr-xr-x 1 root root 483 Jul 2 19:39 pager
-rwxr-xr-x 1 root root 8722 Jul 2 19:39 R
-rwxr-xr-x 1 root root 1375 Jul 2 19:39 Rcmd
-rwxr-xr-x 1 root root 316 Jul 2 19:39 Rd2pdf
-rwxr-xr-x 1 root root 359 Jul 2 19:39 Rdconv
-rwxr-xr-x 1 root root 258 Jul 2 19:39 Rdiff
-rwxr-xr-x 1 root root 158 Jul 2 19:39 REMOVE
-rwxr-xr-x 1 root root 310 Jul 2 19:39 Rprof
-rwxr-xr-x 1 root root 14344 Jul 2 19:39 Rscript
-rwxr-xr-x 1 root root 4121 Jul 2 19:39 rtags
-rwxr-xr-x 1 root root 155 Jul 2 19:39 SHLIB
-rwxr-xr-x 1 root root 318 Jul 2 19:39 Stangle
-rwxr-xr-x 1 root root 316 Jul 2 19:39 Sweave
edd#rob:~$
So make sure you type R CMD build ... instead.

Nginx: This site can't be reached; permissions configuration?

In the process of setting up nginx on a VPS and am getting the generic 'site can't be reached' error as described in the title. Here's /etc/nginx/sites-available/domainname.com
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/domainname.com/public;
index index.php index.html index.htm
server_name domainname.com;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
This is sym-linked in /etc/nginx/sites-enabled. Both the domain name nor the IP address of the VPS return the same error. I recall a few months ago having a similar problem and ended up needing to alter certain file permissions, and even wrote down what happened, but cannot find my notes on the matter. Still, I suspect permissions to be part of the issue again.
As far as I know, the problem could be permissions on the contents of the nginx directory or of my php directory or the user running the nginx process. To that end, here's what ls -la returns for /etc/nginx:
ls -la -R /etc/nginx
/etc/nginx:
total 64
drwxr-xr-x 6 root root 4096 May 29 22:32 .
drwxr-xr-x 98 root root 4096 May 29 22:34 ..
drwxr-xr-x 2 root root 4096 Oct 27 2016 conf.d
-rw-r--r-- 1 root root 1077 Apr 26 2016 fastcgi.conf
-rw-r--r-- 1 root root 1007 Apr 26 2016 fastcgi_params
-rw-r--r-- 1 root root 2837 Apr 26 2016 koi-utf
-rw-r--r-- 1 root root 2223 Apr 26 2016 koi-win
-rw-r--r-- 1 root root 3957 Apr 26 2016 mime.types
-rw-r--r-- 1 root root 1462 Apr 26 2016 nginx.conf
-rw-r--r-- 1 root root 180 Apr 26 2016 proxy_params
-rw-r--r-- 1 root root 636 Apr 26 2016 scgi_params
drwxr-xr-x 2 root root 4096 May 29 23:25 sites-available
drwxr-xr-x 2 root root 4096 May 29 23:28 sites-enabled
drwxr-xr-x 2 root root 4096 May 29 22:32 snippets
-rw-r--r-- 1 root root 664 Apr 26 2016 uwsgi_params
-rw-r--r-- 1 root root 3071 Apr 26 2016 win-utf
/etc/nginx/conf.d:
total 8
drwxr-xr-x 2 root root 4096 Oct 27 2016 .
drwxr-xr-x 6 root root 4096 May 29 22:32 ..
/etc/nginx/sites-available:
total 12
drwxr-xr-x 2 root root 4096 May 29 23:25 .
drwxr-xr-x 6 root root 4096 May 29 22:32 ..
-rw-r--r-- 1 root root 2129 May 29 22:57 domainname
/etc/nginx/sites-enabled:
total 8
drwxr-xr-x 2 root root 4096 May 29 23:28 .
drwxr-xr-x 6 root root 4096 May 29 22:32 ..
lrwxrwxrwx 1 root root 34 May 29 22:32 default -> /etc/nginx/sites-available/default
lrwxrwxrwx 1 root root 40 May 29 23:28 domainname -> /etc/nginx/sites-available/domainname
/etc/nginx/snippets:
total 16
drwxr-xr-x 2 root root 4096 May 29 22:32 .
drwxr-xr-x 6 root root 4096 May 29 22:32 ..
-rw-r--r-- 1 root root 422 Apr 26 2016 fastcgi-php.conf
-rw-r--r-- 1 root root 217 Apr 26 2016 snakeoil.conf
And the output for /etc/php:
ls -la -R /etc/php
/etc/php:
total 12
drwxr-xr-x 3 root root 4096 May 29 22:34 .
drwxr-xr-x 98 root root 4096 May 29 22:34 ..
drwxr-xr-x 5 root root 4096 May 29 22:34 7.0
/etc/php/7.0:
total 20
drwxr-xr-x 5 root root 4096 May 29 22:34 .
drwxr-xr-x 3 root root 4096 May 29 22:34 ..
drwxr-xr-x 3 root root 4096 May 29 22:34 cli
drwxr-xr-x 4 root root 4096 May 29 22:40 fpm
drwxr-xr-x 2 root root 4096 May 29 22:34 mods-available
/etc/php/7.0/cli:
total 84
drwxr-xr-x 3 root root 4096 May 29 22:34 .
drwxr-xr-x 5 root root 4096 May 29 22:34 ..
drwxr-xr-x 2 root root 4096 May 29 22:34 conf.d
-rw-r--r-- 1 root root 70655 May 11 23:12 php.ini
/etc/php/7.0/cli/conf.d:
total 8
drwxr-xr-x 2 root root 4096 May 29 22:34 .
drwxr-xr-x 3 root root 4096 May 29 22:34 ..
lrwxrwxrwx 1 root root 39 May 29 22:34 10-opcache.ini -> /etc/php/7.0/mods-available/opcache.ini
lrwxrwxrwx 1 root root 35 May 29 22:34 10-pdo.ini -> /etc/php/7.0/mods-available/pdo.ini
lrwxrwxrwx 1 root root 40 May 29 22:34 20-calendar.ini -> /etc/php/7.0/mods-available/calendar.ini
lrwxrwxrwx 1 root root 37 May 29 22:34 20-ctype.ini -> /etc/php/7.0/mods-available/ctype.ini
lrwxrwxrwx 1 root root 36 May 29 22:34 20-exif.ini -> /etc/php/7.0/mods-available/exif.ini
lrwxrwxrwx 1 root root 40 May 29 22:34 20-fileinfo.ini -> /etc/php/7.0/mods-available/fileinfo.ini
lrwxrwxrwx 1 root root 35 May 29 22:34 20-ftp.ini -> /etc/php/7.0/mods-available/ftp.ini
lrwxrwxrwx 1 root root 39 May 29 22:34 20-gettext.ini -> /etc/php/7.0/mods-available/gettext.ini
lrwxrwxrwx 1 root root 37 May 29 22:34 20-iconv.ini -> /etc/php/7.0/mods-available/iconv.ini
lrwxrwxrwx 1 root root 36 May 29 22:34 20-json.ini -> /etc/php/7.0/mods-available/json.ini
lrwxrwxrwx 1 root root 40 May 29 22:34 20-mbstring.ini -> /etc/php/7.0/mods-available/mbstring.ini
lrwxrwxrwx 1 root root 41 May 29 22:34 20-pdo_pgsql.ini -> /etc/php/7.0/mods-available/pdo_pgsql.ini
lrwxrwxrwx 1 root root 37 May 29 22:34 20-pgsql.ini -> /etc/php/7.0/mods-available/pgsql.ini
lrwxrwxrwx 1 root root 36 May 29 22:34 20-phar.ini -> /etc/php/7.0/mods-available/phar.ini
lrwxrwxrwx 1 root root 37 May 29 22:34 20-posix.ini -> /etc/php/7.0/mods-available/posix.ini
lrwxrwxrwx 1 root root 40 May 29 22:34 20-readline.ini -> /etc/php/7.0/mods-available/readline.ini
lrwxrwxrwx 1 root root 37 May 29 22:34 20-shmop.ini -> /etc/php/7.0/mods-available/shmop.ini
lrwxrwxrwx 1 root root 39 May 29 22:34 20-sockets.ini -> /etc/php/7.0/mods-available/sockets.ini
lrwxrwxrwx 1 root root 39 May 29 22:34 20-sysvmsg.ini -> /etc/php/7.0/mods-available/sysvmsg.ini
lrwxrwxrwx 1 root root 39 May 29 22:34 20-sysvsem.ini -> /etc/php/7.0/mods-available/sysvsem.ini
lrwxrwxrwx 1 root root 39 May 29 22:34 20-sysvshm.ini -> /etc/php/7.0/mods-available/sysvshm.ini
lrwxrwxrwx 1 root root 41 May 29 22:34 20-tokenizer.ini -> /etc/php/7.0/mods-available/tokenizer.ini
/etc/php/7.0/fpm:
total 96
drwxr-xr-x 4 root root 4096 May 29 22:40 .
drwxr-xr-x 5 root root 4096 May 29 22:34 ..
drwxr-xr-x 2 root root 4096 May 29 22:34 conf.d
-rw-r--r-- 1 root root 4421 May 11 23:12 php-fpm.conf
-rw-r--r-- 1 root root 70997 May 29 22:40 php.ini
drwxr-xr-x 2 root root 4096 May 29 22:34 pool.d
/etc/php/7.0/fpm/conf.d:
total 8
drwxr-xr-x 2 root root 4096 May 29 22:34 .
drwxr-xr-x 4 root root 4096 May 29 22:40 ..
lrwxrwxrwx 1 root root 39 May 29 22:34 10-opcache.ini -> /etc/php/7.0/mods-available/opcache.ini
lrwxrwxrwx 1 root root 35 May 29 22:34 10-pdo.ini -> /etc/php/7.0/mods-available/pdo.ini
lrwxrwxrwx 1 root root 40 May 29 22:34 20-calendar.ini -> /etc/php/7.0/mods-available/calendar.ini
lrwxrwxrwx 1 root root 37 May 29 22:34 20-ctype.ini -> /etc/php/7.0/mods-available/ctype.ini
lrwxrwxrwx 1 root root 36 May 29 22:34 20-exif.ini -> /etc/php/7.0/mods-available/exif.ini
lrwxrwxrwx 1 root root 40 May 29 22:34 20-fileinfo.ini -> /etc/php/7.0/mods-available/fileinfo.ini
lrwxrwxrwx 1 root root 35 May 29 22:34 20-ftp.ini -> /etc/php/7.0/mods-available/ftp.ini
lrwxrwxrwx 1 root root 39 May 29 22:34 20-gettext.ini -> /etc/php/7.0/mods-available/gettext.ini
lrwxrwxrwx 1 root root 37 May 29 22:34 20-iconv.ini -> /etc/php/7.0/mods-available/iconv.ini
lrwxrwxrwx 1 root root 36 May 29 22:34 20-json.ini -> /etc/php/7.0/mods-available/json.ini
lrwxrwxrwx 1 root root 40 May 29 22:34 20-mbstring.ini -> /etc/php/7.0/mods-available/mbstring.ini
lrwxrwxrwx 1 root root 41 May 29 22:34 20-pdo_pgsql.ini -> /etc/php/7.0/mods-available/pdo_pgsql.ini
lrwxrwxrwx 1 root root 37 May 29 22:34 20-pgsql.ini -> /etc/php/7.0/mods-available/pgsql.ini
lrwxrwxrwx 1 root root 36 May 29 22:34 20-phar.ini -> /etc/php/7.0/mods-available/phar.ini
lrwxrwxrwx 1 root root 37 May 29 22:34 20-posix.ini -> /etc/php/7.0/mods-available/posix.ini
lrwxrwxrwx 1 root root 40 May 29 22:34 20-readline.ini -> /etc/php/7.0/mods-available/readline.ini
lrwxrwxrwx 1 root root 37 May 29 22:34 20-shmop.ini -> /etc/php/7.0/mods-available/shmop.ini
lrwxrwxrwx 1 root root 39 May 29 22:34 20-sockets.ini -> /etc/php/7.0/mods-available/sockets.ini
lrwxrwxrwx 1 root root 39 May 29 22:34 20-sysvmsg.ini -> /etc/php/7.0/mods-available/sysvmsg.ini
lrwxrwxrwx 1 root root 39 May 29 22:34 20-sysvsem.ini -> /etc/php/7.0/mods-available/sysvsem.ini
lrwxrwxrwx 1 root root 39 May 29 22:34 20-sysvshm.ini -> /etc/php/7.0/mods-available/sysvshm.ini
lrwxrwxrwx 1 root root 41 May 29 22:34 20-tokenizer.ini -> /etc/php/7.0/mods-available/tokenizer.ini
/etc/php/7.0/fpm/pool.d:
total 28
drwxr-xr-x 2 root root 4096 May 29 22:34 .
drwxr-xr-x 4 root root 4096 May 29 22:40 ..
-rw-r--r-- 1 root root 18508 May 11 23:12 www.conf
/etc/php/7.0/mods-available:
total 96
drwxr-xr-x 2 root root 4096 May 29 22:34 .
drwxr-xr-x 5 root root 4096 May 29 22:34 ..
-rw-r--r-- 1 root root 74 May 11 23:12 calendar.ini
-rw-r--r-- 1 root root 71 May 11 23:12 ctype.ini
-rw-r--r-- 1 root root 70 May 11 23:12 exif.ini
-rw-r--r-- 1 root root 74 May 11 23:12 fileinfo.ini
-rw-r--r-- 1 root root 69 May 11 23:12 ftp.ini
-rw-r--r-- 1 root root 73 May 11 23:12 gettext.ini
-rw-r--r-- 1 root root 71 May 11 23:12 iconv.ini
-rw-r--r-- 1 root root 68 May 11 23:12 json.ini
-rw-r--r-- 1 root root 76 May 11 23:12 mbstring.ini
-rw-r--r-- 1 root root 79 May 11 23:12 opcache.ini
-rw-r--r-- 1 root root 69 May 11 23:12 pdo.ini
-rw-r--r-- 1 root root 74 May 11 23:12 pdo_pgsql.ini
-rw-r--r-- 1 root root 70 May 11 23:12 pgsql.ini
-rw-r--r-- 1 root root 70 May 11 23:12 phar.ini
-rw-r--r-- 1 root root 71 May 11 23:12 posix.ini
-rw-r--r-- 1 root root 76 May 11 23:12 readline.ini
-rw-r--r-- 1 root root 71 May 11 23:12 shmop.ini
-rw-r--r-- 1 root root 73 May 11 23:12 sockets.ini
-rw-r--r-- 1 root root 73 May 11 23:12 sysvmsg.ini
-rw-r--r-- 1 root root 73 May 11 23:12 sysvsem.ini
-rw-r--r-- 1 root root 73 May 11 23:12 sysvshm.ini
-rw-r--r-- 1 root root 75 May 11 23:12 tokenizer.ini
Here are the relevant processes from ps aux
root 28217 0.0 2.8 287700 29156 ? Ss 22:48 0:00 php-fpm: master process (/etc/php/7.0/fpm/php-fpm.conf)
www-data 28221 0.0 0.6 287700 7052 ? S 22:48 0:00 php-fpm: pool www
www-data 28222 0.0 0.6 287700 7052 ? S 22:48 0:00 php-fpm: pool www
root 28405 0.0 0.1 124972 1416 ? Ss 23:00 0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
www-data 28406 0.0 0.3 125308 3148 ? S 23:00 0:00 nginx: worker process
I have a user created in my name with sudo privileges on which I'm doing the actual work, but I'm not sure if I should be allocating permissions to that user or if I should instead be using www-data?
This error was resolved--now returns a 404 Not Found which is the expected behavior as I haven't pushed the app to the server yet--by modifying the following segment of /etc/nginx/sites-available/domainname
listen 80 default_server;
listen [::]:80 default_server;
Modified to
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
I had suspected this might be the problem but was convinced that in my previous run-in with this issue, I had tried this and had no success. At any rate, I hope this helps someone in the future.

Job for nginx.service failed because the control process exited with error code [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I follow the steps to setup a nginx server. After I create example.com.config and symbolic link for each server block in the sites-enabled directory. My nginx can't start.
I can't restart nginx service. It shows the following message when I entered
$sudo systemctl restart nginx.service
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
$sudo systemctl status nginx.service -l shows the following message.
● nginx.service - nginx - high performance web server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2017-06-05 04:26:05 EDT; 1min 27s ago
Docs: http://nginx.org/en/docs/
Process: 4776 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)
Process: 11491 ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)
Jun 05 04:26:05 localhost.localdomain systemd[1]: Starting nginx - high performance web server...
Jun 05 04:26:05 localhost.localdomain nginx[11491]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Jun 05 04:26:05 localhost.localdomain nginx[11491]: nginx: [emerg] open() "/var/run/nginx.pid" failed (13: Permission denied)
Jun 05 04:26:05 localhost.localdomain nginx[11491]: nginx: configuration file /etc/nginx/nginx.conf test failed
Jun 05 04:26:05 localhost.localdomain systemd[1]: nginx.service: control process exited, code=exited status=1
Jun 05 04:26:05 localhost.localdomain systemd[1]: Failed to start nginx - high performance web server.
Jun 05 04:26:05 localhost.localdomain systemd[1]: Unit nginx.service entered failed state.
Jun 05 04:26:05 localhost.localdomain systemd[1]: nginx.service failed.
PS: I am running under CentOS 7 on virtualbox.
Please help me. Thank you.
Here's the output when I run ls -lart /var/run/
total 56
dr-xr-xr-x. 17 root root 233 Jun 2 05:37 ..
drwxr-xr-x. 2 root root 60 Jun 6 01:21 tmpfiles.d
drwxr-xr-x. 3 root root 60 Jun 6 01:21 log
drwxr-xr-x. 2 root root 60 Jun 6 01:21 mount
drwxr-xr-x. 4 root root 120 Jun 6 01:21 initramfs
prw-------. 1 root root 0 Jun 6 01:21 dmeventd-server
prw-------. 1 root root 0 Jun 6 01:21 dmeventd-client
drwx------. 2 root root 80 Jun 6 01:21 lvm
-rw-r--r--. 1 root root 4 Jun 6 01:21 lvmetad.pid
drwxr-xr-x. 2 root root 60 Jun 6 01:21 sysconfig
drwxr-xr-x. 2 root root 40 Jun 6 01:21 samba
drwxr-xr-x. 2 root root 40 Jun 6 01:21 setrans
drwxrwxr-x. 2 root root 40 Jun 6 01:21 netreport
drwxr-xr-x. 2 root root 40 Jun 6 01:21 faillock
drwx------. 2 rpc rpc 40 Jun 6 01:21 rpcbind
drwxr-xr-x. 2 root root 40 Jun 6 01:21 ppp
drwxrwxr-x. 3 root libstoragemgmt 60 Jun 6 01:21 lsm
drwxr-xr-x. 2 root root 40 Jun 6 01:21 spice-vdagentd
drwxr-xr-x. 2 root root 40 Jun 6 01:21 sepermit
drwxr-xr-x. 2 radvd radvd 40 Jun 6 01:21 radvd
drwx--x---. 2 root root 40 Jun 6 01:21 mdadm
drwxr-xr-x. 2 root root 40 Jun 6 01:21 certmonger
drwx--x--x. 2 setroubleshoot setroubleshoot 40 Jun 6 01:21 setroubleshoot
-rw-r--r--. 1 root root 4 Jun 6 01:21 auditd.pid
drwxr-xr-x. 2 root root 60 Jun 6 01:21 dbus
srw-rw-rw-. 1 root root 0 Jun 6 01:21 rpcbind.sock
drwxr-xr-x. 3 root lp 80 Jun 6 01:21 cups
drwxr-xr-x. 2 avahi avahi 80 Jun 6 01:21 avahi-daemon
-rw-------. 1 root root 11 Jun 6 01:21 alsactl.pid
-rw-r--r--. 1 root root 4 Jun 6 01:21 chronyd.pid
-rw-r--r--. 1 root root 4 Jun 6 01:21 ksmtune.pid
drwxr-xr-x. 2 root root 100 Jun 6 01:21 abrt
-rw-------. 1 root root 4 Jun 6 01:21 gssproxy.pid
srw-rw-rw-. 1 root root 0 Jun 6 01:21 gssproxy.sock
-rw-------. 1 root root 0 Jun 6 01:21 xtables.lock
drwxr-x---. 2 root root 40 Jun 6 01:21 firewalld
-rw-r--r--. 1 root root 4 Jun 6 01:21 dhclient-enp0s3.pid
drwxr-xr-x. 2 root root 80 Jun 6 01:21 NetworkManager
-rw-------. 1 root root 5 Jun 6 01:21 sm-notify.pid
drwxr-xr-x. 7 root root 180 Jun 6 01:21 lock
-rw-------. 1 root root 5 Jun 6 01:21 syslogd.pid
-rw-r--r--. 1 root root 5 Jun 6 01:21 sshd.pid
-rw-r--r--. 1 root root 5 Jun 6 01:21 crond.pid
-rw-r--r--. 1 root root 5 Jun 6 01:21 atd.pid
-rw-r--r--. 1 root root 4 Jun 6 01:21 libvirtd.pid
----------. 1 root root 0 Jun 6 01:21 cron.reboot
drwxr-xr-x. 2 root root 60 Jun 6 01:21 tuned
drwxr-xr-x. 6 root root 220 Jun 6 01:21 libvirt
drwxr-xr-x. 2 root root 40 Jun 6 01:21 plymouth
drwx------. 2 root root 40 Jun 6 01:22 udisks2
drwxr-xr-x. 2 root root 80 Jun 6 01:24 console
drwx--x--x. 4 root gdm 120 Jun 6 01:24 gdm
drwxr-xr-x. 3 root root 60 Jun 6 01:24 user
-rw-rw-r--. 1 root utmp 1536 Jun 6 01:24 utmp
drwxr-xr-x. 7 root root 160 Jun 6 01:24 udev
drwxr-xr-x. 17 root root 420 Jun 6 01:25 systemd
drwxr-xr-x. 37 root root 1140 Jun 6 01:25 .
ps -eaf |grep nginx
root 698 685 0 01:21 ? 00:00:00 runsv nginx
root 748 698 0 01:21 ? 00:00:00 svlogd -tt /var/log/gitlab/ngin
root 749 698 0 01:21 ? 00:00:00 nginx: master process /opt/gitlab/embedded/sbin/nginx -p /var/opt/gitlab/nginx
gitlab-+ 800 749 0 01:21 ? 00:00:00 nginx: worker process
gitlab-+ 801 749 0 01:21 ? 00:00:00 nginx: cache manager process
yen 6683 3840 0 01:44 pts/0 00:00:00 grep --color=auto nginx
Output of ps -eaf |grep nginx and netstat -tulpn |grep 80 before and after.
Here's the output of ps -eaf |grep nginx
root 669 1 0 21:50 ? 00:00:00 runsvdir -P /opt/gitlab/service log: svlogd: warning: unable to lock directory: /var/log/gitlab/nginx: temporary failure svlogd: fatal: no functional log directories. svlogd: warning: unable to lock directory: /var/log/gitlab/nginx: temporary failure svlogd: fatal: no functional log directories. svlogd: warning: unable to lock directory: /var/log/gitlab/nginx: temporary failure svlogd: fatal: no functional log directories. .....
root 4333 669 0 21:57 ? 00:00:00 runsv nginx
root 4348 4333 0 21:57 ? 00:00:00 svlogd -tt /var/log/gitlab/nginx
root 4374 4333 0 21:57 ? 00:00:00 nginx: master process /opt/gitlab/embedded/sbin/nginx -p /var/opt/gitlab/nginx
gitlab-+ 4381 4374 0 21:57 ? 00:00:00 nginx: worker process
gitlab-+ 4382 4374 0 21:57 ? 00:00:00 nginx: cache manager process
yen 14156 4094 0 23:13 pts/0 00:00:00 grep --color=auto nginx
Check your error log with sudo cat /var/log/nginx/error.log|less
You can also with WinScp by entering the path /var/log/nginx/
In my case had the syntax error.
In my server configuration file I had: server_name {api.mydomain.com};
The correct is: server_name api.mydomain.com;

rm is unable to remove file even id file appears through ls

Hello I have a directory containing following files:
bomble#master:/mnt/store/test$ ls -lrt /mnt/store/ChemAlive/utilities/
total 46623
-rwxrwxrwx 1 root root 63168 Feb 9 13:48 rungms
-rwxrwxrwx 1 root root 285 Feb 11 10:18 runCP2K.sh
-rwxrwxrwx 1 root root 46535066 Feb 11 10:22 cp2k.popt
-rwxrwxrwx 1 root root 108 Feb 11 10:22 cp2kend
-rwxrwxrwx 1 root root 206 Feb 11 10:22 cp2kendhess
-rwxrwxrwx 1 root root 285 Feb 11 10:22 cp2kstart
-rwxrwxrwx 1 root root 34 Feb 11 10:23 gamessdisphf
-rwxrwxrwx 1 root root 45 Feb 11 10:23 gamesssolvt
-rwxrwxrwx 1 root root 193 Feb 11 10:23 gamessstart
-rwxrwxrwx 1 root root 1110176 Feb 11 10:23 mopac5021mn.exe
-rwxrwxrwx 1 root root 564 Feb 11 10:23 mopacgeom
-rwxrwxrwx 1 root root 95 Feb 11 10:23 nwchemend
-rwxrwxrwx 1 root root 197 Feb 11 10:23 nwchemwaterend
-rwxrwxrwx 1 root root 25110 Feb 11 10:24 rmsperl.pl
-rwxrwxrwx 1 root root 60 Feb 11 10:24 scriptjmol
-rwxrwxrwx 1 root root 15 Feb 11 10:24 triatomicend.mop
-rwxrwxrwx 1 root root 224 Feb 11 10:30 gamessstarthf
I want to remove rungms that appears. If I try it fails:
bomble#master:/mnt/store/test$ sudo rm /mnt/store/ChemAlive/utilities/rungms
rm: cannot remove '/mnt/store/ChemAlive/utilities/rungms': No such file or directory
Any ideas?
Thanks
Firstly, this question does not quite fit this forum and the Unix tag because it's not about programming. It should have been asked at Unix&Linux or Superuser forums.
Anyway, according to your description, the directory seems to be corrupt. You can try the following recipe shared at https://superuser.com/questions/197605/delete-a-corrupt-file-in-linux:
Rename your directory.
Recreate the original directory (empty).
Copy other files back to it.
Delete the directory containing that file.
I think it has a non-printable character or space at the end of the file name.
How about just do sudo rm /mnt/store/ChemAlive/utilities/rung*

php5-fpm -t Unable to allocate shared memory segment

today i tried to setup my vserver with nginx and php5-fpm
but i somehow cannot get php5-fpm to work.
a service php5-fpm start looks like :
$ service php5-fpm start
php5-fpm start/running, process 27153
but nothing gets started. .pid doesnt get created aswell nor the .sock:
$ l /var/run/
total 48K
drwxr-xr-x 19 root root 640 Sep 8 12:51 .
drwxr-xr-x 23 root root 4.0K Sep 8 12:43 ..
drwxr-xr-x 2 root root 40 Sep 1 14:14 apache2
drwxr-xr-x 2 avahi avahi 80 Aug 11 11:12 avahi-daemon
-rw-r--r-- 1 root root 7 Aug 10 11:50 container_type
-rw-r--r-- 1 root root 4 Aug 10 11:50 crond.pid
---------- 1 root root 0 Aug 10 11:50 crond.reboot
drwxr-xr-x 2 messagebus messagebus 80 Aug 11 11:12 dbus
-rw-r--r-- 1 root root 0 Aug 10 11:53 init.upgraded
drwxrwxrwt 3 root root 80 Aug 10 11:52 lock
-rw-r--r-- 1 root root 114 Sep 8 12:16 motd.dynamic
drwxr-xr-x 2 root root 60 Aug 10 11:50 mount
drwxr-xr-x 2 mumble-server adm 40 Sep 1 15:06 mumble-server
drwxr-xr-x 2 mysql root 80 Sep 1 14:21 mysqld
drwxr-xr-x 3 root root 160 Aug 10 11:51 network
-rw-r--r-- 1 root root 6 Sep 8 12:43 nginx.pid
-rw-r--r-- 1 root root 4 Aug 10 11:50 rsyslogd.pid
drwxr-xr-x 3 root root 60 Aug 10 11:53 samba
drwx--x--- 2 root sasl 140 Aug 10 11:50 saslauthd
drwxrwxr-x 2 root utmp 40 Aug 10 11:50 screen
drwxr-xr-x 2 root root 40 Aug 10 11:50 sendsigs.omit.d
drwxrwxrwt 2 root root 40 Aug 10 11:50 shm
drwxr-xr-x 2 root root 40 Aug 10 11:50 sshd
-rw-r--r-- 1 root root 4 Aug 10 11:51 sshd.pid
drwxr-xr-x 5 root root 100 Aug 11 11:12 systemd
drwxr-xr-x 3 root root 100 Aug 10 11:53 udev
-rw-r--r-- 1 root root 5 Aug 10 11:53 upstart-file-bridge.pid
-rw-r--r-- 1 root root 5 Aug 10 11:53 upstart-socket-bridge.pid
-rw-r--r-- 1 root root 5 Aug 10 11:53 upstart-udev-bridge.pid
drwxr-xr-x 2 root root 40 Sep 8 12:16 user
-rw-rw-r-- 1 root utmp 1.5K Sep 8 12:15 utmp
-rw-r--r-- 1 root root 6 Sep 8 12:28 xinetd.pid
php5-fpm -t displays the following:
$ php5-fpm -t
Mon Sep 8 13:11:04 2014 (27954): Fatal Error Unable to allocate shared memory segment of 67108864 bytes: mmap: Cannot allocate memory (12)
php5-fpm is not running:
$ ps -ef 2 ↵
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 Aug10 ? 00:00:13 init
root 2 1 0 Aug10 ? 00:00:00 [kthreadd/781170]
root 3 2 0 Aug10 ? 00:00:00 [khelper/7811702]
syslog 348 1 0 Aug10 ? 00:00:45 rsyslogd
root 390 1 0 Aug10 ? 00:00:04 cron
root 577 1 0 Aug10 ? 00:00:00 /usr/sbin/saslauthd -a pam -c -m /var/run/saslauthd -n 2
root 578 577 0 Aug10 ? 00:00:00 /usr/sbin/saslauthd -a pam -c -m /var/run/saslauthd -n 2
root 869 1 0 Aug10 ? 00:00:33 /usr/sbin/sshd -D
mysql 3906 1 0 Sep01 ? 00:09:05 /usr/sbin/mysqld
root 8416 1 0 Aug10 ? 00:00:00 /lib/systemd/systemd-udevd --daemon
root 8472 1 0 Aug10 ? 00:00:00 upstart-udev-bridge --daemon
root 8474 1 0 Aug10 ? 00:00:00 upstart-file-bridge --daemon
root 8477 1 0 Aug10 ? 00:00:00 upstart-socket-bridge --daemon
message+ 14085 1 0 Aug11 ? 00:00:00 dbus-daemon --system --fork
root 14142 1 0 Aug11 ? 00:00:00 /lib/systemd/systemd-logind
avahi 14263 1 0 Aug11 ? 00:00:00 avahi-daemon: running [server2.local]
avahi 14265 14263 0 Aug11 ? 00:00:00 avahi-daemon: chroot helper
root 18283 869 0 11:49 ? 00:00:00 sshd: belstgut [priv]
belstgut 18294 18283 0 11:49 ? 00:00:00 sshd: belstgut#pts/0
belstgut 18295 18294 0 11:49 pts/0 00:00:03 -zsh
root 19303 18295 0 11:56 pts/0 00:00:00 sudo -s
root 19304 19303 0 11:56 pts/0 00:00:04 /usr/bin/zsh
root 24237 1 0 12:28 ? 00:00:00 /usr/sbin/xinetd -dontfork -pidfile /var/run/xinetd.pid -stayalive -inetd_compat -inetd_ipv6
root 24395 1 0 12:28 ? 00:00:00 /usr/lib/postfix/master
postfix 24398 24395 0 12:28 ? 00:00:00 pickup -l -t unix -u -c
postfix 24399 24395 0 12:28 ? 00:00:00 qmgr -l -t unix -u
root 25052 1 0 12:43 ? 00:00:00 nginx: master process /usr/sbin/nginx
www-data 25055 25052 0 12:43 ? 00:00:00 nginx: worker process
www-data 25056 25052 0 12:43 ? 00:00:00 nginx: worker process
www-data 25057 25052 0 12:43 ? 00:00:00 nginx: worker process
www-data 25058 25052 0 12:43 ? 00:00:00 nginx: worker process
root 28039 869 0 13:12 ? 00:00:00 sshd: unknown [priv]
sshd 28040 28039 0 13:12 ? 00:00:00 sshd: unknown [net]
root 28084 869 0 13:12 ? 00:00:00 sshd: [accepted]
sshd 28085 28084 0 13:12 ? 00:00:00 sshd: [net]
root 28086 869 0 13:12 ? 00:00:00 sshd: [accepted]
sshd 28087 28086 0 13:12 ? 00:00:00 sshd: [net]
root 28088 869 0 13:12 ? 00:00:00 sshd: [accepted]
sshd 28089 28088 0 13:12 ? 00:00:00 sshd: [net]
root 28126 19304 0 13:13 pts/0 00:00:00 ps -ef
hope someone can help me.

Resources