1

adjusting nginx files for Wialon Local

Тема: adjusting nginx files for Wialon Local

Hello
I used a Server Wialon Local.
I have a problem in adjusting nginx files, when you change the settings. After the restart nginx, back as it was.
How can I save the settings from loss.
Thank you

2

adjusting nginx files for Wialon Local

Re: adjusting nginx files for Wialon Local

Hello har225,
There is no reason to change file local.conf  because it is generated by wlocal service.
What adjustment do you want to add and where?

Евгений
WDC Administrator
Gurtam
3

adjusting nginx files for Wialon Local

Re: adjusting nginx files for Wialon Local

Thank you for your response
I want to run scripts php, on the home page.

4

adjusting nginx files for Wialon Local

Re: adjusting nginx files for Wialon Local

Default installation of wialon local doesn't  include any php module.
So if you want to run php scripts on the same server do the following:

+ открыть спойлер

apt-get update
apt-get upgrade
apt-get install php5-fpm

----------------------------------------------
nano /etc/php5/fpm/php.ini

+ открыть спойлер

cgi.fix_pathinfo=0

--------------------------------------------------------

nano /etc/php5/fpm/pool.d/www.conf

+ открыть спойлер

listen = /var/run/php5-fpm.sock

-----------------------------------------------------------

+ открыть спойлер

service php5-fpm restart

------------------------------------------------------------

nano /etc/nginx/conf.d/php.conf

+ открыть спойлер

server {
        listen   80;


        root /usr/share/nginx/html;
        index index.php index.html index.htm;

        server_name php.lo;

        location / {
                try_files $uri $uri/ /index.html;
        }

        error_page 404 /404.html;

        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
              root /usr/share/nginx/html;
        }

        # pass the PHP scripts to FastCGI server listening on the php-fpm socket
        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params.dpkg-dist;

        }

}

---------------------------------------------------------------

+ открыть спойлер

nginx -t
service nginx restart

------------------------------------------------------------

cat /etc/nginx/fastcgi_params.dpkg-dist

+ открыть спойлер

fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;

fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;
fastcgi_param  HTTPS              $https if_not_empty;

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param  REDIRECT_STATUS    200;

----------------------------------------------------------------------------

nano /usr/share/nginx/html/info.php

+ открыть спойлер

<?php
phpinfo();
?>

--------------------------------------

Then check your php page

+ открыть спойлер

.adjusting nginx files for Wialon Local

Евгений
WDC Administrator
Gurtam
5

adjusting nginx files for Wialon Local

Re: adjusting nginx files for Wialon Local

Hello
Thank you for your attention, now it is working.