Install Apache2 PHP and Mysql on a Raspberry Pi

How to install a webserver on Raspberry Pi 2 running Raspbian (wheezy)

Full list of edits and installs to get my webserver up and running without mySQL.

Make sure everything is up to date, this takes about 60 seconds:

Code: Select all

sudo apt-get update

Code: Select all

sudo apt-get upgrade

Now I’m going to need apache webserver

Code: Select all

sudo apt-get install apache2 apache2-doc apache2-utils

Code: Select all

sudo apt-get install libapache2-mod-php5 php5 php-pear php5-xcache php5-mysql php5-curl php5-gd

And that’s apache webserver and PHP installed.
Test it with:

Code: Select all

<?php

// Show all information, defaults to INFO_ALL
phpinfo();

// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);

?>

Now I’ll need to install php_curl

Code: Select all

sudo apt-get install php-curl

then reboot apache:

Code: Select all

sudo service apache2 restart

Now make sure mod_rewrite is enabled:

Code: Select all

sudo a2enmod rewrite

Finally: Getting the .htaccess files working.

Code: Select all

sudo nano /etc/apache2/sites-available/default

Change None to all:

Code: Select all

 <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
 </Directory>

I don’t think I’ve missed any steps, but I will come back and edit later if need be.

Install MySQL

Start with:

Code: Select all

sudo bash

Code: Select all

sudo apt-get install php-mysql

– AND:

Code: Select all

sudo apt-get install mysql-server mysql-client

Install PHPMyAdmin

Code: Select all

sudo apt-get install phpmyadmin

Install Webmin:
http://www.webmin.com/deb.html

About The Bionic Cyclist

Do not go gentle into that good night,
Old age should burn and rave at close of day;
Rage, rage against the dying of the light.

This website.
View All Posts

Dylan Thomas, 1914 - 1953

Do not go gentle into that good night,
Old age should burn and rave at close of day;
Rage, rage against the dying of the light.

Though wise men at their end know dark is right,
Because their words had forked no lightning they
Do not go gentle into that good night.

Good men, the last wave by, crying how bright
Their frail deeds might have danced in a green bay,
Rage, rage against the dying of the light.

Wild men who caught and sang the sun in flight,
And learn, too late, they grieved it on its way,
Do not go gentle into that good night.

Grave men, near death, who see with blinding sight
Blind eyes could blaze like meteors and be gay,
Rage, rage against the dying of the light.

And you, my father, there on the sad height,
Curse, bless, me now with your fierce tears, I pray.
Do not go gentle into that good night.
Rage, rage against the dying of the light.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.