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.

By Arslan Ud Din Shafiq, Alibaba Cloud Tech Share Author. Tech Share is Alibaba Cloud's incentive program to encourage the sharing of technical knowledge and best practices within the cloud community.

ProcessWire CMS is an open source framework and PHP based content management system (CMS) built to save time; its users do not require any training to use it. It is designed to provide satisfying experience to designers, developers and its end-users.

ProcessWire CMS provides a strong and simple way to manage your fields, pages, templates and styles. It also provides an open source API that is jQuery-inspired which makes it more enjoyable and easy to use.

ProcessWire 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, we will be installing ProcessWire CMS on an Alibaba Cloud Elastic Compute Service (ECS) instance with Debian 9 installed.

This tutorial is divided into 2 sub-tutorials.

  • 1. In the first part, we will add super user, setup firewalls, setup Apache Server, MariaDB Server, install PHP 7 (LAMP) and its various modules, and install various other necessary packages.
  • 2. In the second part, we will learn to configure your domain, creating virtual host, and installing Let's Encrypt SSL to our website. We will also be installing ProcessWire CMS and configure it.

Prerequisites

  • 1. 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 free $300 credits in your Alibaba Cloud account. If you don't know about how to setup your ECS instance, you can refer to this tutorial.
  • 2. 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.
  • 3. You should setup your server's hostname.
  • 4. Access to VNC console in your Alibaba Cloud or SSH client installed in your PC.

Add a User with Root Privileges

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.

In the first step, you will add a new user and give it sudo privileges. Sudo privileges will allow this username to make administrative changes on system when required. This user will be used to login from via SSH for everyday use. Once you have added this user, to keep your server secure from various attacks, you will disable the remote root access to root user.

  • 1. To create a new user account, use the following command:

    # adduser aareez

    where "aareez" can be any username of your choice.

    Now set your desired password and retype your desired password. Then, enter your full name, room number, work phone, home phone, and other. After entering the information, hit Enter key. To confirm the data is correct, type 'Y' and hit Enter key.


  • 2. Now assign username to sudo user's group to give administrative 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


  • 3. After executing the above command, a file will be opened, find the following lines in the opened file.

    1

    Sometimes by default the second line %sudo ALL=(ALL:ALL) ALL is commented (starting with hash #), due to which even after adding username to sudoers, it gives error on using sudo. To prevent this issue, if this line starts with '#' sign, remove this symbol and save the changes by pressing Ctrl+X, then type 'Y' and then hit Enter key to save.


  • 4. Now you will add your username "aareez" to the "sudo" group by executing the following command:

    # adduser aareez sudo

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

    # groups aareez

    Your username has been successfully added to sudoers group and it is able to execute any root command.


  • 5. Now, log in by using your new username and password. OR Use the following command to switch user:

    # 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

Update Your Debian 9 System

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

# sudo apt-get update

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

Now execute the following command to upgrade packages:

# sudo apt-get -y upgrade

You will be prompted to configurations below. Select the option to install the package maintainer's version

Install Apache Web Server

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

    # sudo apt-get -y install apache2


  • 2. 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 apache2


  • 3. To start your apache server, execute the following command:

    # sudo systemctl start apache2


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

    # sudo nano /etc/apache2/sites-enabled/000-default.conf

    Note: The configuration for DocumentRoot should look as DocumentRoot /var/www/html

    Press Ctrl + X, to exit from editor.


  • 5. Now add the following text before </VirtualHost> tag in opened file and press Ctrl+X, then press 'Y' and then hit Enter key to save the changes.
        <Directory /var/www/html/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
        </Directory>


  • 6. Now execute the following command to enable mod_rewrite module in apache.

    # sudo a2enmod rewrite


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

    # sudo systemctl restart apache2


  • 8. To verify, you have successfully installed Apache Web Server. Open http://47.254.38.226/ in your web browser where 47.254.38.226 is my ECS IP address. Remember to replace it with your ECS IP address. You will see the following page.

    2

Setup Firewalls for HTTP and HTTPS

  • 1. 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, go to your Elastic Compute Service section. Click on More for the ECS you are using for ImpressPages CMS and click Security Group Configuration.

    Click on Configure Rules and then click on Quickly Create Rules.

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

3

Install PHP 7.0

  • 1. To install PHP 7.0 on Debian 9 along with its modules required for ProcessWire CMS, you will need to execute the following command.

    # sudo apt-get -y install php php-gd php-mbstring php-common php-MariaDB php-imagick php-xml libapache2-mod-php php-curl php-zip


  • 2. You can check your php installation by executing the following command.

    # php -v

    4

Install MariaDB Server

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

    # sudo apt-get -y install mariadb-server

    You can also use Alibaba Cloud Aspara DB for RDS as an alternative. Alibaba Cloud AsparaDB for RDS frees you from managing a database and you can focus on your business. It also provides protection against SQL injections, network attacks, brute force attacks and many other types of database attacks. It is highly scalable, highly available, and easy to use.


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

    # sudo systemctl enable mariadb


  • 3. To start MariaDB server, execute the command below:

    # sudo systemctl start mariadb


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

    You have successfully secured your MariaDB server.

Install Unzip

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

    # sudo get-apt -y install unzip

Conclusion

We have successfully installed LAMP Stack & other necessary packages to continue with second part of How to install ProcessWire CMS on Debian 9 tutorial. In the next part, we will learn how configure your domain in Alibaba Cloud DNS, how to create virtual host to point your domain name to your ECS IP address and how to finally install ProcessWire on our ECS instance.

目录
相关文章
|
NoSQL Redis
How to Install and Configure Redis Server on Debian 9
In this tutorial, we will to install, configure, and use Redis on Debian 9 with Alibaba Cloud ECS.
3498 0
How to Install and Configure Redis Server on Debian 9
|
关系型数据库 MySQL 应用服务中间件
|
监控 关系型数据库 应用服务中间件
|
Web App开发 监控 应用服务中间件
|
关系型数据库 MySQL PHP
树莓派debian配置lamp【解决apache不显示php】
       Apache + MySql + Php. 1、安装Apache Apache可以用下面的命令来安装 sudo apt-get install apache2 Apache默认路径是/var/www/ 其配置文件路径为: /etc/apache2/ 可以通过:sudo nano /etc/apache2/ports.
1511 0
|
Oracle 关系型数据库 数据库管理
Install Oracle 11gR2 on Debian wheezy(转)
Install Oracle 11gR2 on Debian wheezy 出处:http://gaiustech.wordpress.com/2013/06/26/howto-install-oracle-on-debian-wheezy/ Oracle 11gR2 on Debian ...
1155 0
|
1月前
|
Ubuntu Linux 索引
Centos 7、Debian及Ubuntu系统中安装和验证tree命令的指南。
通过上述步骤,我们可以在CentOS 7、Debian和Ubuntu系统中安装并验证 `tree`命令。在命令行界面中执行安装命令,然后通过版本检查确认安装成功。这保证了在多个平台上 `tree`命令的一致性和可用性,使得用户无论在哪种Linux发行版上都能使用此工具浏览目录结构。
240 78
|
3月前
|
安全 应用服务中间件 Linux
Debian操作系统如何安装Nginx并开启HTTP2
本指南介绍了在Linux系统中通过源码编译安装Nginx的完整流程。首先更新软件包列表并安装必要的编译依赖,接着下载指定版本的Nginx源码包(如1.24.0),检查文件完整性后解压。随后通过配置脚本指定安装路径与模块(如HTTP SSL模块),执行编译和安装命令。最后创建软链接以便全局调用,并提供启动、停止及重载Nginx的命令,同时提醒注意安全组设置以确保正常访问。
|
6月前
|
Ubuntu 安全 调度
在Ubuntu下安装Debian包:dpkg与apt命令的深度解构。
安装Debian包的知识,就像掌握了海上的航行技术,虽然起初会让人感到陌生甚至困惑,但只要你积累熟练,就能在Ubuntu的世界里畅游无阻。就像每一位成功的航海家,掌握好这些工具,去探索属于你的Ubuntu新世界吧!
206 21
|
5月前
|
Ubuntu Linux
Ubuntu中dpkg和apt命令:debian包安装详解
希望这让你对于Ubuntu中的dpkg和apt命令有了更为清晰的理解。下次你面对软件包安装的问题,就可以轻松应对,优雅地在你的Linux系统中游刃有余了。
475 10