How to Install Backdrop CMS on FAMP (FreeBSD 11.1)

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
云数据库 RDS MySQL,高可用系列 2核4GB
简介: In this tutorial, we will be setting up Backdrop CMS on a FAMP stack using an Alibaba Cloud ECS instance (FreeBSD 11.11).

By Arslan Ud Din Shafiq, Alibaba Cloud Tech Share Author

Backdrop is an open source and free content management system (CMS). It is fork of Drupal, mobile-friendly, and fast. You don't need to know any programming language for using Backdrop CMS. You can easily create, edit, and manage your content.

Backdrop CMS provides you with a multi-level user experience. This means that you can set different levels of permissions to different people. Backdrop CMS has add-ons, plugins, themes and layouts. You can use them directly; you don't need to search for other add-ons or themes. Even if you need to modify its API, you can do this according to your needs.

If you are using Drupal 7, you can upgrade to Backdrop CMS with its built-in upgrade path from Drupal 7. Backdrop is compatible and works well with Alibaba Cloud Elastic Compute Service (ECS) servers. As a developer, I prefer the services of Alibaba Cloud to host my Backdrop CMS. Alibaba Elastic Compute (ECS) is highly flexible and you can upgrade the hardware resources anytime when you get more traffic.

Backdrop CMS does not restrict its installation to any specific operating system (OS). You can use any operating system (OS) of your choice; however, the installation steps would vary according to the choice of operating system.

In this tutorial, I will be using Alibaba Cloud Elastic Compute Service (ECS) with FreeBSD 11.1 installed on it.

Prerequisites

1.You must have Alibaba Cloud Elastic Compute Service (ECS) activated. If you are a new user, you can Free Credits in your Alibaba Cloud account. If you don't know about how to setup your ECS instance, you can refer to this tutorial or check quick-start guide.

2.You should setup your server's hostname.

3.Access to VNC console in your Alibaba Cloud or SSH client installed in your PC.

Logging In to Your Console

After completing the prerequisites, login as root user with your root username & password via SSH client (e.g. Putty – You can get Putty from https://www.putty.org ) or VNC console available in your Alibaba Cloud account dashboard.

Install Sudo

1.To assign sudo rights to a user, we will need to install sudo first. To do this, execute the command below:

# pkg install sudo

2.You will be prompted to give permission to proceed installation. Type 'y' and hit Enter key.

Add a User with Root Privileges

1.To add a new user with root/admin privileges, use the following command:

# adduser

2.For Username, type your selected username and hit Enter key.

3.For Full Name, type your full name and hit Enter key.

4.For Uid, leave the field empty and hit Enter key.

5.For Login group, type wheel and hit Enter key.

6.For Invite username into other groups?, leave blank and hit Enter key.

7.For Login class, type default and hit Enter key.

8.For Shell, type sh and hit Enter key.

9.For Home Directory, type /home/your_username and hit Enter key.

10.For Home Directory Permissions, leave the field blank and hit Enter key.

11.For Use password-based authentication, type yes and hit Enter key.

12.For Use and empty password, type no and hit Enter key.

13.For Use a random password, type no and hit Enter key.

14.Now you will be prompted to enter password. Type password of your choice and hit Enter key.

15.Retype the password and hit Enter key.

16.For “Lock out the account after creation?, type no and hit Enter key.

17.For OK?, type yes and hit Enter key.

18.Now you will be asked to add another user, type no and hit Enter key.

19.New user with sudo/admin rights have been created successfully.

1


Note: “aaree” can be any username of your choice.

20.After execution of the above command, you can verify the membership of for that group by executing the following command:

# groups aaree

The above screenshot shows that username “aaree” is part of “wheel".

21.Now you will need to edit sudoers file to uncomment the line shown in screenshot below to give sudo rights to wheel group. For this, we will check /etc/sudoers file and see whether sudoers group is enabled or not. For this purpose, we will execute the following command.

# visudo

22.After executing the above command, you will see the following lines in the opened file.

2

Remove the # from its start to uncomment the line. Otherwise, your username will not be able to execute sudo command.

To remove this, make your cursor on # and press r key and then press spacebar key. After it type :x and hit Enter key to save changes.

23.Now, log in to your new account by with recently created credentials OR You can switch from root user to your username by using the following command:

# su – aaree

To verify from which account, you have been logged in, type the following command and hit Enter key.

# whoami

Update Your FreeBSD 11.1 System

Before proceeding towards installation of any kind of package, execute the command below to update your CentOS system.

Note: To execute this command, remember to login from non-root user with sudo privileges.

# sudo freebsd-update fetch

Now, you will be prompted to type your password to confirm. Type your password and hit Enter key and wait until your screen shows status “Complete!”.

# sudo freebsd-update install
# sudo pkg update
# sudo pkg upgrade

You will be prompted to proceed with this action, type 'y' and hit Enter key.

Install Apache Web Server

1.To install the apache web-server, you will need to execute the following command:

# sudo pkg install apache24

You may be prompted to enter your password. Now type your password and hit Enter key.

Now you will be asked to enter y/N, type 'y' and then hit Enter key and wait for updating.

2.Apache Web Server has been installed successfully.

3

3.Now enable apache server to run automatically when you boot your ECS. For that, execute the commands below:

# sudo sysrc apache24_enable=yes

4.Now execute the command below to start Apache service. You may be asked to enter password again.

# sudo service apache24 start

5.To ensure that you have installed Apache correctly, you can check by accessing your IP through your browser. You should see the following page.

4

6.To ensure that your DocumentRoot directive is pointing to correct directory, check your Apache configuration file by using the following command:

# sudo vi /usr/local/etc/apache24/httpd.conf

Note: The configuration for DocumentRoot should look as given below.

# DocumentRoot "/usr/local/www/apache24/data"

5

7.Now we need to enable mod_rewrite. To load mod_rewrite, you will need to uncomment the following line in Apache configurations.

#LoadModule rewrite_module libexec/apache24/mod_rewrite.so

6

This line is commented by default. To load mod_rewrite, remove # to uncomment this line. To do so, point the cursor to # and press r and then press spacebar key. Now type :x and press Enter key to save your changes.

8.To make the changes work correctly, we will need to restart apache. To do so, execute the command below:

# sudo service apache24 restart

Setup Firewalls for HTTP and HTTPS

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, 443/tcp. You can enable these ports while creating ECS instance, but in case, if you have forgotten to unblock these ports, you can follow the procedure below. By default, these ports are blocked by the firewalls.

To do this follow the following instructions:

1.Go to your Elastic Compute Service section. Click on more button for ECS you are making ready for Backdrop CMS:

7

2.Click on Configure Rules.

3.Click on Quickly Create Rules.

4.Add the configurations as shown in screenshot below & click OK.

8

Install PHP 7.1

1.Now you will have to install PHP 7.1 along with its required modules necessary for Backdrop CMS. To do this, execute the following command.

# sudo pkg install php71 mod_php71 php71-gd php71-mbstring php71-mysqli php71-curl php71-ctype php71-tokenizer php71-dom php71-session php71-iconv php71-hash php71-json php71-fileinfo php71-pdo php71-pdo_mysql php71-zlib php71-filter php71-xml php71-SampleXML

2.You will be prompted to proceed with the above action. Enter y and hit Enter key to proceed.

After successful installation of PHP modules, you will see the screen as follows:

9

3.Now you need to configure Apache to use PHP. For this purpose, create a new file php.conf in Includes directory of Apache. To do so, execute the following command:

# sudo vi /usr/local/etc/apache24/Includes/php.conf

Now add the following text in opened file and type :x and hit Enter key to save the file.

<IfModule dir_module>
    DirectoryIndex index.php index.html
    <FilesMatch "\.php$">
        SetHandler application/x-httpd-php
    </FilesMatch>
    <FilesMatch "\.phps$">
        SetHandler application/x-httpd-php-source
    </FilesMatch>
</IfModule>

4.Now restart Apache service to reload the changes. Use the following command:

# sudo service apache24 restart

Install MariaDB (MySQL) Server

1.In replacement of MySQL server, FreeBSD uses MariaDB server by default. To install MariaDB, use the following command:

# sudo pkg install mariadb102-server mariadb102-client

Alibaba Cloud AsparaDB for RDS is a good alternative and I highly recommend it. Alibaba Cloud AsparaDB for RDS frees you from managing a database and you can focus on your business. It is a ready to use service. It provides protection against SQL injections, network attacks, brute force attacks and many other types of database attacks. It is highly scalable, available and secure with ease of use.

2.You will be prompted to ask whether to take action or not. Type y and hit Enter key. MariaDB Server has been installed successfully.

3.Now, enable MariaDB server to start automatically when system reboot. To do so, use the following commands:

# sudo sysrc mysql_enable="yes"

# sudo service mysql-server start

4.Now to secure your MariaDB server, execute the command:

# sudo mysql_secure_installation

The root password will be blank by default, just hit enter button to proceed and select 'Y' and choose your password.

Create a Database

1.Use MariaDB shell to login as root user and execute the following command:

# sudo mysql -u root -p

2.Now the command prompt will ask you to enter password for user 'root'. Enter the password and hit enter key, you will be prompted to MariaDB command prompt.

3.To create the database and user for this database for your Backdrop CMS, use the following query:

CREATE DATABASE backdrop_db CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE USER 'backdrop_user'@'localhost' IDENTIFIED BY 'SecurePassword';
GRANT ALL PRIVILEGES ON backdrop_db.* TO 'backdrop_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

where backdrop_db can be changed to your desired name database name and backdrop_user can be changed to your desired username.

Install Backdrop CMS

1.Navigate to cd /usr/local/www/apache24/data

2.To confirm your current directory use the command:

# pwd

3.Now use the following command to get Backdrop CMS package for installation.

# sudo wget https://github.com/backdrop/backdrop/releases/download/1.9.3/backdrop.zip

If the above command gives any error, or you need to install latest version of Backdrop CMS, click here to get the link of latest version.

4.To list the files in current directory, use the command:

# ls -la

10

5.Now unzip the compressed zip folder as listed when executed ls -la command. To do so, use the command:

# sudo unzip backdrop.zip

6.Now move all of the files to web root directory. To do so, execute the following command:

# sudo mv backdrop/* /usr/local/www/apache24/data

7.Change owner of files to avoid permissions issues. Execute command below:

# sudo chown -R www:www *

8.After performing the above steps, restart Apache using the command:

# sudo service apache24 restart

Congratulations! It's time to access your Backdrop CMS via IP address.

Complete the Installation of Backdrop CMS

1.Before opening installation file of Backdrop CMS, you will have to confirm database settings in settings.php file.

# sudo vi settings.php

2.Find the line below in the opened file and edit it to update your database settings and type :x and then hit Enter key to save changes.

11

3.To access Backdrop CMS, use the IP address of your ECS in your browser's address box and hit enter. My ECS IP address is 47.89.249.16.

In case you are unable to access via IP address, try appending /index.php to the IP address. For my example, it will be http://47.89.249.16/index.php

4.Click Save and Continue to proceed installation of Backdrop CMS.

5.After completion of installation, you will see the following form. Fill the details regarding your website and setup web admin credentials and then press Save and Continue.

12

6.That's it! You can now access your Backdrop CMS website through your Alibaba Cloud ECS IP address. In my case, I accessed using http://47.89.249.16/

13

相关实践学习
借助OSS搭建在线教育视频课程分享网站
本教程介绍如何基于云服务器ECS和对象存储OSS,搭建一个在线教育视频课程分享网站。
7天玩转云服务器
云服务器ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,可降低 IT 成本,提升运维效率。本课程手把手带你了解ECS、掌握基本操作、动手实操快照管理、镜像管理等。了解产品详情:&nbsp;https://www.aliyun.com/product/ecs
目录
相关文章
|
Ubuntu Linux
Manjaro Linux 安装 deb 软件包
“记得上次用 Manjaro Linux 的时候,还是上次:)”。三年前,工作都是在 Linux 下完成的——那时候的我还没买苹果电脑,每天的快乐就是折腾 Linux 发行版……
371 0
|
Unix
solaris 11.4 扩展包安装和sru安装
solaris 11.4 扩展包安装和sru安装
414 0
|
2月前
|
Ubuntu Linux 开发工具
Windows11 WSL2 Ubuntu编译安装perf工具
Windows11 WSL2 Ubuntu编译安装perf工具
52 0
|
2月前
|
Ubuntu Linux
在Linux中,在不同的Linux发行版中(如RPM-based和DEB-based)如何安装、升级、删除软件包?
在Linux中,在不同的Linux发行版中(如RPM-based和DEB-based)如何安装、升级、删除软件包?
|
5月前
|
资源调度 JavaScript Ubuntu
Yarn介绍及快速安装Debian/Ubuntu Linux
现在,你已经成功安装了Yarn,可以在你的JavaScript项目中使用它来管理依赖。
531 3
|
5月前
|
算法 Ubuntu Linux
【Linux】DEB软件包
【Linux】DEB软件包
74 0
|
开发工具 git 计算机视觉
Ubuntu20.4 DSO安装与测试
Ubuntu20.4 DSO安装与测试
279 0
Ubuntu20.4 DSO安装与测试
|
弹性计算 关系型数据库 网络安全
How to install ProcessWire CMS on Debian 9 – Part 1 LAMP Stack Installation
In this tutorial, we will be installing ProcessWire CMS on an Alibaba Cloud Elastic Compute Service (ECS) instance with Debian 9.
5726 0
How to install ProcessWire CMS on Debian 9 – Part 1 LAMP Stack Installation
|
弹性计算 关系型数据库 Linux
How to Install CMS Made Simple v2.2 on LAMP in CentOS 7.2
In this tutorial, we will be setting up CMS Made Simple on a LAMP stack with an Alibaba Cloud ECS instance (CentOS 7.2).
3903 0
How to Install CMS Made Simple v2.2 on LAMP in CentOS 7.2