Step 3: Configuor php & Apache

Picture of Configuor php & Apache
Screen Shot 2012-10-27 at 16.18.07.png
Screen Shot 2012-10-27 at 16.18.32.png
Screen Shot 2012-10-27 at 16.18.53.png
Screen Shot 2012-10-27 at 16.19.49.png
Screen Shot 2012-10-27 at 16.20.49.png
Now we have download the software we need to configor it.

First off we need to install PHP apc

$ sudo pecl install apc
After that is done we need to create the apc.ini

$ sudo nano /etc/php5/cgi/conf.d/apc.ini

In to that file we need to add the following


Once added the file needs saving

Next up we have to change the PHP.ini to change the max upload file so we can add large file and add the APC externsion to PHP

$ sudo nano /etc/php5/apache2/php.ini

In this file we need to find upload_max_filesize and then change the value to 1024M which will allow files of upto 1GB to be uploaded

The we need to find post_max_size and then chaged the value to 1200m which will allow files to upto 1 gb to be uploaded

We need to find externsion= section and add in the extension=apc.so

After we have done that save and exit

next up we need to config apache and enable SSL

$ sudo nano /etc/apache2/sites-enabled/000-default

inside the file we need to change Allow over ride to All from none 

Next up we need to setup SSL

$ sudo a2enmod rewrite
$ sudo a2enmod headers

After the follow command you will be asked to provide information

sudo openssl genrsa -des3 -out server.key 1024; sudo openssl rsa -in server.key -out server.key.insecure;sudo openssl req -new -key server.key -out server.csr;sudo openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt;sudo cp server.crt /etc/ssl/certs;sudo cp server.key /etc/ssl/private;sudo a2enmod ssl;sudo a2ensite default-ssl

Once all that is done the apache need restarting

$ sudo service apache2 restart
BrianM106 months ago

externsion = section doesn't exist in the file. extension = section doesn't exist in the file.

colinkhalid10 months ago

My Install failed with

pi@raspberrypi ~ $ sudo pecl install apc

Package "apc" does not have REST info xml available

install failed

mbalfour111 months ago

I'm having trouble with $ sudo pecl install apc

i get: $ sudo: pecl: command not found

any help??

remove the $

These first few steps are just turning the pi into a web server. You can watch a more in-depth tutorial on youtube on how to set up an apache server on a pi. www.youtube.com/watch?v=WgcNBjIJNYs

    javl2 years ago
    It would be nice if you could explain some things a bit more, like:

    "In to that file we need to add the following

    What are these values? It is always good to know what it is you're doing, instead of just following the steps blindly.