Skip to content

Instantly share code, notes, and snippets.

@nhufinney
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nhufinney/446dc59e4e3594ceadf9 to your computer and use it in GitHub Desktop.
Save nhufinney/446dc59e4e3594ceadf9 to your computer and use it in GitHub Desktop.

##HOW TO: Setup XAMPP and Drupal on Ubuntu

In this gist, I will walk you throughthe steps I took to get my personal machine ready to develop with Drupal for the 2015 Epicodus PHP Course Curriculum

###Prerequisites:

  1. A Computer - If you don't have one, how the...what?! face palm
  2. Ubuntu - The OS

###Step 1 - Install and Setup XAMPP
  1. Open Terminal (Ctrl+Alt+T) and change directories to Desktop:
cd ~/Desktop
  1. Now we need to download XAMPP. Note that we are downloading the 64-bit version. For the 32-bit version, remove "-x64" from the line below. In terminal, type the following:
wget http://sourceforge.net/projects/xampp/files/XAMPP%20Linux/5.6.8/xampp-linux-x64-5.6.8-0-installer.run
  1. After that, we need to change the package installer into an executable so we can run it:
sudo chmod +x xampp-linux-x64-5.6.8-0-installer.run
  1. Finally, we run the installer:
sudo ./xampp-linux-x64-5.6.8-0-installer.run
  1. Follow the on-screen instructions and check the box at the end of the install that says Launch XAMPP to check that everything installed correctly. If the page doesn't automatically open, go into your browser and type into the URL Address bar: http://localhost/xampp -- If you see a screen that says Welcome to XAMPP, then congrats! You completed Step 1!

PRO TIPS:

  • To stop XAMPP Service, type this in the console:
sudo /opt/lampp/lampp stop
  • To start XAMPP Service, type this in the console:
sudo /opt/lampp/lampp start
  • To start XAMPP automatically when you boot up your system, type this and add "/opt/lampp/lampp start" to the second to last line of the document:
sudo nano /etc/rc.local
#! /bin/ bash
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure que the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/opt/lampp/lampp start
exit 0

###Step 2 - Create the Drupal Database

  1. In your browser, navigate to http://localhost/xampp and click on phpMyAdmin in the left navigation column under Tools

  2. Now that you're in phpMyAdmin, click on New in the left navigation column. Then in the main window, enter a database name, choose utf8-general-ci in the Collation dropdown, and click the Create button

  3. Once created, click on the Privileges tab, then click on Add a user. From here we enter a name for the user, select Local from the 2nd row dropdown, enter a password, and re-enter it. Finally, check the box that says Check All next to Global Privileges, then click the Go button. That'll be it in phpMyAdmin, for now...

###Step 3 - Install Drupal

  1. Decide. You can choose to follow along with the Epicodus method here, or follow me down the rabbit hole...

  2. Make sure you're still in the Desktop directory, then in console type:

wget https://www.drupal.org/files/projects/drupal-7.36.tar.gz
  1. Now, extract it:
tar -zxvf drupal-7.36.tar.gz
  1. Make a project directory (name it whatever you'd like) and copy Drupal into project directory:
mkdir /opt/lampp/htdocs/myProjectName
sudo cp -r drupal-7.36/* /opt/lampp/htdocs/myProjectName
  1. Next, in the sites/default directory of drupal, copy the default.settings.php file and rename it to settings.php:
cd /opt/lampp/htdocs/myProjectName
sudo cp sites/default/default.settings.php sites/default/settings.php
  1. Now, lets give the server write privileges to the sites/default directory:
chmod -R a+w sites/default
  1. Point your browser to http://localhost/myProjectName and walk through the Drupal Installation Process. Then...BAM! You're on Easy Street, kid. Nice work!

In another Gist, I will walk you through an alternate way of installing and developing with Drupal without XAMPP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment