05. Installing the Drupal Core
*** Updated 10 October 2010 ***
Remember the discussion in the first section about all the tutorials available on Drupal? Don't forget that. We encourage you to use any and all such tutorial information you need, since we can't answer everything.
Drupal Core
On HostMonster, installing Drupal is pretty easy: click the SimpleScripts link on the cPanel maintenance page, and follow the prompts. Accepting the defaults is probably going to be just fine.
Later on, we will revise this to include downloading and installing Drupal directly from Drupal.Org, but I suspect that needing to do so indicates your hosting service is not up to speed on the process. If you really want to do it directly, please contact us.
There will be several pieces of information that must be kept track of when installing Drupal, particularly the admin password, the version of Drupal that is being installed, and the base public folder (where the website actually lives). Take your Jamaica notes, because the information from the installation of Drupal is essential to keep.
Don't forget the password, because the password for Drupal administration is not something your website hosting service can help you with: Drupal is a package that runs entirely under your control, not theirs.
The version of Drupal is important to remember because other components that will be installed to support your website must be compatible with the Drupal core components you are installing now. Incompatible versions = Babel, and nothing works right.
There will also be an indication of the basic PUBLIC folder on your hosted site. This is important to know, because that is where Drupal will install, and that's where all the stuff people can see will be stored. On each host there will certainly be differences, but essentially the public area will be at least one layer below your private area (also called your site "home" folder.
On HostMonster, the ClackamasGOP.Org website "home" -- designated as "~", remember? -- folder is actually "/home2/clackama" (without the ending "s", an artifact of the way they assign user account folder names). The public space, and therefore the space where Drupal installs is called "~/public_html". Be sure to make a note of the tree structure for your hosting service. It definitely makes life easier. And don't be intimidated by the folder structure. With a few notable exceptions -- like the use of slash instead of backslash to separate path segments, and the use of tilde to designate the home folder -- it behaves pretty much like Windows.
Drupal does the nuts and bolts for this, but you will probably want to do something a little special sometime, so do get a feel for how your website is organized on your hosting service's server. And write it down, of course, so your team can keep track of it.
A Few Necessary Folders
The basic Drupal install does not usually create all the folders into which you will add things, because those folders aren't necessary until you DO add things. We will, so here we create them. We have attached the script files.loader that will do this process for you, but let us also describe what we are doing here.
After the basic Drupal setup, there should be some folders already created. Here are the direct session commands, with an explanation for each, that will create the secondary files we'll need to load modules, themes, and additional files onto your site. You should be able to cut and paste these commands directly into your direct session window if you are using HostMonster. If not, remember to substitute the correct Drupal home folder for your hosting site in the place of "public_html". Now, this process can also be done using the file manager program provided on the administration page of your hosting server, but (a) it's time to practice direct session commands, and (b) the permissions change commands executed below can sometimes be cumbersome when done using the file managers. If, at any step in this process, you don't see what we suggest you should, or get an error, ask your hosting service customer service for assistance, OK? So, start a direct session with your server host, and begin:
Commands:
cd ~/public_html/sites
# Navigate to the folder that will hold the files, modules, themes, and editors for your site.
ls
# You should see folders folders "all" and "default".
mkdir ./all/modules
# Creates the folder for modules. Ignore only "file exists" error.
mkdir ./all/modules/uploads
# Creates the repository for module installation files. Ignore only "file exists" error.
mkdir ./all/themes
# Creates the folder for themes. Ignore only "file exists" error.
mkdir ./all/themes/uploads
# Creates the repository for theme installation files. Ignore only "file exists" error.
mkdir ./all/libraries
# Creates the folder for editor plug-in components. Ignore only "file exists" error.
mkdir ./all/libraries/uploads
# Creates the repository for editor installation files. Ignore only "file exists" error.
ls -ls
Here is gets a little nerd/tech specific. We have to check permissions. You should see a list of letters and dashes to the far left of the folder entry "default/". It is expected that this list of permissions shows up as "dr-xr-xr-x". Without going into too much detail, this means that "default" is in fact a folder ("directory"), that everyone can read ("r") it, and that everyone can execute ("x") programs in it. Well, we need to be able to write to it, as well, so we will temporarily change the permissions for the folder, create another folder inside it, and then turn off that write permission again. The direct session command for this is "chmod", which essentially allows changing permissions on files and folders in a Linux environment. To learn more about it, type the command "man chmod" in your direct session window, or search the web for the similar documentation.
Commands, continued:
chmod u+w default
# If this results in an error, call for help.
mkdir ./default/files
# Creates the repository for general files to be used on your Drupal site. Ignore only "file exists" error.
ls -ls default
More technical stuff: observe the permissions for the folder "files": they should be "drwxr-xr-x". If not, call us for help. Something didn't work. If they are, great: let's turn off that pesky write bit again.
Commands, continued:
chmod u-w default
# Turn off the "write" permission that allowed us to create the folder inside folder "defaults".
ls -ls
Nerded out yet? Well, now, check the permissions on "default". They should again be "dr-xr-xr-x". Again, if they aren't, call for help. Congratulations. You are now officially a Linux newbie nerd. Don't worry, it's not terminal (that's a nerd pun).
Oh, and that's if for the basic folder creation. A word of advice: that "files" folder can become seriously cluttered. Just like it's a good idea to organize the folders on your workstation hard drive, it's a good idea to keep "files" organized, too. Use folders INSIDE "files" to manage the file clutter, make it easier to find things, and make it less likely that file names will conflict. Your organization principles and standards are up to you, but you should document them for those that follow your departure for the sandy beaches of Jamaica.
The Infamous Issue
Here, by the way, is a good place to mention the small issue that arises when installing Drupal using only a temporary address -- for Clackamas County, "http://74.220.215.83/~clackama/" -- rather than using either the primary permanent one -- which for Clackamas County will be "http://www.ClackamasGOP.Org" -- or an additional permanent address -- like "http://www.ClackamasGOP.Com". Can we suggest you just take our word for it, and assign an additional domain name to your site, and ignore the rest of this subsection? For the masochists among you, though, here is the issue:
When you upload images or documents to your hosting server, for the purpose of referencing them on your site (like photos to be displayed on a page, for example), Drupal doesn't really know about them, and doesn't care. When you want to use them, you have to tell Drupal where to find them, and that's done by giving Drupal a URL that points to each image. Normally, this is done by specifying a URL that starts in your "home" folder. When you connect to your new website on HostMonster (and, we suspect, on other hosting services) using the temporary address given to you when you signed up, the "home" folder that Drupal is told about is different than when you connect to the website using a permanent address. As a result, any references to those uploaded files will look different, as well, because the address which refers to them assumes a certain home folder.
Now, you don't need such references if you are just building the site, but we decided to load some content stories from the old website in order to see how the formatted pages looked. When we did, we uploaded three photos that were part of a story, referenced them with links within the story (as we had on the old site), but they did not appear. A little debugging, and we discovered that the "home" folder was not as we expected. A call to Hostmonster technical support confirmed that such was a limitation of using only the temporary access web address. Hence the solution of assigning a public address to the website during development -- by registering and pointing an additional domain name to the new site's host server -- instead of waiting until we launched the site permanently.
How It Works: the REALLY Short Version
Now, when your website visitors enter "http://www.<YOU>.org" ("<YOU>" is, well, you, right?), the hosting service will start hunting in your public space for instructions on what to show the visitor. In the case of ClackamasGOP.Org, HostMonster responds to a request for "http://www.clackamasgop.org" by hunting on the assigned server for the folder "/home2/clackama/public_html", or, using the "home" directory jargon, in "~/public_html". Inside that folder, HostMonster looks for "index.php", and runs it (it's really a short program): poof! Up pops the website (with apologies and due credit to, but no description of, the process wonders of: Apache, PHP, and all the other software between here and there!)
Drupal Uses PHP
Different host services put different limits on running websites, and you may have to take different steps with your hosting service. On HostMonster, there is a file that needs editing to set higher limits for certain aspects of the site limits, in order for Drupal to run well. To make the changes, use your FTP client to copy the file "~/public_html/php.ini.default" to your local computer, and then make a new copy of it called "php.ini", and edit it with a text editor. For Jackson County, Sandy renamed and then edited the file directly on the host server, which you may certainly do. We still recommend keeping copies of edited files on your local workstation, however, which is why we suggest copying the file to your computer, editing it, and then uploading the result.
Can't find it? First, call your host support and ask them about it. If they can't help you, it's possible there's no copy of it loaded in your Drupal install procedure. Ask their advice, or give them the parameters listed below and ask them to put them into the php.ini file for you. Finally, if it's still not as it should be, look here for advice from the Drupal organization.
For Clackamas County, the Hostmonster support people did it all for us. For Jackson County, Sandy asked for a step by step process, and the HostMonster support folks walked her through it:
- Navigate -> ( Software / Services ) PHP Config.
- Select PHP5(Single php.ini)
- Click "SAVE CHANGES"
- Scroll down and click "INSTALL PHP.INI MASTER FILE"
If the file looks strange when you edit it, you have probably run into a fundamental difference between Linux and Windows: text file lines are terminated by a two character sequence in Windows (Carriage Return followed by Line Feed), but only a single character in Linux (Line Feed, called New Line). To fix that problem, either use a text editor that doesn't care (like Notepad++), or use your FTP client to copy the file in "Text" or "ASCII" mode (the copy process will change the end of line sequence for you) rather than the (usually default) Binary mode (file is copied exactly as is).
Inside the new copy of php.ini for ClackamasGOP.Org, we found the following items that needed changing, and we replaced the original values as noted below. To fix your configuration, locate the text from the left side of each definition, and be sure the right side in your copy is like the right side. If you don't find a default definition matching one of these items, add it on a line near one of the others.
max_execution_time = 300
max_input_time = 120
memory_limit = 96M
post_max_size = 128M
upload_max_filesize = 32M
Remember, your hosting service might set different limits. After you are done editing the file, save it, then upload it as "~/public_html/php.ini".
The First Smoke Test
Now, login to your Drupal site, by entering in either the temporary hosting address, or a permanent address you've assigned to it. You should see Drupal pop up and offer you a place to login, using account admin, and the password you recorded during installation.
Enable Basic Included Core Modules
Let's turn a few of the included modules on, to start with: login as "admin", navigate -> Administer -> Site building -> Modules -> Core -- optional, and enable the following built-in modules: Aggregator, Book, Color, Contact, Database logging, Forum, Help, Menu, OpenID, Path, PHP filter, Poll, Search, Trigger, Update status and Upload.
Initial Error: CRON
You will probably come across a red banner that says your site has errors. This is not unexpected. Click on "status report" in the error banner, or navigate -> Administer -> Reports -> Status report. The first error expected is a warning that "cron" has not run. Be not alarmed. Cron is the process in Linux that performs timed jobs -- jobs that have to be run periodically -- according to user settings. You should certainly read the Drupal handbook on cron jobs (click the link in the status report entry for "Cron maintenance tasks"). Ultimately, you have to set this up using the website control interface provided by your hosting service. CPanel and PLesk are two such interfaces, and Hostmonster uses the former. If your service does not have something similar, call the customer service number and ask. Using cPanel on Hostmonster, navigate -> Advanced -> Cron jobs -> Standard.
- Enter an email address for the cron report to be sent to, probably your alias for website work, right? Later on, if you get tired of the status emails delivered every hour, revisit the control page and delete the email address to stop getting 24 or more reports per day saying cron had completed.
- For the command, enter "wget -O - -q -t 1 ", followed by the URL for your site, using the permanently-available "pre-launch" address given to you by the hosting service, followed by "/cron.php". For Clackamas County, this is "wget -O - -q -t 1 http://74.220.215.83/~clackama/cron.php", because before launching the site we access it using the server IP with the personal qualifier "~clackama", instead of "www.ClackamasGOP.Org". After launching, that same address will continue to work. You can, of course, change it to your permanent address after the publishing of your site to the public. For Clackamas County, this would make the command become "wget -O - -q -t 1 http://www.ClackamasGOP.Org/cron.php".
- Set the time of execution: Minutes=0; Hours=Every; Days=Every; Months=Every; Weekdays=Every. That will cause cron to run once per hour, at the top of the hour. If you have more stuff going on, you may want to change that to once every 15 minutes (check your hosting service documentation; for Hostmonster this entails setting Minutes="*/15").
- Click "Save Crontab" to preserve this new automatic function.
- Finally, you can check your cron "wget" command by trying it in a direct session connection to your server. Just copy and paste it, or type it, and hit the enter key. If all is working as it should, there should be a pause for a few seconds up to a minute or so, followed by a return to the command prompt, with no other information displayed. You can then Navigate -> Administer -> Reports -> Status report, and check to see that cron has run recently.
*** Note for future reference: if you intend to use the Splash module up through version 6.x-2.6, you must patch it. Check the Problems and Solutions pages for the patch.
Other errors you encounter will refer to configuration of items. You can decide when it is necessary to deal with them, but there usually are instructions. For module and core Drupal updates, there will be be recommendations. After you install modules and themes, you will have a good idea how to update those modules and themes, by installing the updates just as you did the originals. Don't worry right now.
Additional Login Accounts, and Permissions
Next, navigate -> Administer -> User management -> Roles. There should be two roles already: anonymous user (somebody who visits without logging in), and authenticated user (somebody who has given you basic information about how to get hold of them, but who you don't necessarily trust). Add at least one new role: Administrator. We will add more later. Then click "edit permissions" for Administrator, and turn on every permission (it's easier if you click into the first check-box, then touch the Space bar, then the Tab key, repeatedly).
Then enable a few permissions for Anonymous users and Authenticated users. For Anonymous users, enable the basic access items, like "access news feeds", "access printer-friendly version", "access comments" and "access content". For Authenticated users, enable those access items plus "post comments" and "access site-wide contact form". Now folks can do a few basic things, but there's more to come, later.
As you add additional components to Drupal, you will return to the Roles page, when you will add roles for writers, editors and moderators, and update the permissions for all user types, because those new components will need permission settings of their own.
Finally, navigate -> Administer -> User management -> Users, and click "Add user" to add as many users as you need to get things going, if you have helpers. If not, at least create one account for yourself, so you can log in with a little less power than "admin" most of the time. As things sit right now, you have only one special role defined -- Administrator. Later, we'll add more roles for people developing and editing content.
- Printer-friendly version
- Login or register to post comments

