Operations 11 min read

Step-by-Step Guide to Build a LNMP Stack and Deploy WordPress on Tencent Cloud

This tutorial walks you through installing Xshell/Xftp, reinstalling the CentOS 7.2 system, remotely connecting via SSH, and sequentially installing and configuring Nginx, MySQL, PHP, phpMyAdmin, and WordPress on a Tencent Cloud server, including security group settings and service auto‑startup.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Step-by-Step Guide to Build a LNMP Stack and Deploy WordPress on Tencent Cloud

Prerequisites

Install remote management tools such as Xshell or Xftp (or Putty) on your local machine. These tools allow file upload/download without a separate FTP service.

1. Install Xshell/Xftp (optional)

Download the installer and follow the wizard: accept the license, choose installation path, and finish.

2. Reinstall the Server OS (optional)

Log in to the Tencent Cloud console, select your instance, and choose Reinstall System . Pick the CentOS 7.2 64‑bit image, set a root password, and start the reinstall. After the status shows Running , note the public IP.

3. Remote Login

Use Xshell (or Putty) to connect to the server via its public IP. Set the username to root and the password you defined.

4. Install Software

4.1 Install Nginx

yum install nginx

4.2 Install MySQL

Because CentOS 7 defaults to MariaDB, install the official MySQL community release first.

wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum update
yum install mysql-server

Start MySQL and run the security script:

systemctl start mysqld
mysql_secure_installation

4.3 Install PHP

yum install php
yum install php-fpm

4.4 Install phpMyAdmin

yum install phpmyadmin

Create a symbolic link so Nginx can serve phpMyAdmin:

ln -s /usr/share/phpMyAdmin/ /usr/share/nginx/html/phpmyadmin

5. Configure Services

Enable auto‑start on boot:

systemctl enable nginx.service
systemctl enable php-fpm

Restart Nginx to apply changes:

service nginx restart

6. Install WordPress

Remove the default index page, download WordPress, extract it, and move files to the web root.

rm /usr/share/nginx/html/index.html
wget https://cn.wordpress.org/wordpress-4.5.3-zh_CN.tar.gz
tar zxvf wordpress-4.5.3-zh_CN.tar.gz
mv wordpress/* /usr/share/nginx/html/

Temporarily set the web root permissions to 777 (later revert to 755): chmod -R 777 /usr/share/nginx/html Open a browser and navigate to http://<em>your‑public‑ip</em> to run the WordPress installation wizard. Provide the database name created earlier, the MySQL root user and password, and complete the setup.

7. Finalize

After WordPress is installed, restore proper permissions: chmod -R 755 /usr/share/nginx/html The site is now accessible via the server’s public IP (or a domain name after DNS configuration).

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

mysqlPHPTencent CloudWordPressServer SetupLNMP
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.