Netbook server notes

From razwiki
Revision as of 17:24, 26 October 2022 by Razzi (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

http://netbook.abuissa.net/test2.php 🙌

32 bit!

start-stop-daemon --background --start --exec /usr/bin/env -- /usr/bin/php-cgi -b 127.0.0.1:9000

[email protected]:~$ cat Public/test2.php
 <?php
 function display_command($command) {
         echo $command;
         echo "\n";
         echo shell_exec($command);
         echo "\n\n";
 }
 display_command("uptime");
 display_command("sensors");
 display_command("sudo hddtemp /dev/sda");
 ?>
 

/etc/nginx/sites-enabled/default

...
        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
                root /home/razzi/Public/;
        }

        # pass PHP scripts to FastCGI server
        #
        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                # include /etc/nginx/fastcgi_params;

                root /home/razzi/Public/;

                # With php-fpm (or other unix sockets):
                # fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
                # With php-cgi (or other tcp sockets):
                fastcgi_pass 127.0.0.1:9000;
        }

Stuff I installed

sudo apt install php7.2-cgi
sudo apt install nginx