How to Install CMS Made Simple v2.2 on LAMP in CentOS 7.2

本文涉及的产品
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
RDS MySQL Serverless 高可用系列,价值2615元额度,1个月
简介: In this tutorial, we will be setting up CMS Made Simple on a LAMP stack with an Alibaba Cloud ECS instance (CentOS 7.2).

By Arslan Ud Din Shafiq, Alibaba Cloud Tech Share Author

CMS Made Simple is an open source and free content management system (CMS). It is user friendly and highly expandable and easy to integrate with ease of design and powerful addons and plugins.

In CMS Made Simple, you can arrange pages or reorder them by just add and drop feature. CMS Made Simple is one of the best options either you are developer, designer or end-user. If you are an end-user or editor, you don’t need to worry about its look, just edit and update your website’s content easily. You can edit content with a simple editor provided in CMS Made Simple.

CMS Made Simple does not restrict you to use premade or premium templates and save you from spending any extra money. With a small knowledge of HTML and CSS, a developer can simply use design manager to create a layout and other design. If you already have some design, don’t worry, you can put it as well in your CMS Made Simple.

As a developer, I prefer the services of Alibaba Cloud to host my CMS Made Simple. Alibaba Cloud Elastic Compute (ECS) is highly flexible and you can upgrade the hardware resources anytime when you get more traffic.

CMS Made Simple 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 CentOS 7.2 installed on it.

Prerequisites

1.You must have Alibaba Cloud Elastic Compute Service (ECS). If you are new user, Click Here to try the Alibaba Cloud Free Trial. I have used Alibaba Cloud ECS and CentOS 7 for this tutorial. If you don’t know about how to setup your ECS instance, you can refer to this tutorial.

2.You should setup your server’s hostname.

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

Connecting to Your Instance

1.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.

Add a User with Root Privileges

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

# useradd aareez

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

2.Now set a strong password for your chosen username. In my case, username was “aareez”. Type the following command and hit Enter key, you will be prompted to enter a new password.

# passwd aareez

3.Type your password and hit Enter key. Retype your password and hit Enter key.

4.Now add the username to sudo user group to give root/admin privileges. 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

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

6.Now you will have to add your username “aareez” to the “wheel” group by executing the following command:

# usermod -aG wheel aareez

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

# groups aareez

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

7.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 – aareez

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

# whoami

1

Update Your CentOS 7.2 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 yum -y update

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!” as shown below.

You CentOS system has been updated successfully. Now, next step is to install Apache Web Server. Before installation of Apache Web Server, you will need to install nano editor and epel-release.

2

Install Nano Editor

1.To install nano editor, execute the command below:

# sudo yum install nano

2.You will be prompted to type password. Enter your password and hit Enter key.

3.Type ‘y’ and hit Enter key to continue installation.

4.Nano editor has been installed successfully.

3

Install epel-release

1.To install epel-release, execute the command below:

# sudo yum install epel-release

2.Type ‘y’ and hit Enter key to continue installation.

3.Epel-release has been installed successfully.

4

Install Apache Web Server

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

# sudo yum -y install httpd

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

2.Apache Web Server has been installed successfully.

5

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

# sudo systemctl enable httpd

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

# sudo systemctl start httpd

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

# sudo nano /etc/httpd/conf/httpd.conf

Note: The configuration for DocumentRoot should look as given below. You can use Ctrl + W and type the following line to search the opened file text.

# DocumentRoot "/var/www/html"

6

6.Now press Ctrl + X and close the opened file.

7.Now open 00-base.conf by executing the following command and search for mod_rewrite to check either this module is loaded correctly or not.

# sudo nano /etc/httpd/conf.modules.d/00-base.conf

If mod_rewrite module is already loaded, you will see the following line.

LoadModule rewrite_module modules/mod_rewrite.so

Semi-colon is used for commenting a line in any Apache module. If the above lines starts with a semi-colon (;), remove the semi-colon and uncomment the line and press Ctrl + X, then hit ‘Y’ and then hit Enter key otherwise simply press Ctrl + X.

8.Now to make mod_rewrite work correctly with your CMS Made Simple, you will need to edit Apache’s configuration. To open the file for editing, use the command below:

# sudo nano /etc/httpd/conf/httpd.conf

9.Find section <Directory "/var/www/html"> and modify the value for AllOverride as below:

From To
AllowOverride none AllowOverride All

After modification, the section will look like:

<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

7

10.Now save the changes done by pressing Ctrl+X, then press ‘Y’ and then hit Enter key. Your changes have been saved.

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

# sudo systemctl restart httpd

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 given instructions in snapshots:

1.Go to your Elastic Compute Service section. Click on the More button for the ECS you are using for CMS Made Simple:

8

2.Click on Configure Rules.

3.Click on Quickly Create Rules.

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

9

Disable SELinux (Security Enhanced Linux)

You will have to disable SELinux to avoid any type of permissions related issues for CMS Made Simple. To do so, first of all, check whether SELinux is enabled or disabled. To check use the following command:

# sudo sestatus

It is disabled by default in Alibaba Cloud ECS. However, if you had made any changes previously to your ECS, you may need to follow this step. If status is disabled, skip this step. Otherwise, open the file using following command:

# sudo nano /etc/selinux/config

Make the following change in opened file and save the changed file.

From To
SELINUX=enforcing SELINUX=disabled

Press Ctrl+X, then press ‘Y’ and then hit Enter key to save the changes and close opened file.

After disabling SELinux, you will have to reboot your ECS. Follow the steps below to reboot ECS.

Install PHP 7.1

1.To install PHP 7.1 on CentOS, you will need to add an external repository. To do so, run the following command:

# sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

2.After adding repository, install PHP 7.1 along with modules required by CMS Made Simple. Execute the following command to do so:

# sudo yum -y install php71w php71w-gd php71w-mbstring php71w-mysql php71w-xml php71w-common php71w-pdo

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

10

Install MariaDB (MySQL) Server

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

# sudo yum -y install mariadb-server

Alibaba Cloud AsparaDB for RDS is the best alternative, and I strongly 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.

MariaDB Server has been installed successfully.

11

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

# sudo systemctl enable mariadb

# sudo systemctl start mariadb

3.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 CMS Made Simple, use the following query:

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

where made_db can be changed to your desired name.

Install Unzip

1.To unzip any zip folder, you will require unzip tool. To do so, use the following command:

# sudo yum -y install unzip

2.Then type ‘y’ and hit Enter key.

3.Unzip has been successfully installed.

12

Install CMS Made Simple v2.2

1.Navigate to cd /var/www/html/

Note: In case, if you get any error like ‘No such directory or file’, then create html directory. To do so, navigate to cd /var/www and execute the following command to create html directory and type cd html and hit enter.

# sudo mkdir html

2.Now use the following command to get CMS Made Simple package for installation.

# sudo wget http://s3.amazonaws.com/cmsms/downloads/14144/cmsms-2.2.7-install.zip

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

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

# ls -la

13

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

# sudo unzip cmsms-2.2.7.install.zip

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

# sudo chown -R apache:apache * ./

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

# sudo systemctl restart httpd

Congratulations, this is time to access your CMS Made Simple via IP address.

Complete the Installation of CMS Made Simple

1.To access CMS Made Simple, use the IP address of your ECS instead of 47.254.65.213 and write the following address in your browser’s address box and hit enter.

http://47.254.65.213/cmsms-2.2.7-install.php

2.Click Install to proceed installation of CMS Made Simple.

14

3.Click Next.

4.After this, you will be redirected to database configuration page. Add the following values as we used in the query above.

Host localhost
Database Name made_db
Username made_db
Password MadePassword

Then hit Next.

15

5.Now setup admin credentials for your CMS Made Easy. These credentials will be used to access admin panel. Choose username, type your email address and set a strong password and press Next.

16

6.Now choose your desired name for your website and select language from list if you want to set any additional language other than English. Then hit Next.

7.Click Next button to continue.

8.Click Next button again to continue.

9.CMS Made Simple has been installed successfully and ready to use.

17

10.To access your admin panel, you can use the link below. Replace your IP address (47.254.65.213) with your IP address of your ECS.

http://47.254.65.213/admin/login.php

18

11.That's it! You can access your CMS Made Easy website through your Alibaba Cloud ECS IP address. In my case, I accessed using http://47.254.65.213

相关实践学习
如何在云端创建MySQL数据库
开始实验后,系统会自动创建一台自建MySQL的 源数据库 ECS 实例和一台 目标数据库 RDS。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
3月前
|
Linux Shell Python
centos执行pip3 install etcd3报错
centos执行pip3 install etcd3报错
|
4月前
|
关系型数据库 MySQL Linux
Linux(CentOS7)搭建LAMP服务环境
本文介绍了在Linux (CentOS 7) 上搭建LAMP服务环境的详细步骤,包括安装Apache HTTPd、解决编译时依赖问题、配置Apache服务、安装PHP以及处理PHP与Apache集成时遇到的问题。同时,还涉及了防火墙设置和SELinux权限调整,确保Web服务能够正常运行。
89 2
|
5月前
|
关系型数据库 MySQL Linux
Linux部署实战前言,MySQL在CentOS安装【单机软件】,MySQL的安装需要root权限,yum install mysql,systemctl enable mysqld开机自启的意思
Linux部署实战前言,MySQL在CentOS安装【单机软件】,MySQL的安装需要root权限,yum install mysql,systemctl enable mysqld开机自启的意思
|
7月前
|
Shell
CentOS6.5自动化安装LAMP脚本
CentOS6.5自动化安装LAMP脚本
|
7月前
|
Linux Apache
CentOS 7 源码安装LAMP环境源 和apache监听别的端口
CentOS 7 源码安装LAMP环境源 和apache监听别的端口
65 0
|
7月前
|
关系型数据库 MySQL Linux
Centos7 yum安装lAMP 环境 php版本5.6.38 mysql版本5.7.22
Centos7 yum安装lAMP 环境 php版本5.6.38 mysql版本5.7.22
107 0
|
关系型数据库 MySQL Linux
centos如何搭建lamp环境
centos如何搭建lamp环境
146 0
|
Linux
centos搭建lamp环境的遇到的一些问题
centos搭建lamp环境的遇到的一些问题
37 0
centos搭建lamp环境的遇到的一些问题
|
7月前
|
Linux Docker 容器
CentOS7 Install Docker Compose
CentOS7 Install Docker Compose
155 0