nginx-1.4.4.2

Problems with packages? Post here, using [tags] of the package name.

nginx-1.4.4.2

Postby ArmMuscles » Tue Jan 07, 2014 8:18 am

I have nginx and php-fpm and php installed on my device. I'm trying to configure nginx to work correctly. I've read viewtopic.php?t=5024 and https://wiki.archlinux.org/index.php/nginx and I still have problems.

Essentially, nginx will correctly return index.php with phpinfo() output in it. However, if I have an exact copy of the file, but name it test.php, I get served up a text file with <?php phpinfo(); ?> in it.

So something's going on with nginx where it's not recognizing anything but $root/index.php as a PHP file to invoke PHP for.

What might be the problem?

Here's nginx.conf:

$this->bbcode_second_pass_code('', '#user http;
worker_processes 1;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;


events {
worker_connections 1024;
}


http {
include mime.types;
default_type application/octet-stream;

#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';

#access_log logs/access.log main;

sendfile on;

keepalive_timeout 15;

gzip on;
gzip_comp_level 1;

server {

listen 80;
server_name localhost;

location ~ \.php {
root /srv/http;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

location / {
root /srv/http;
index index.php;
try_files $uri $uri/ /index.php;
}
}
}
')
ArmMuscles
 
Posts: 5
Joined: Mon Nov 25, 2013 9:21 pm

Re: nginx-1.4.4.2

Postby moonman » Tue Jan 07, 2014 9:47 am

Can't really help you here as I don't use nginx, but give lighttpd a shot. It is light and seems more straightforward to setup.
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: nginx-1.4.4.2

Postby ArmMuscles » Tue Jan 07, 2014 3:09 pm

Thanks, but I'm going for as little CPU usage as possible. Abandoned Apache because it takes Apache a minute to serve up a lot of owncloud pages. I got Lighttpd working once, and it took maybe 10 seconds. Nginx uses less CPU based on some articles I've read, and CPU is the bottleneck for the owncloud usage based on my observations running top.

Plus I read a discussion saying that Lighttpd cannot handle files above a certain size when submitting via POST or downloading or something, I forget which.
ArmMuscles
 
Posts: 5
Joined: Mon Nov 25, 2013 9:21 pm

Re: nginx-1.4.4.2

Postby grayman4hire » Wed Jan 08, 2014 3:41 am

Have you checked out the tutorial in my signature for setting up owncloud on the Pogoplug with nginx? It's been a while, so I can't guarantee that it still work.
grayman4hire
 
Posts: 350
Joined: Sat Sep 29, 2012 12:03 am
Location: SF, CA

Re: nginx-1.4.4.2

Postby moonman » Wed Jan 08, 2014 9:43 am

lighttpd is as light or lighter as nginx. The main cpu hog for ownclod is php, not the server itself (not talkin about apache here, as it is very heavy). Regardless of which server you choose, to speed up php enable apcu and opcache. opcache is built in, but you need to enable it in php.ini. apcu is php-apcu package - needs to be uncommented in php ini.

Also consider the versions the articles you read considered. Both servers are the latest versions in the repo with likely all the bugs you read about foxed
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: nginx-1.4.4.2

Postby 188pilas » Fri Jan 24, 2014 6:42 am

@ moonman...thanks for the tip! I was looking at my php.ini and I do not see the option to uncomment for apcu. running latest version of php. thanks!
188pilas
 
Posts: 2
Joined: Fri Jan 24, 2014 6:38 am

Re: nginx-1.4.4.2

Postby moonman » Fri Jan 24, 2014 9:58 pm

It is under /etc/php/conf.d/apcu.ini, or you can just add extension=apcu.so to php.ini
To enable opcache you need to add "zend_extension=/usr/lib/php/modules/opcache.so" to php.ini
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: nginx-1.4.4.2

Postby 188pilas » Sat Jan 25, 2014 2:02 am

@ moonman...thanks!
188pilas
 
Posts: 2
Joined: Fri Jan 24, 2014 6:38 am


Return to Packages

Who is online

Users browsing this forum: No registered users and 12 guests