Install Drupal on a LAMP Server

Drupal is one of the most popular of all the Content Management Systems (CMS). Drupal can power: Community portals, discussion forums, corporate sites, personal sites, blogs, e-commerce, and more. Drupal is open source (released under the GPL) and the only real installation restriction is that of the database. Drupal must use either a MySQL or a PosgreSQL database to connect to.

One of the simplest installation is on a LAMP (Linux Apache MySQL PHP) server. Before you go on, however, I will highly suggest you install PhpMyAdmin so the database creation is simple. For more information take a look at my Install PhpMyAdmin for easy MySQL Administration article. Once you have PhpMyAdmin installed you will want to create a database for your installation. You can name the database whatever you want, just make sure you remember the name. With your LAMP server up and running you have the most difficult aspect of the installation out of the way. All that is left is the actual installation of Drupal.

Your first step is to download the latest release of Drupal from the Drupal download page. Once you have that file downloaded move it to your web servers' document root. You will need root access to undertake these steps so you will with suto root or use sudo.

Unpack the Drupal file. This will most likely be done with the tar xvzf drupal-XXX.tar.gz command (Where XXX is the actual realease number). This will create a new directory called drupal-XXX (Where XXX is the release number). Now, I always change the name of this directory for simplicity. I will either rename this directory to main or something easy to remember. You can also move the entire contents of the directory into the document root. The only issue this can cause is if you are installing multiple sites on the same server. For that reason I tend to keep the Drupal install in its very own directory.

Once you have this file unpacked and the directory renamed, the fun begins. Fire up your browser and point it to http://path/to/installation/ (Where path/to/installation is the entire path to the Drupal installation. For example http://192.168.1.10/main/.) This will automatically start up the installation process.

Step 1

Step 1

The first step in the installation is to select your language. The default will be English. If you need to install Drupal in another language select the obvious link. Once you click the appropriate link you will be taken to the next step.

Step 2

Step 2

Step 2 requires that you change the name of the default.settings.php to settings.php. This file will be found in the /var/www/html/main/sites/default/ directory (This will depend upon your installation of course.) You also need to change the permissions of this file so it is writable by the web server. You can do this with the command chmod g+w settings.php. One last step is to create the directory sites/default/files with the command (from within your web servers' document root) mkdir sites/default/files. You may get another error when you click try again. If you do this is a permissions error. Enter the command chmod -R g+w sites/default/files which should solve the problem.

Step 3

Step 3

Now it is time to set up your database. Remember the database you created with PhpMyAdmin? This is where that information goes.



Once you fill out this information click Save and Continue to move on. You're almost done.

Step 4

Step 4

Just a couple more steps. Now you can remove write permissions on the settings.php file (chmod o-w settings.php) and enter the configuration information for your site. The information you need to provide is self explanitory. Once you have finished save the information and you're done. You will be greeted with the "Installation Complete" page!

Installation Complete

Installation Complete

Final Thoughts

Read also:  Installing Linux Mint 18.1 Serena MATE Edition 64bit

You can now log in with your administrator name (you will have created that in the site configuration page above) and start building your site. Drupal is an outstanding Content Management System you will quickly come to depend upon for many of your website rollouts.

Please share this article

Facebooktwittergoogle_plusredditlinkedinmail



Responses to Install Drupal on a LAMP Server

  1. RogueSpear February 10, 2009 at 3:38 am #

    I've been programming, in varying degrees of complexity and with various languages, since about 1982. I'm not expert by any means, but not too shabby either. However, PHP and advanced Drupal development just seems to be outside of my grasp. I've been trying to get well acquainted with the proverbial LAMP stack for about a year now and it seems like an awful lot of technologies to get familiar with.

    If this is something that you can become really good at, I think there is just about an endless amount of opportunities for you to choose from and most of them being quite lucrative. Drupal, from what I have seen done with it, is one of the most powerful and versatile CMS systems out there.

  2. Mlm Information February 10, 2009 at 3:46 am #

    Thanks for the tutorial, helpfull steps

  3. Mohanraj Thangarasu January 5, 2010 at 7:33 am #

    Good info on installing drupal.

    You may also check out my tutorial on drupal installation in shared hosting server

    http://www.drupaltricks.com/how-install-drupal-shared-hosting-server

Leave a Reply