DeVito
Posts: 2
Joined: Fri Nov 15, 2013 3:11 pm

start nginx failed

Fri Nov 15, 2013 3:33 pm

hi all.
i failed to get nginx working on my raspberry pi (model b) running on pidora 18 r2c.
everything i've done was to set up a fresh pidora via 'dd if=pidora-18-r2c.img of=/dev/mmcblk0 bs=4M', running the firstboot wizard and install nginx as root user via 'yum install nginx' shell command.
afterwards if i try to start nginx as root user ('systemctl enable nginx' and 'systemctl start nginx') an error 'Job for nginx.service failed. ...' returns.
'journalctl -n' prints the following:

Code: Select all

[root@raspi ~]# journalctl -n
-- Logs begin at Wed, 1969-12-31 19:00:02 EST, end at Fri, 2013-11-15 08:25:39 EST. --
Nov 15 07:48:20 raspi.local pkexec[1132]: root: Executing command [USER=root] [TTY=/dev/pts/1] [CWD=/root] [COMMAND=/usr/share/system-config-users/system-config-users.py]
Nov 15 07:58:29 raspi.local systemd[1]: Reloading.
Nov 15 07:58:43 raspi.local systemd[1]: Starting The nginx HTTP and reverse proxy server...
Nov 15 07:58:43 raspi.local systemd[1]: nginx.service: control process exited, code=killed status=4
Nov 15 07:58:43 raspi.local systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
Nov 15 07:58:43 raspi.local systemd[1]: Unit nginx.service entered failed state
Nov 15 08:25:38 raspi.local systemd[1]: Starting The nginx HTTP and reverse proxy server...
Nov 15 08:25:39 raspi.local systemd[1]: nginx.service: control process exited, code=killed status=4
Nov 15 08:25:39 raspi.local systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
Nov 15 08:25:39 raspi.local systemd[1]: Unit nginx.service entered failed state
is there anybody out there who has the same problem and/or experiences related to this problem and/or a solution?

thank you,
DeVito

rafdune
Posts: 1
Joined: Thu Sep 19, 2013 7:29 pm

Re: start nginx failed

Thu Nov 28, 2013 9:12 pm

I have the same problem. And no log file found...

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: start nginx failed

Thu Nov 28, 2013 11:49 pm

What's in /etc/nginx/nginx.conf?

I'm running it on Raspbian but the basic principles should be the same.

My nginx.conf file has

Code: Select all

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;
to define where the logs get written.

If you can find your nginx.conf you can check for those (or "grep -R -e 'error_' *" in the config directory).

If you can't find the nginx.conf try overriding it by running nginx from a root shell (sudo -i nginx -c /root/temp.nginx.conf).
Or try nginx -V and it announces

Code: Select all

root@pi /etc/nginx # nginx -V
nginx version: nginx/1.2.1
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-log-path=/var/log/nginx/access.log --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --with-pcre-jit --with-debug --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_realip_module --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_xslt_module --with-ipv6 --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl --with-mail --with-mail_ssl_module --add-module=/build/nginx-L115aP/nginx-1.2.1/debian/modules/nginx-auth-pam --add-module=/build/nginx-L115aP/nginx-1.2.1/debian/modules/nginx-echo --add-module=/build/nginx-L115aP/nginx-1.2.1/debian/modules/nginx-upstream-fair --add-module=/build/nginx-L115aP/nginx-1.2.1/debian/modules/nginx-dav-ext-module
root@pi /etc/nginx #
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

DeVito
Posts: 2
Joined: Fri Nov 15, 2013 3:11 pm

Re: start nginx failed

Fri Nov 29, 2013 8:32 pm

Hi.

@rafdune:
What a relief! Because this means i'm not the only one.
But nevertheless meanwhile i switched to Arch Linux.

@DougieLawson:
Thank you for your reply.
But i tried both of your tips unsuccessfully right before my first post; sorry that i forget to give this information.
Activate "access_log" and "error_log" was ineffective as well as starting nginx via shell as root user wasn't possible.
But experimentally i build nginx on pidora from the last stable sources ... and the resulting binary was executable!
So i think related to nginx there is some crap in the pidora repository ;)

DeVito

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: start nginx failed

Fri Nov 29, 2013 9:00 pm

If you build it from source without setting any parms the executable module goes in /usr/local/bin and all the other stuff is dotted around the /usr/local directories (like /usr/local/etc).

I made a symlink from /etc/nginx/nginx.conf to /usr/local/etc/nginx.conf so any version would use the same config file.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Pidora / Fedora”