Mint LAMP Development Environment
OPERATING SYSTEM: Linux Mint 13 Maya
For Drupal development, since I already have a Linux Mint system setup, I decide to focus on it rather than the Windows 8 Acquia Drupal setup I blogged about a few days ago.
Apache, MySQL & PHP
Install all of these applications with a single command. Thanks to Unix System Engineer, Nitin Sookun for posting this on the Linux Mint Community website.
Since you will need root permissions when performing write operations outisde of your home directory, the commands shown below presume that you are logged in as root or are in a root instance of the terminal. If you are not in a root terminal, you can prepend the commands with ‘sudo’, for example listing the contents of the current directory:
sudo ls
In a root terminal (such as ‘Konsole as root’).
apt-get install lamp-server
If you get this error message (as I did during a Mint Xfce LAMP install)
E: Unable to locate package lamp-server
Then you will need a carat at the end:
apt-get install lamp-server^
Then install phpMyAdmin
apt-get install phpmyadmin
Restart Apache and try loading http://localhost/phpmyadmin.
/etc/init.d/apache2 restart
If phpMyAdmin doesn’t load, try adding an Include to your Apache config with a text editor (such as ‘Kate’). In your terminal, open a new bash shell tab, and launch the editor (gedit, kate, etc.)
kate /etc/apache2/apache2.conf
In the apache configuration file, near the bottom, look for the location of other Include statements and insert this phpmyadmin include as needed.
Include /etc/phpmyadmin/apache.conf
/etc/init.d/apache2 restart
mySQL
If you need to set or change the mySQL root password, use this command syntax when the password has not been set.
$ mysqladmin -u root password NEWPASSWORD
Use this command syntax to change the root password.
$ mysqladmin -u root -p'OLDPASSWORD' password 'NEWPASSWORD'
Drupal
Download the latest stable Drupal core distro from http://drupal.org/download. Extract the downloaded file, for example, drupal-7.19.tar.gz to the host root, /var/www. Then with the mv command, rename the drupal-7.19 directory extracted into www to drupal7
tar -xf drupal-7.19.tar.gz -C /var/www
mv /var/www/drupal-7.19 /var/www/drupal7
Copy the default.settings.php to settings.php. Then apply write permissions to both the dafault directory and the settings.php file so Drupal can modify settings.php as needed during the install.
cd /var/www/drupal7/sites
cp default/default.settings.php default/settings.php
chmod a+w default
chmod a+w default/settings.php
Note, after Drupal is installed, reset settings.php file permissions to read only using a-w
Virtual Hosts
Setting up some Virtual Hosts in our Apache config. In terminal, open the apache cofig file for editing (gedit, kate, etc.)
kate /etc/apache2/apache2.conf
Below the Files node, add this code block.
NameVirtualHost *:80
ServerName default
DocumentRoot /var/www/
ServerName drupal7
DocumentRoot /var/www/drupal7
ServerName drupal8
DocumentRoot /var/www/drupal8
Restart Apache to load our config changes
/etc/init.d/apache2 restart
Hosts file
Add the two named virtual hosts to the hosts
file
kate /etc/hosts
127.0.1.7 drupal7
127.0.1.8 drupal8
Restart apache …
/etc/init.d/apache2 restart
Now you can access the new Drupal website at http://drupal7
Next - Mint LAMP Development Environment – Part Two
Resources
- LAMP in one command
- Installing LAMP (Linux, Apache, MySQL and PHP) On Linux Mint
- Name-based Virtual Host Support
Part 1 of 2 in the Mint LAMP Development Environment series.