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 […]

Read More

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 […]

Read More

.General PHP Code Tricks

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 […]

Read More

PHP/Apache

Installing PHP/Apache This is based on the nifty webiopi guide here. Install Apache and PHP sudo apt-get install apache2 php5 Add Apache's user (www-data) to the sudoers if needed This may be necessary if you want web pages to control IO pins etc. Note that by doing this you introduce the possibility of security vulnerabilities via […]

Read More