Issuing Commands From Web Pages If you install a PHP web server on your RPi you can issue commands using the PHP system() function. Examples: //Echo some system status: echo '<pre>'; system('netstat -a'); echo '</pre>'; //Run an executable file: echo '<pre>'; system("sudo /home/pi/projects/my_project.a"); //system() will echo the output of the executable, use shell_exec() instead if […]
Category: Web Servers
MySQL
Installing MySQL If you want MySQL also do the following: sudo apt-get install mysql-server sudo apt-get install php5-mysql The php5-mysql install adds the mysql libraries to allow PHP to access the mysql database. Accessing MySQL from the command line First connect to the database and specify a user: mysql -p -u root Then enter […]
PHP/Apache
Installing PHP/Apache See our page here, works with Raspberry Pi OS too Adding Your HTML, PHP etc Files Copy them into the “/var/www/html/” directory. You will need root permission to write to this directory, so if you are using the GUI file manager use “sudo su” to elevate yourself to the root user before starting the […]
vsftpd-FTP Server
vsftpd is a faste and secure FTP server for UNIX-like systems Installing vsftpd In order to allow the transfer of files between your Mac and your Raspberry Pi, you'll need to set up an FTP connection. To do so, Enter this command to allow you to take full control of the web server's root directory (this assumes you've already […]