Sie sind auf Seite 1von 2

Installing PHP/Apache

This is based on the nifty webiopi guide here.


Install Apache and PHP
sudo apt-get install apache2 php5
Setup the rewrite module and configuration overriding (.htaccess)
sudo a2enmod rewrite
sudo nano /etc/apache2/sites-enabled/000-default
Find the <Directory /var/www/> section and change the line "AllowOverride None"
to "AllowOverride All", so it looks like this:
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
Press CTRL + X to save and exit.
Add Apache's user (www-data) to the sudoers:
sudo visudo
Add this line to the end of the file:
www-data ALL=(ALL) NOPASSWD: ALL
Press CTRL + X to save and exit.
Restart Apache
sudo /etc/init.d/apache2 restart
If you type your Raspberry Pi IP address into the web browser on a machine conne
cted to the network you should see the apache default web page appear.
Adding Your HTML, PHP etc Files
Copy them into the "/var/www/" directory.
You will need root permission to write to this directory, so if you are using th
e GUI file manager use "sudo su" to elevate yourself to the root user before sta
rting the GUI with "startx"
Restarting Apache
sudo service apache2 restart
Change The Password!
If your RPi will be connected to the internet or a public network a priority is
to make the Raspberry Pi more secure by not using the default username and passw
ord. To change the password for the pi user after logging in:
passwd
Performance Tuning
If you are not using the HDMI out it is sensible to reduce the amount memory giv
en to the RPi graphics to say 16MB using the config tool:
sudo raspi-config

Das könnte Ihnen auch gefallen