[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howtos:hardware:arm:nginx [2020/03/05 08:15 (UTC)] – [Notes] updated testing period notes exagahowtos:hardware:arm:nginx [2020/03/05 12:03 (UTC)] (current) – [Configuring nginx to run on Slackware ARM] added code 'default_server;' exaga
Line 12: Line 12:
 This page will hopefully allow you how run nginx on Slackware ARM successfully, from scratch. There's no reason what-so-ever that the same procedure(s) shouldn't work on Slackware x86_64 [or Slackware ARM 14.2], but for the purpose of testing it has been carried out under Slackware ARM -current [23 February - 05 March 2020].  This page will hopefully allow you how run nginx on Slackware ARM successfully, from scratch. There's no reason what-so-ever that the same procedure(s) shouldn't work on Slackware x86_64 [or Slackware ARM 14.2], but for the purpose of testing it has been carried out under Slackware ARM -current [23 February - 05 March 2020]. 
  
-Slackware ARM -current was running [kernel 5.4.21] on a Raspberry Pi 4 and used to build the package, install and configure nginx. Any ARM device running Slackware may be used for this purpose. The -current (development) version was chosen as it includes the latest software, etc.+Slackware ARM -current was running [kernel 5.4.22] on a Raspberry Pi 4 and used to build the package, install and configure nginx. Any ARM device running Slackware may be used for this purpose. The -current (development) version was chosen as it includes the latest software, etc.
  
 ==== Requirements ==== ==== Requirements ====
Line 81: Line 81:
 <code> <code>
 ~# time ./nginx.SlackBuild ~# time ./nginx.SlackBuild
 +</code>
 +
 +Alternatively, if you plan on using Maxmind's GeoIP database with 'nginx' then GeoIP support is available as an option. All that's required is the GeoIP package to have been installed first. If you wish to enable GeoIP support in 'nginx' then pass the GEOIP variable to the slackbuild command, like this:
 +
 +<code>
 +~# time GEOIP=yes ./nginx.SlackBuild
 </code> </code>
  
 After a few short minutes, you should see the resulting package in your '/tmp' directory. [NB: if you didn't modify the '${PKGTYPE:-tgz}' variable then the file extension will be '*.tgz' instead of '*.txz'.] Check it like this: After a few short minutes, you should see the resulting package in your '/tmp' directory. [NB: if you didn't modify the '${PKGTYPE:-tgz}' variable then the file extension will be '*.tgz' instead of '*.txz'.] Check it like this:
 +
 +<note>Q. Why do we use 'time' in combination with running the build script? \\
 +A. We like to know how long the process takes. That's all. You don't have to include it in order to be successful.</note>
  
 <code> <code>
Line 204: Line 213:
  
     server {     server {
-        listen       80;+        listen       80 default_server;
         server_name  127.0.0.1 localhost;         server_name  127.0.0.1 localhost;
  
Line 264: Line 273:
 </code> </code>
  
-By default 'php-fpm' does not log anything other than startup and shutdown [see: '/var/log/php-fpm.log']. In order to log any relevant error messages we need to make one more change to the file. Find the 'catch_workers_output" section below and uncomment the setting, like this:+By default 'php-fpm' does not log anything other than startup and shutdown [see: '/var/log/php-fpm.log' after the daemon has been (re)started]. In order to log any relevant error messages we need to make one more change to the file. Find the 'catch_workers_output" section below and uncomment the setting, like this:
  
 <code> <code>
Line 421: Line 430:
 </code> </code>
  
-Bercause we want to use 'test.local' and 'extra.local' as domain [server_name] names we will add the following to our '/etc/hosts' file:+Because we want to use 'test.local' and 'extra.local' as domain name [server_name] aliases we will add the following to our '/etc/hosts' file:
  
 <code> <code>
Line 433: Line 442:
 </code> </code>
  
-The above settings will take effect as soon as the file is saved. However, there's nothing to "seeyet because we haven'cteated it! :-)+The above settings will take effect as soon as the file is saved. However, there's nothing there to see yet because we haven'created it! :-)
  
 So, then we create and edit the 'test.local.conf' file: So, then we create and edit the 'test.local.conf' file:
Line 441: Line 450:
 </code> </code>
  
-In this file we need to instruct 'nginx' which server requests it should listen for on a specific port. We also specify the path/to/the web directory files where this site will be located. So we'll enter the following text into this file:+In this file we need to instruct 'nginx' which server requests it should listen for on a specific port. We need to specify the path/to/the web directory files where this site will be located and we'll also configure the FastCGI server. So we'll enter the following text into this file:
  
 <code> <code>
Line 450: Line 459:
     # this root path is to the webdir     # this root path is to the webdir
     root /var/www/test.local;     root /var/www/test.local;
 +    
 +    # index pages to load in this order
 +    index index.php index.html index.htm;
  
     #This will be needed for GoAccess ** make sure vcombined map is defined in nginx.conf     #This will be needed for GoAccess ** make sure vcombined map is defined in nginx.conf
     access_log /var/log/nginx/access.log vcombined;     access_log /var/log/nginx/access.log vcombined;
 +
 +    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
 +    #
 +    location ~ \.php$ {
 +       root           /var/www/test.local;
 +       fastcgi_pass   127.0.0.1:9000;
 +       fastcgi_index  index.php;
 +       fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
 +       include        fastcgi_params;
 +    }
  
 } }
Line 468: Line 490:
     # this root path is to the webdir     # this root path is to the webdir
     root /var/www/extra.local;     root /var/www/extra.local;
 +
 +    # index pages to load in this order
 +    index index.php index.html index.htm;
  
     #This will be needed for GoAccess ** make sure vcombined map is defined in nginx.conf     #This will be needed for GoAccess ** make sure vcombined map is defined in nginx.conf
     access_log /var/log/nginx/access.log vcombined;     access_log /var/log/nginx/access.log vcombined;
 +
 +    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
 +    #
 +    location ~ \.php$ {
 +       root           /var/www/extra.local;
 +       fastcgi_pass   127.0.0.1:9000;
 +       fastcgi_index  index.php;
 +       fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
 +       include        fastcgi_params;
 +    }
  
 } }
Line 494: Line 529:
 </code> </code>
  
-When all that's complete, the final task is to test the 'nginx' confiruation and restart the daemon.+When all that's complete, the final task is to test the 'nginx' configuration and restart the daemon.
  
 <code> <code>
 howtos:hardware:arm:nginx ()