Netbook server notes: Difference between revisions

From razwiki
Jump to navigation Jump to search
(Created page with "32 bit! <pre> start-stop-daemon --background --start --exec /usr/bin/env -- /usr/bin/php-cgi -b 127.0.0.1:9000 razzi@YusefsComp:~$ cat Public/test2.php <pre> <?php function d...")
 
No edit summary
Line 1: Line 1:
32 bit!
32 bit!
<pre>
start-stop-daemon --background --start --exec /usr/bin/env -- /usr/bin/php-cgi -b 127.0.0.1:9000


<code>start-stop-daemon --background --start --exec /usr/bin/env -- /usr/bin/php-cgi -b 127.0.0.1:9000</code>
razzi@YusefsComp:~$ cat Public/test2.php

<pre>
razzi@YusefsComp:~$ cat Public/test2.php
<?php
<pre>
function display_command($command) {
<?php
echo $command;
function display_command($command) {
echo "\n";
echo shell_exec($command);
echo $command;
echo "\n\n";
echo "\n";
echo shell_exec($command);
}
echo "\n\n";
display_command("uptime");
}
display_command("sensors");
display_command("sudo hddtemp /dev/sda");
display_command("uptime");
display_command("sensors");
?>
display_command("sudo hddtemp /dev/sda");
</pre>
?>
</pre>


/etc/nginx/sites-enabled/default
/etc/nginx/sites-enabled/default
<pre>

...
...
location / {
location / {
Line 41: Line 41:
fastcgi_pass 127.0.0.1:9000;
fastcgi_pass 127.0.0.1:9000;
}
}
</pre>


Stuff I installed
Stuff I installed
<pre>

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

Revision as of 17:22, 26 October 2022

32 bit!

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

razzi@YusefsComp:~$ 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