Install Drupal 7.14 Without Fantastico
Using these instructions you should be able to do a default Drupal install in under three minutes. Not bad for a fully functional site straight out of the box!
For this example we're using Ubuntu Linux to install, although the commands etc. should work cross-platform. For Drupal 5, things are very similar.
Getting the Source
These directions will install the Drupal CMS into the root of your site. If you want to install Drupal into a folder on your site (like www.yoursite.com/drupal/) then forgo step 5. Instead you can rename the extracted Drupal folder to whatever you choose.
To begin installing the Drupal CMS:
-
SSH into your account
-
Navigate to your public_html folder
-
wget http://ftp.drupal.org/files/projects/drupal-7.14.tar.gz
-
tar -zxvf drupal-7.14.tar.gz
-
mv drupal-7.14/* drupal-7.14/.htaccess ~/public_html/
-
rm drupal-7.14.tar.gz
You should be able to navigate to your site, but in order to make things work, you need to create a database....
Creating the Database
We're going to use cPanel to install the database and SSH to issue the commands:
-
Navigate to the MySQL Databases section
-
In the Current Databases section enter the name you want to use
Note: this can be anything, just be sure to remember what it is (write it down!) as it will be important in a later step. For this exercise we're using the database name 'Drupal' for the sake of simplicity. -
Click Create Database
-
You will notice that your database is created using the format 'ASOusername_databasename'; in this case ours is 'ASOusername_drupal'
-
To create the database user enter the username and password for this user and click Create User
-
To add the user to the database select your database and user (make sure All is checked under Privileges) and click Add User to Database
-
To load the database schema enter this command in your SSH session:
mysql -u ASOusername_username -p ASOusername_databasename < database/database.7.1.mysql
Note: in my example it would be 'mysql -u ASOusername_drupal -p ASOusername_drupal < database/database.7.1.mysql'.
Now if you navigate to your site you will notice nothing has changed because we haven't told Drupal where to find your newly created database yet...
Connecting Your Site to Your Database
-
Use Nano Editor, or similar, to change the your settings.php file OR download the file with FTP and make the changes before re-uploading it to the server
-
In the SSH session enter this command: nano sites/default/settings.php
-
Scroll down to the line:
$db_url = "mysql://username:password@localhost/databasename";
-
Change it to:
$db_url = "mysql://drupaldatabaseusername:drupaldatabaseusernamepassword@localhost/drupaldatabasename";
Note: in my example this would be '$db_url = 'mysql://ASOUsername_drupal:password@localhost/ASOusername_drupal'' -
Change the $base_url line just a little farther down to your website's URL
-
Save the file by pressing CTRL + X and confirm the save by hitting Y
-
Congratulations you have just finished installing Drupal
Wrapping it Up
-
Navigate to your site's URL
Now, let's create a directory called 'files' in our public_html directory, which is where Drupal will store things like your site logo. -
Go to your SSH Session
Note: it is VERY important that you be the one to create the first user. This user will have full admin privileges and will be able to grant others appropriate site access. It is usually best to create the first username as admin or administrator. -
Enter this command:
cd ~/public_html
-
Enter this command:
mkdir files
-
Enter this command:
chmod 777 files
You've just completed your Drupal install. Now go to the Drupal website and and read up on the growing number of modules and themes!