How to Set Up ImpressPages 5.0 on LAMP in CentOS 7.2

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

By Arslan Ud Din Shafiq, Alibaba Cloud Tech Share Author

ImpressPages is an open source and free content management system (CMS). It is based on a (model–view–controller) MVC architecture. ImpressPages is a lightweight, effective and simple CMS, with support for multi-languages by default. You can make the interface by just dragging and dropping.

To install ImpressPages 5.0, follow the steps below:

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.

2.You should setup your server’s hostname.

3.Optional: Secure your server by configuring security groups and activating firewalls. Some of the security products by Alibaba Cloud are for free, such as Server Guard and Anti-DDoS Basic.

Connecting to Your ECS Instance

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

2.To add a new user with roots privileges, use the following command:

# useradd aareez

where “aareez” can be replaced by any username of your choice.

3.Now set your desired password for your chosen username. In my case, username was “aareez”. When you will enter the following command, you will be prompted to enter a new password.

# passwd aareez

4.Now assign username to sudo user’s group to give root 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.

4

6.Now you will add our 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

7.Now, log in by using your new username and password. You can switch user by using the following command:

# su – aareez

You can see that you have been logged in from your new account now. If you want to verify this, you can use the command below:

# whoami

8

Update Your CentOS 7 System

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

# sudo yum -y update

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

Now you have successfully updated your CentOS system. Your next step is to install Apache Web Server.

Install Nano Editor

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

# sudo yum install nano

Install epel-release

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

# sudo yum install epel-release

Install Apache Web Server

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

# sudo yum -y install httpd

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

13.After installation, you will need to enable apache server to run automatically when you boot your ECS. For that, execute the commands below:

# sudo systemctl enable httpd

# sudo systemctl start httpd

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

# DocumentRoot "/var/www/html"

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

16.Now to make mod_rewrite work correctly with your ImpressPages CMS, 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

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

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

19.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. 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 the snapshots:

20.Go to your Elastic Compute Service section. Click on the More button on the ECS you have used for ImpressPages CMS:

24

21.Click on Configure Rules.

22.Click on Quickly Create Rules.

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

25

Disable SELinux (Security Enhanced Linux):

You will have to disable SELinux to avoid any type of permissions related issues for ImpressPages CMS. To do so, first of all, check whether SELinux is enabled or disabled.

24.To check use the following command:

# sudo sestatus

26

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

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

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

27.After adding repository, install PHP 7.1 along with modules required by ImpressPages CMS. 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:

31

Install MariaDB (MySQL) Server

28.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 Aspara DB for RDS is best alternative, its use is recommended.

29.After successful installation, enable MariaDB server to start automatically when system reboot. To do so, use the following commands:

# sudo systemctl enable mariadb

# sudo systemctl start mariadb

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

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

# sudo mysql -u root -p

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

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

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

where im_db can be changed to your desired name.

Install Unzip

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

# sudo yum -y install unzip

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

Install ImpressPages CMS Files

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

37.Now use the following command to get ImpressPages CMS package for installation.

# sudo wget http://download.impresspages.org/ImpressPages_5_0_3.zip

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

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

# ls -la

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

# sudo unzip ImpressPages_5_0_3.zip

40.Now move the installed directory to /var/www/html by using the command:

# sudo mv ImpressPages/* ImpressPages/.htaccess /var/www/html

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

# sudo chown -R apache:apache * .htaccess

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

# sudo systemctl restart httpd

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

Complete the Installation of ImpressPages CMS

43.To access ImpressPages CMS, use the IP address of your ECS instead of 47.254.66.175 and write the following address in your browser’s address box and hit enter.

http://47.254.66.175/index.php

50

44.You will be redirected to website configuration page, enter the name of your website, the email address of the admin and time zone.

Web name: Your website’s name
Admin e-mail address: Your email
Time Zone: Your Time Zone

The hit Next.

45.Now system check page will be opened, hit Next.

46.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 im_db
Username im_db
Password SecurePassword

52

Then hit Next button.

47.Now you will be redirected to Amin panel automatically. In case, if you are not redirected automatically, you can us the link below and add your IP address of ECS.

http://47.254.66.175/admin.php

48.In case, if you still can’t access admin panel, there can be issue with your .htaccess file. For this purpose, use the command below to open .htaccess in editor:

# sudo nano .htaccess

You will be asked to enter your user’s password. Enter your password and hit Enter key.

49.Try to uncomment the lines below:

Options -Indexes
Options -MultiViews

55

Press Ctrl+X, then press ‘Y’ and then hit Enter key.

50.Restart your apache server

# sudo systemctl restart httpd

56

Here you go….The tutorial has been completed. If you have any question or issue, try to write your query in comments. Thanks!

57

相关实践学习
如何在云端创建MySQL数据库
开始实验后,系统会自动创建一台自建MySQL的 源数据库 ECS 实例和一台 目标数据库 RDS。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
3月前
|
关系型数据库 MySQL Linux
Linux(CentOS7)搭建LAMP服务环境
本文介绍了在Linux (CentOS 7) 上搭建LAMP服务环境的详细步骤,包括安装Apache HTTPd、解决编译时依赖问题、配置Apache服务、安装PHP以及处理PHP与Apache集成时遇到的问题。同时,还涉及了防火墙设置和SELinux权限调整,确保Web服务能够正常运行。
87 2
|
6月前
|
Shell
CentOS6.5自动化安装LAMP脚本
CentOS6.5自动化安装LAMP脚本
|
6月前
|
Linux Apache
CentOS 7 源码安装LAMP环境源 和apache监听别的端口
CentOS 7 源码安装LAMP环境源 和apache监听别的端口
65 0
|
6月前
|
关系型数据库 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环境的遇到的一些问题
|
安全 关系型数据库 MySQL
CentOS7+LAMP+DVWA靶机搭建
Damn Vulnerable Web Application (DVWA)(译注:可以直译为:"该死的"不安全Web应用程序),是一个编码差的、易受攻击的 PHP/MySQL Web应用程序。 它的主要目的是帮助信息安全专业人员在合法的环境中,练习技能和测试工具,帮助 Web 开发人员更好地了解如何加强 Web 应用程序的安全性,并帮助学生和教师在可控的教学环境中了解和学习 Web 安全技术。本文通过实例从环境准备到安装一步步介绍了CentOS7+LAMP+DVWA靶机搭建。
559 0
CentOS7+LAMP+DVWA靶机搭建
|
关系型数据库 MySQL Linux
centos srream9 搭建基础网络服务dnsmasq,LAMP,DVWA
centos srream9 搭建基础网络服务dnsmasq,LAMP,DVWA
123 0
|
关系型数据库 MySQL Linux
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。