Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
nginx help please [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
cwc
Veteran
Veteran


Joined: 20 Mar 2006
Posts: 1080
Location: Tri-Cities, WA USA

PostPosted: Wed May 07, 2014 2:50 am    Post subject: nginx help please [solved] Reply with quote

I've installed nginx on a Raspberry Pi and I like the way it works.

As for my Gentoo box I've run Apache from day 1 along with php. I would like to try nginx and I got 403 Forbidden nginx/1.4.7 right out of the box and a file get downloaded.

I changed the root to /home/user/html
Still no luck.

Any ideas?

I did add the following to /etc/portage/package.keywords/package.keywords.txt
www-servers/nginx ~x86 (or ~amd64, etc)

Here's my default nginx.conf

Code:



user nginx nginx;
worker_processes 1;

error_log /var/log/nginx/error_log info;

events {
   worker_connections 1024;
   use epoll;
}

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

   log_format main
      '$remote_addr - $remote_user [$time_local] '
      '"$request" $status $bytes_sent '
      '"$http_referer" "$http_user_agent" '
      '"$gzip_ratio"';

   client_header_timeout 10m;
   client_body_timeout 10m;
   send_timeout 10m;

   connection_pool_size 256;
   client_header_buffer_size 1k;
   large_client_header_buffers 4 2k;
   request_pool_size 4k;

   gzip on;
   gzip_min_length 1100;
   gzip_buffers 4 8k;
   gzip_types text/plain;

   output_buffers 1 32k;
   postpone_output 1460;

   sendfile on;
   tcp_nopush on;
   tcp_nodelay on;

   keepalive_timeout 75 20;

   ignore_invalid_headers on;

   index index.html;

   server {
      listen 127.0.0.1;
      server_name localhost;

      access_log /var/log/nginx/localhost.access_log main;
      error_log /var/log/nginx/localhost.error_log info;

      root /home/cwc/html;
   }

   # SSL example
   #server {
   #   listen 127.0.0.1:443;
   #   server_name localhost;

   #   ssl on;
   #   ssl_certificate /etc/ssl/nginx/nginx.pem;
   #   ssl_certificate_key /etc/ssl/nginx/nginx.key;

   #   access_log /var/log/nginx/localhost.ssl_access_log main;
   #   error_log /var/log/nginx/localhost.ssl_error_log info;

   #   root /var/www/localhost/htdocs;
   #}
}





error_log

Code:
2014/05/06 19:52:00 [notice] 25017#0: signal 15 (SIGTERM) received, exiting
2014/05/06 19:52:00 [notice] 25019#0: exiting
2014/05/06 19:52:00 [notice] 25019#0: exit
2014/05/06 19:52:00 [notice] 25017#0: signal 17 (SIGCHLD) received
2014/05/06 19:52:00 [notice] 25017#0: worker process 25019 exited with code 0
2014/05/06 19:52:00 [notice] 25017#0: exit
2014/05/06 19:52:00 [notice] 25112#0: using the "epoll" event method
2014/05/06 19:52:00 [notice] 25112#0: nginx/1.4.7
2014/05/06 19:52:00 [notice] 25112#0: OS: Linux 3.12.13-gentoo
2014/05/06 19:52:00 [notice] 25112#0: getrlimit(RLIMIT_NOFILE): 1024:4096
2014/05/06 19:52:00 [notice] 25113#0: start worker processes
2014/05/06 19:52:00 [notice] 25113#0: start worker process 25115

_________________
Without diversity there can be no evolution:)


Last edited by cwc on Fri May 09, 2014 11:09 am; edited 1 time in total
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 829

PostPosted: Wed May 07, 2014 11:00 pm    Post subject: Reply with quote

In the "server" section of your nginx.conf file, the "listen" parameter should be is a port number.

I also notice that you have nginx configured to serve up pages from the /home/cwc/html directory. Not sure if that is what you intend, but that is where nginx will look for the "index.html" home page.

This works for me ...

Code:
server {
   listen 80;
   server_name involute.curvate.net;
   access_log /var/www/log/nginx-localhost.access_log main;
   error_log /var/www/log/nginx-localhost.error_log info;
   root /var/www/localhost;
}
Back to top
View user's profile Send private message
cwc
Veteran
Veteran


Joined: 20 Mar 2006
Posts: 1080
Location: Tri-Cities, WA USA

PostPosted: Thu May 08, 2014 2:12 am    Post subject: Reply with quote

got *.html files to work now php does not work
I removed apache2 and tried to re-emerge php with errors

my php package.use text is:
dev-lang/php fpm pdo mysql mysqli -apache2 berkdb bzip2 cli crypt ctype exif fileinfo filter fpm gdbm hash iconv ipv6 json ldap mysql mysqli nls opcache pdo phar posix readline session simplexml spell sqlite ssl threads tokenizer truetype unicode xml zlib -apache2

error for emerge
Code:

emerge php
Calculating dependencies -

!!! Problem resolving dependencies for dev-lang/php
... done!

!!! The ebuild selected to satisfy "php" has unmet requirements.
- dev-lang/php-5.5.10::gentoo USE="berkdb bzip2 cli crypt ctype exif fileinfo filter fpm gdbm hash iconv ipv6 json ldap mysql mysqli nls opcache pdo phar posix readline session simplexml spell sqlite ssl threads tokenizer truetype unicode xml zlib -apache2 -bcmath -calendar -cdb -cgi -cjk -curl -debug -embed -enchant -firebird -flatfile (-frontbase) -ftp -gd -gmp -imap -inifile -intl -iodbc -kerberos -ldap-sasl -libedit -libmysqlclient -mhash -mssql -oci8-instant-client -odbc -pcntl -postgres -qdbm -recode (-selinux) -sharedmem -snmp -soap -sockets (-sybase-ct) -systemd -sysvipc -tidy -wddx -xmlreader -xmlrpc -xmlwriter -xpm -xslt -zip"

  The following REQUIRED_USE flag constraints are unsatisfied:
    truetype? ( gd ) exif? ( gd )

  The above constraints are a subset of the following complete expression:
    truetype? ( gd ) cjk? ( gd ) exif? ( gd ) xpm? ( gd ) gd? ( zlib ) simplexml? ( xml ) soap? ( xml ) wddx? ( xml ) xmlrpc? ( any-of ( xml iconv ) ) xmlreader? ( xml ) xslt? ( xml ) ldap-sasl? ( ldap ) mhash? ( hash ) phar? ( hash ) libmysqlclient? ( any-of ( mysql mysqli pdo ) ) qdbm? ( !gdbm ) readline? ( !libedit ) recode? ( !imap !mysql !mysqli ) sharedmem? ( !threads ) !cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )






nginx.conf

Code:

        server {
                 listen 80;
                server_name localhost azzerare;

                access_log /var/log/nginx/localhost.access_log main;
                error_log /var/log/nginx/localhost.error_log info;

                root /home/cwc/html;

                location ~ \.php$ {
                       # Test for non-existent scripts or throw a 404 error
                       # Without this line, nginx will blindly send any request ending in .php to php-fpm
                       try_files $uri =404;
                       include /etc/nginx/fastcgi.conf;
                       fastcgi_pass unix:/run/php-fpm.socket;

                }
        }




_________________
Without diversity there can be no evolution:)
Back to top
View user's profile Send private message
cwc
Veteran
Veteran


Joined: 20 Mar 2006
Posts: 1080
Location: Tri-Cities, WA USA

PostPosted: Thu May 08, 2014 2:20 am    Post subject: Reply with quote

502 Bad Gateway

nginx/1.4.7

I get the above error when I hit the test.php page.

php is broken.
_________________
Without diversity there can be no evolution:)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum