I’ve been using wordpress for all of my content management system (CMS) needs, so I figured, WHY NOT?!? Try Drupal and learn something. So this is me starting to use Drupal. We’ll see what happens.
I was introduced to wordpress through my account on godaddy.com (horrible service… see write-up here) and proceeded to use their hosting cpanel to install it. I’m not going to include that story in this writing, but what I will say is that it led me to build my own web server for housing my wordpress installs. After building quite a few websites, I noticed a friend logging into his Drupal account and was somewhat fascinated by how it looked and felt. So I said, WHY NOT?!?
Enjoy it with me. Here’s how the install went:
– PROCESS OVERVIEW –
CONFIGURE DOMAIN NAME
- Register Domain Name
- Point domain to name servers
- Configure DNS records
- Create VirtualHost on web server
- Restart httpd service
SET UP SERVER DIRECTORIES / FILES
- Terminal into server (SSH)
- Download latest Drupal installation and unzip them
- Copy files to DocumentRoot web directory
- Create the settings.php file and set privileges
CREATE MYSQL DATABASE
- Login to Mysql using root
- Create database to use
- Set privileges to the user
- Flush privileges
FINALLY! THE INSTALL
- Installation profile
- Installation language
- Verify requirements
- Set up database
- Install profile
- Configure site
- Check it out!
-SET UP THE DOMAIN NAME –
There’s not much to show in the realm of creating a domain name. It’s pretty easy to do… just google it, try out a domain name that you like, see if it’s available, buy it, and configure it.
More than likely when you buy a domain name, whomever you bought it from will associate a name server to it automatically. This will make it active as soon as you buy it, but that’s not necessarily what you want. I prefer to control my DNS entries through nameservers that I control. Therefore I will find the settings link for my domain name and change the name server entry from their automatic one to the DNS server that I control. Common entries for new domains are NS, A, CNAME, and MX. I’ll probably throw out a writings sometime explaining these, but for now, the only ones that you’ll need are the NS and A entries.
The NS is the name server (somewhat redundant) and the A entry is telling the world which IP you’d like your new domain name pointed to. This will be the same IP address that you will SSH into for configuring Drupal.
-SET UP DIRECTORIES ON SERVER –
I will SSH into my web hosting machine using the application Terminal (Mac/Linux) or Putty (Windows). Since I absolutely can’t stand Windows, this writing will be using Terminal.
$ ssh firstname.lastname@example.org
NOTE: ip.ip.ip.ip should be replaced with the ip address of your web server.
$ cd ~/temp/
# move to the folder temp in your home directory
NOTE: temp/ is always in my home directory. I keep both WordPress and now Drupal files in a folder that I can simply copy to a new domain folder for quick installation.
$ wget https://ftp.drupal.org/files/projects/drupal-7.20.tar.gz
# download the file to the directory that you are in (~/temp)
NOTE: Version 7.2 is used for this installation. Newer versions may change installation steps.
$ tar -xzvf drupal-7.20.tar.gz
# unzip the file
$ sudo mkdir /var/www/html/servertheories.com
NOTE: yep, you see servertheories.com instead of servertheroy.com. Quite simply, it’s just my testing domain. WHY NOT, right?!?
$ sudo cp -R ~/temp/drupal/drupal-7.20/* /var/www/html/servertheories.com/
NOTE: there are a couple hidden files to consider, so make sure those are copied as well
$ sudo cp ~/temp/drupal/drupal-7.20/.* /var/www/html/servertheories.com
– SETTINGS.PHP – CREATE / PERMIT –
$ cd /var/www/html/servertheories.com/
$ sudo cp sites/default/default.settings.php sites/default/settings.php
# create the settings.php file that is needed for installation.
NOTE: you still need the default.settings.php file. Make sure you are not changing the name or replacing the original default.setup.php file. You simply want to use this command to create the exact same file with the name setup.php.
$ sudo chmod a+w sites/default/settings.php
# this gives write privileges to settings.php for all (a).
NOTE: You are changing the permissions of settings.php so that it can be used as a sort of scratch pad for the installation. You will remove the write permissions when the installation is complete.
$ sudo chmod a+w sites/default/
# folders need to be created inside default, therefore write privileges need to be configured.
– CREATE MYSQL DATABASE –
NOTE: You’ll need to know how to use mysql for the installation. The most important thing in this case will be the semi-colon ‘;’ at the end of a line. If you hit enter before you’re done typing the command, it’s alright. Just keep typing. It won’t execute until you enter that semi-colon while inside of mysql. You can also use control panels such as phpMyAdmin to enter these same commands via a website on the mysql server.
REMEMBER: You’re already terminaled into the web server machine. If your database is housed on a remote server, you’ll have to terminal into that machine to complete these steps. If that’s the case, you will need to change “localhost” to the web server ip address.
$ mysql -u root -p
> create database drupaldb;
> GRANT ALL PRIVILEGES ON drupaldb.* TO “ufiadmin”@”localhost” IDENTIFIED BY “password”;
> flush privileges;
NOTE: the drupal website lists these as the privs to give…
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES, CREATE TEMPORARY TABLES ON `databasename`.* TO ‘username’@’localhost’ IDENTIFIED BY ‘password’;
NOTE: DON’T FORGET YOUR PASSWORD. I know I’m dramatic… truth be told, if you forget it, you’ll be able to look it up through the command history in mysql. But it’s just easier if you don’t forget it 🙂
– DRUPAL INSTALL –
You’ll need to access your directory where you housed your setup files. Do you remember when we created setup.php and set the permissions to both the file and the folder that houses it. Now, the installation process will write the appropriate files to that folder. Here we go!
go to https://www.servertheories.com (or whatever you named your site).
NOTE: If you did the installation inside of a folder which is housed in your DocumentRoot folder, you’ll need to add that to the URL. So you’ll go to https://www.servertheories.com/folder to access the installation.
TANGENT — WEB TRAFFIC ROUTING — TANGENT
Entering the URL will route the traffic to wherever you bought the domain name, then to the name servers that you specified, then to the ‘A’ DNS entry for servertheories.com (or the ‘CNAME’ DNS entry for www.servertheories.com), which will then send the traffic to the IP address of your web server that you specified in the DNS entry. Your VirtualHost entries in the httpd.conf (for Apache) will tell this traffic to go to the DocumentRoot /var/www/html/servertheories.com at which time index.php will be served to your browser. In this case, index.php will redirect you to the install.php file to complete the installation.
SORRY — TANGENT COMPLETE — SORRY
From here you’ll be asked which language you’d like to install. I am not going to mess with any other language than the one I know.
Following choosing a language, the setup process will verify that you have all of the required installations on your server computer, including MySql, php, php_mbstring, and more. If there are any requirements that are not met, you will be shown a red box with the un-fufilled requirement highlighted. In order to continue, you will need to fulfill these requirements.
When these requirements are fulfilled, you will be asked for your database configuration, including the database name, user name for the database, and the password associated with that user account. These are the same credentials that you used earlier when you created the database. Simply input your credentials and click ‘Save and continue’ toward the bottom.
NOTE: You can use the advanced options for remote server databases and irregular ports. I included a screenshot of the advanced options, however, I am going to stick to a localhost installation for everything.
Advanced Options… if you’re interested:
Upon clicking the ‘Save and continue’ link, I was presented with this message:
This message, in plain text, tells me that Drupal isn’t able to present its credentials to MySql. It’s using the login usiadmin, and it’s trying to use a password to access the database. Fortunately, I know that it’s talking to MySql… unfortunately, I have no idea which part of the credentials aren’t working. Therefore, I want to troubleshoot to find out what’s going on.
First, I wanted to make sure I didn’t fat finger something. So I opened up my secure source where I keep all of my log-in credentials, and tried a copy/paste from there. When I clicked ‘Save and continue’ again, it showed me the same message. So instead of trusting my fingers, I checked to see what MySql was actually expecting as far as credentials.
Via the SSH used to create the database, I logged back into the MySql database. Fortunately, MySql has a history similar to your command line shell. Simply hit the up key. So my process was to look at the databases, then hit the up key till I saw the GRANT ALL PRIVILEGES line that I entered earlier.
NOTE: This technique will also show the password that you entered for this account… just in case you forgot it.
When all was said and done, I figured out that the log-in name of ‘usiadmin’ was different from what I actually inputted into MySql. I should have used ‘ufiadmin’ with an ‘f’ instead of ‘s.’ I fat-fingered it into my secure source. It happens…
When everything was finally correct, the rest went very smoothly. This next process took seven to ten seconds to complete and the status bar moved in real-time.
At first, when I saw this next box pop up, I thought that something had gone wrong. In reality, it was just telling me that my final step should be to remove those privileges that I granted to setup.php. I would rather see some green at this point to give me a warm and fuzzy feeling on the inside, but I guess this works. I would also rather this message show up on the ‘Congratulations’ page that you’ll see later, but that’s okay too. The install is flowing just fine… I just can’t forget to remove those privileges at the end. NBD!
So now, to finish the installation, I entered the information that I wanted on this website and saved the changes.
It looks like the default is whatever the server’s time settings are. I’ll have to change some things and try again to determine this, but no big deal either way.
That was it! Process complete.
https://www.servertheories.com should now take you to your new Drupal website. At this point, I have no idea what’s behind the scenes… but that will change in due time. Stay tuned for more blogs as I learn a bit more.
– CHANGE PERMISSIONS BACK –
Don’t forget to change the permissions back!
$ sudo chmod 644 sites/default/settings.php
– GO LEARN! –
Now it’s time to do what I do… WHAT IF AND WHY NOT! Try to do some experiments, change some templates, go crazy with the content, and always have a back-up plan. Shoot me a line sometime via my sidebar messageer and let me know what you discover! Enjoy!
Always remember… WHAT IF AND WHY NOT?!?