How to create a database in cPanel?

Any CMS (content management system) like Word Press, Drupal or Joomla needs a database (DB) which is used to store data. In fact, most scripts used today on web sites need databases.

So, before I install any CMS or a script that needs a DB on my site, I had to create a database which later would be connected to the files of my site in my hosting account. I was afraid I wouldn’t be able to do it myself because I didn’t know anything about databases. Yet, it turned out to be very simple when using cPanel.

  1. I went to cPanel — > Databases — > MySQL Database Wizard.
  2. I created a database following 3 easy steps: I had to make up the name of the database, the name of the user for the database and the password. I gave all privileges to the user.
  3. I wrote down this information for future reference.

Here is a more detailed article about creating a database in cPanel with screenshots

If you are our hosting customer you can always ask us to create a database for you at no charge. If you haven't done so yet, please sign up for one of our web hosting packages: GoEasy or MSH (Managed Shared Hosting)

How to install a plugin on wordpress blog through the cPanel?

The most convenient and reliable way of installing a plugin for me is through the File Manager in cPanel. I searched for a necessary plugin in www.wordpress.com plugin directory.

I downloaded the archive with a plugin on my computer. I entered cPanel — > File Manager and found the public_html directory.

In this directory I found folder with my wordpress blog (it was not in the root) and searched there for wp-content directory. In the “wp-content” folder I found the “plugins” folder. If your blog is in the root, just find wp-content — > plugins.

I opened it and uploaded and extracted the plugin archive. (Read “How to upload and extract files in cPanel?”) I returned to my blog and entered admin panel — > plugins — > installed and clicked “Activate” under the name of the plugin I have installed.

Mailman config file location

Mailman config file location:
/usr/local/cpanel/3rdparty/mailman/Mailman/mm_cfg.py
/usr/local/cpanel/3rdparty/mailman/Mailman/defaults.py

Fantastico is not installed at the default location

Fantastico is not installed at the default location

Once upon a time we had to see that strange message:

Fantastico is not installed at the default location /usr/local/cpanel/3rdparty/fantastico. Either move the Fantastico directory from it's current location to /usr/local/cpanel/3rdparty/fantastico OR enable ioncube loaders in WHM -> Tweak settings

Solution:

Normally doing a /scripts/makecpphp fixes this.

What I did is a little trick 🙂

In WHM, I went to:

Main >> Server Configuration >> Tweak Settings

Under the PHP section for:

Loader to use for internal cPanel PHP (Use oldsourceguardian for version 1.x
and 2.x)

I selected sourceguardian, then reloaded the page and selected ioncube instead
again, and clicked on save.

Upgrading from SMF1.1.11 to SMF2.0

  1. Put your forum into the maintenance mode.
  2. Create a backup of files and DB of your forum.
  3. Download this archive, unpack it on your local PC and upload files from it into the same folder where your forum is.
  4. After you have finished uploading the files, point your browser to http://www.yourdomain.tld/forum/upgrade.php – where www.yourdomain.tld/forum is the URL of your forum. You should then see a page asking you for a few bits of information.
  5. From this point, the upgrader should walk you through everything. Please remember to delete upgrade.php after finishing the installation. If you do not delete it, it is possible that someone could compromise the security of your forum with it.

Location of CSR, CRT and KEY files

The location of the CSR and CRT files is in:
/usr/share/ssl/certs/yourdomain.csr.file

The location of the KEY file is in:
/usr/share/ssl/private/yourdomain.key.file

How to generate CSR (Certificate Signing Request) in WHM: http://www.rapidssl.com/resources/csr/cpanel.htm

How to buy and install an SSL certificate on your site

Step 0: Prepare your domain

Your site has to have a dedicated IP address in order for the SSL certificate to work. You get a free dedicated IP address with our MSH hosting package.

  1. Go to WHM > IP Functions > Change Site's IP Address
  2. Assign an available IP address to your domain

Step 1: Create a signing request

This is something your server will generate, so that you would submit it to SSL registrar that will generate your SSL certificate.

  1. Go to WHM > “Generate a SSL Certificate and Signing Request”
  2. Fill out the form and make sure you don't enter any password
  3. Save entered details in a notepad file to use in the Step3
  4. Make sure you tick the email checkbox and enter valid address to get a copy of the generated CSR in your email
  5. Make sure the email address in the Cert Info block is valid
  6. Copy and paste the generated CSR into a notepad file

Step 2: Buy the certificate

  1. Goto to Enom https://www.enom.com/secure/ssl-certificates-purchase.aspx
  2. Enter the domain name exactly in the same format you've entered in the Step1 and check out

Step 3: Configuring SSL certificate

  1. Go to the SSL management section in ENOM and choose from the list the one you just purchased
  2. In the certificate request section paste the CSR you saved in the notepad f ile
  3. For the server type question answer Apache + Mod SSL
  4. In the owner section enter exactly the same details you saved in the notepad file (just copy them)
  5. Submit the form and ask the customer to click on the confirmation link in the email he/she will receive and forward any emails from the SSL issuer to us

Step 4: Installing certificate in WHM

  1. Get the CRT file from the customer after he/she clicked on the confirmation link or
  2. Go to the manage SSL section and choose the domain the SSL was issued for
  3. Go to the “Install a SSL Certificate and Setup the Domain” and paste the copied CRT
  4. Press the fetch button and then click Submit.
  5. SSL certificate is now installed and no Apache restart is needed for that

How to install WordPress in the root directory?

This problem didn’t bother me when I was creating my first WordPress blog. Fantastico automatic installation was able to locate it only to a subdirectory. My blog had the address www.mydomain.com/myblog/. As there was nothing on my site except the wordpress blog, it was not good from the point of view of branding and search engine optimization to have nothing on the root folder, or to have people remember the longer name of my blog. Besides, Google ranked my site lower because it was located in subdirectory (mydomain.com/myblog/) of my site instead of the root directory (mydomain.com).

Sooner or later, most bloggers think of changing the default installation of their blogs. I tried all the ways suggested. But the best thing was to decide from the beginning where to locate your blog. So, when I had the next blog installed, I tried to avoid the mistake.

  1. I uploaded and extracted the wordpress.zip archive as described in “How to upload and extract archives using the File Manager”.
  2. I entered the directory containing all wordpress files and selected all. I moved them into public_html folder.
  3. I finished the installation as described in “How to install wordpress”.

1. I uploaded and extracted all the files of wordpress archive to my public_html folder which is the root folder in my hosting account. Details of the procedure read in the article “How to upload and extract archives using the File Manager?” If I finished the process of installation at this step, all the files would be located at public_html/wordpress folder. That meant they would have the address www.mydomain.com/wordpress/. My task was to move all the files from the wordpress folder to the public_html folder.

2. I entered the wordpress folder by double-clicking its icon. I selected all the files inside the wordpress folder. I clicked on the “Move file” icon.

3. In the next dialogue I had to type in the path (public_html) for the files to move. I pressed “Move files”.

That’s it! Done! The only thing left is to finish installation as it is described in “How to install WordPress using cPanel?”

Note that the above steps assume you have not yet installed your wordpress blog.

How to make pretty permalinks?

Go to settings > permalinks in your admin panel. There I chose the format of my permalinks. I advise to choose one of the suggested, it is easier.

The name of the single post in my blog include the name of the author before it. If you leave the “category base” and “tag base” boxes empty, then WordPress will display default settings – “topics” and “tags”. On my blog I have www.mydomain/key-words/video or /categories/my-life/. It is reasonable to change them for something shorter.

I clicked “Save changes” in the bottom, and the WordPress warned me that my .htaccess file is not writable and either WordPress or I should write new rules in .htaccess file. There was the text in the box which I had to copy and paste in my .htaccess file in the WordPress directory in my hosting account.

I pasted the text and went to the site. If you want to use other method (change permissions for the .htaccess file so that WordPress could write in it), don’t forget to return the permissions for it to safer numbers (644, for example) after the changes are made.

I noticed that permalinks for my posts became readable which was very convenient for me and for my readers.

What are pretty permalinks?

The permalinks can be edited when you create a post, but this option also won’t work until you set “pretty permalinks” on your blog.

The first thing to do when you start your blog is to make pretty permalinks, i.e. the URLs of my posts and pages.
I noticed that mine looked ugly, like this: www.mydomain.com/?page_id=12 and I would like to look them like this: www.mydomain.com/my-new-story/introduction/.

The pretty permalink of the single page in WordPress is the shortest one, just the name of the page. The child page has also the name of the parent page in the permalink.

The WordPress codex does not recommend using the %postname% format, there should be the date or some other data like the name of the author before the name of the post so that WordPress could easier distinguish between posts and pages.

The names of the categories and tags are preceded by the words “topics” and “tags” respectively. The category permalinks show its hierarchy.

How to switch to a different PHP version?

While installing one of the WordPress plug-ins, there was a message that I was running the old version of php. I had to switch to a new one, version 5.0 or higher. I accomplished it by inserting a single line into .htaccess file:

AddHandler application/x-httpd-php5 .php .php5 .php4 .php3

If you want to switch to PHP 5.1, you should add the following line:

AddHandler application/x-httpd-php51 .php .php5 .php4 .php3

If you want to switch to PHP 5.2, you should add the following line:

AddHandler application/x-httpd-php52 .php .php5 .php4 .php3

If you have no .htaccess file you should create it and then write in it the necessary line. If you have .htaccess file, you should only edit it.

The .htaccess file can be placed into the directory or to the subdirectory in your hosting account. The PHP version can be changed for all the files in your hosting account, if the .htaccess file is located in the root directory of your account, or for a subdirectory, if it is located in the subdirectory.
In my case, I had to put it to the subdirectory where all the files of my WordPress were located (public_html/myblog) in order to change php version only for my WordPress blog.