Apache, MySQL & PHP on Ubuntu
Lately I've been performing lots of fresh system installs, a result of testing my Ubuntu respin. Restoring my personal data after such an install is simple enough, but having to reinstall my Apache, MySQL & PHP set-up requires a little more effort. So, for future reference I've decided to record the process. By following the instructions below I should be able to get my development server up and running within minutes.
AMP install instructions
1. Open a terminal and issue the following command to install the three main packages:
sudo apt-get install apache2 mysql-server php5
This will install the following packages:
apache2 apache2-mpm-prefork apache2-utils apache2.2-common libapache2-mod-php5
libapr1 libaprutil1 libdbd-mysql-perl libdbi-perl libmysqlclient15off libnet-daemon-perl libplrpc-perl libpq5 mysql-client-5.0 mysql-common mysql-server mysql-server-5.0
php5 php5-common
2. Get some additional packages:
sudo apt-get install php-pear php5-gd php5-mysql php5-imagick phpmyadmin
This will install:
libgd2-xpm libmcrypt4 libt1-5 php-pear php5-cli php5-gd php5-imagick php5-mcrypt
php5-mysql phpmyadmin
3. Enable URL rewriting:
sudo a2enmod rewrite
gksudo gedit /etc/apache2/sites-available/default
Edit line 12 to read, "AllowOverride All". Save and exit.
4. Create a symbolic link to my working directory:
sudo ln -s /home/username/htdocs /var/www/htdocs
5. Finally, restart Apache:
sudo /etc/init.d/apache2 restart
Add Your Comment
Use the form below to add your comment. Markdown syntax is available. Note, comments are moderated by me for spam filtering. Alternatively, feel free to contact me privately.