As a web developer, I've come across many different types of Content Management Systems (CMS for short). CMS is a web application that allows web publishers to easily manage their contents without the need to know how to code. It is the job of a web developer to make this possible for non-technical companies to have a professional looking website in order to gain more business.
In the past, I've used Yacs, Wordpress, and tried other CMS recommended by others from CMS Matrix. Then I came across Drupal, which I pitch as a CMS builder of CMSs. It can be used to make simple sites even simpler and complex ones like social networking sites even more robust, sophisticated, user-friendly and feature packed. All it needs are web developers who have the imagination and creativity to create something out of small bits of modules and combine them together.
In this article, I present to you a tutorial on how to set up Drupal in a Shared Server environment. Meaning it's for those web developers who don't have access to the Linux command line. I also prefer making a multisite installation using subdomains instead of subdirectories. The set up is similar for both, but it can get annoying to have to change paths when making a site live in subdirectories. This tutorial is for beginners in Drupal, but must have some knowledge in XHTML, CSS, PHP and MySQL. Tutorials for theming and modules will be discussed in later posts.
- Download Drupal and extract it using Winzip or Winrar.
- Rename the folder to drupal and upload the entire folder using an FTP client (recommend Filezilla). Or, if available, without extracting yet, you can upload the tar file directly to your server and extract it using the cPanel's File Manager.
- Once the drupal directory is on the server, you want to create a symlink of your new site to that drupal directory for a multisite installation. We want drupal to be in its own directory instead of the root in case you want to have additional applications in the future. Lessen the confusion of which files belong to which software. Since you do not have access to the Linux command line, use PHP function symlink:
<php $target = '/home//public_html/drupal'; // root directory to drupal $link = ''; // use lowercase letters symlink($target, $link); echo readlink($link); // will return path to the newly created directory if success or error if failed. ?>
If you mess up, you can delete the symlink using:
<php $link = ''; unlink($link); ?>
Never delete symlinks straight from Filezilla because this will delete the entire drupal directory. Meaning if you have other sites already set up in drupal, all your hard work will be gone.
- Make sure that the symlink works by clicking on it in Filezilla and it should redirect you to the drupal directory.
- Now you want to create a subdomain for your new site in cPanel and point it to the symlink you just created. As long as the subdomain and symlink directory have the same name, it should automatically find the path.
- Set up a database for your new site and have your username, password and databasename handy.
- Go back to Filezilla and visit drupal/sites/default and rename the default.settings.php to settings.php.
- In drupal/sites directory, create a new directory called <sitename>.examples.com . Then inside this directory, create a new folder called files and give it 777 permission. And another folder called themes (theming tutorial will be explained on another article). Copy and paste settings.php to the <sitename>.examples.com directory and give it 777 permission.
- Use a browser (preferably Firefox or Chrome), visit <sitename>.examples.com and follow the Drupal installation process. Input the database info and create an admin username and password that only you should have access to.
- Once Drupal is installed, go back to Filezilla and permanently change settings.php to 644 permission.
- Voila, now you have set up your first Drupal site.
On the next articles, I'll explain which modules are mandatory to have for a functional site. As well as a beginner tutorial to theming.