×
Community Blog Install Dotclear on Alibaba Cloud

Install Dotclear on Alibaba Cloud

In this tutorial, you will install and set up Dotclear on an Alibaba Cloud ECS instance.

By Arslan Ud Din Shafiq, Alibaba Cloud Community Blog author and Alibaba Cloud MVP.

Dotclear is a high-quality blog publishing tool which has the option of automatic installation. Dotclear also has an administrator interface to manage the inner workings of a blog and supports multiple database types, including MySQL, MySQLi, MariaDB, PostgreSQL and SQLite.

In this tutorial, you will be installing and setting up Dotclear on an Alibaba Cloud Elastic Compute Service (ECS) instance that is installed with Ubuntu 16.04.

Prerequisites

  • You must have Alibaba Cloud Elastic Compute Service (ECS) activated and verified your valid payment method. If you are a new user, you can get $300 – $1200 worth in Alibaba Cloud credits for your new account. If you don't know how to setup your ECS instance, you can refer to this tutorial or quick-start guide. Your ECS instance must have at least 1GB RAM and 1 Core processor.
  • A domain name registered from Alibaba Cloud. If you have already registered a domain from Alibaba Cloud or any other host, you can update its domain nameserver records.
  • Domain name must be pointed to your Alibaba Cloud ECS's IP address
  • Access to VNC console in your Alibaba Cloud or SSH client installed in your PC
  • Set up your server's hostname and create user with root privileges.

Setting up Your Environment

Setting up Your Server

Before proceeding with installation of any kind of package, use the following command to update your Ubuntu system. To run this command, remember to login from non-root user with sudo privileges.

# sudo apt update && sudo apt upgrade

Installing PHP

Dotclear requires PHP 5.6.0 or later. In this tutorial, you will install PHP 7.2. To install PHP 7.2, complete the following steps. Know that you'll need to install python software properties and software properties common. To do so, run the command below.

# sudo apt-get install software-properties-common python-software-properties 

Add a repository for newer versions of PHP.

# sudo add-apt-repository ppa:ondrej/php

Next, update the system to refresh the available repositories.

# sudo apt update

To install PHP 7.2, execute the following command.

# sudo apt install -y php7.2

Installing Required PHP Extensions

Dotclear requires the following PHP extensions:

  1. php7.2-cli
  2. php7.2-fpm
  3. php7.2-mbstring
  4. php7.2-gd
  5. php7.2-xml
  6. php7.2-mysql
  7. php7.2-curl
  8. php7.2-zip
  9. php7.2-json

To install the above extensions of PHP, execute the following command.

# sudo apt install -y php7.2-mysql php7.2-curl php7.2-json php7.2-cli php7.2-gd php7.2-xml php7.2-mbstring php7.2-fpm php7.2-zip

When you finished installing the above extensions, apache2 will be installed automatically, so you won't need to install apache manually.

You can run the following command to check installed PHP version.

# php --version

Installing MariaDB

Dotclear supports MySQL, SQLite, MariaDB and PostgreSQL. In this tutorial, you will use MariaDB server. By default, Ubuntu repository has older version of MariaDB server. To use new version of MariaDB, you will need to add MariaDB repository to your Ubuntu system. To do so, follow the steps below.

Verify the keys by running the command below.

# sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8

Add the repository.

# sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirror.nodesdirect.com/mariadb/repo/10.2/ubuntu xenial main'

Update the system by running the following command.

# sudo apt update

Install MariaDB running the following command.

# sudo apt install -y mariadb-server

Start and enable the MariaDB server so that after reboot, the server can start automatically.

# sudo systemctl start mariadb
# sudo systemctl enable mariadb

Run the following command to enhance security of MariaDB server and set password for the root user.

# sudo mysql_secure_installation

Connect to the MySQL shell as root user by running the command below and enter your password.

# sudo mysql -u root -p

Running the following MySQL queries in your MariaDB server.

CREATE DATABASE dot;
CREATE USER 'aareez'@'localhost' IDENTIFIED BY '654321Ab';
GRANT ALL PRIVILEGES ON dot.* TO 'aareez'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Installing and Setting up Dotclear

To install Dotclear, you will need to follow the steps.

Navigate to /var/www/html use the command below.

# cd /var/www/html

Download Dotclear loader script by running the command below.

# sudo wget https://download.dotclear.org/loader/dotclear-loader.php

Give permissions to apache for the downloaded script by running the following command.

# sudo chown www-data:www-data ./

Run the following command to remove default index.html file.

# sudo rm index.html

You can access Dotclear by concatenating dotclear-loader.php in the end of URL.

For example, https://www.your_domain.tld/dotclear-loader.php

After accessing link, you will see the following screen. Click "Retrieve and unzip Dotclear" button to proceed.

1

Configuring the Database

After accessing the link and clicking "Retrieve and unzip Dotclear", you will be redirected to the following page for configuring database.

2

Configuring User Information for the Administrator

After you click continue button in database configuration page, you will be redirected to the following screen for setting up login credentials of administrator. Enter your information into the form and click Save button.

3

After you click save, you'll see the following screen. Here you can click the show button (shown below) to confirm the password that you used for setting up your administrator account.

4

Now click Manage your blog now to continue towards admin panel of your Dotclear blog.

5

Configuring the Apache Server

Now you can see that doctclear is a subdirectory in your domain. For setting up the Dotclear on root domain, you will need to configure virtual host.

6

For this, create virtual host configuration file for Dotclear. Run the following command, a file will be opened in nano text editor.

# sudo nano /etc/apache2/sites-available/dotclear.conf

Copy and paste the following code and save the file.

<VirtualHost *:80> 
    ServerAdmin admin@xyz.com
    ServerName softpedia.xyz
    DocumentRoot /var/www/html/dotclear
    DirectoryIndex index.php index.htm index.html
    ErrorLog ${APACHE_LOG_DIR}/Dotclear_error.log
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/Dotclear_access.log combined
</VirtualHost>

Run the command below to disable default site.

# sudo a2dissite 000-default.conf

Now you will need to enable the newly created virtual host. To do so, run the command below.

# sudo a2ensite dotclear

You will need to enable rewrite mod. You can do so by editing configuration file in apache2 directory or you can simply run the command below.

# sudo a2enmod rewrite

You will need to enable SSL engine. You can do so by editing configuration file in apache2 directory or you can simply run the command below.

# sudo a2enmod ssl

You will have to restart apache server to apply the changes and load the settings by running the command below.

# sudo service apache2 restart

Now you can access Dotclear via your domain name or ECS IP address. You will see the following screen after login.

7

Installing the SSL Certificate

We will install SSL certificate using Let's Encrypt with Certbot. To do so, run the following steps.

Update the package.

# sudo apt-get update

Install software-properties-common.

# sudo apt-get install software-properties-common

Add the certbot repository by using command below.

# sudo add-apt-repository ppa:certbot/certbot

Update the package to load the added certbot repository.

# sudo apt-get update

Stop apache before issuance of SSL certificate.

# sudo systemctl stop apache2

Install python-certbot-apache by running the command below.

# sudo apt-get install python-certbot-apache

Run the following command to get Let's Encrypt SSL issued.

# sudo certbot --apache -d softpedia.xyz

Select the option 2 to redirect the link to https and update virtual host settings for SSL. Restart apache server.

# sudo systemctl start apache2

You can access your website at https<span>://your_domain_name</span>.tld

Setting Up Firewalls and Ports

If you have activated firewalls, you will have to define a rule in Alibaba Cloud security group for your cloud server to add exception for port 80/tcp and 443/tcp. You can enable these ports while creating ECS instance, but in case if you forgot to unblock these ports, you can follow the procedure in this guide: Add security group rules.

0 0 0
Share on

Alibaba Clouder

2,018 posts | 470 followers

You may also like

Comments