Perhaps the blog is no longer popular, but there is always loyal users a WordPress large. This experiment takes you from start to prepare LNMP environment, step by step to build up one of their own WordPress blog.
Laboratory Address: https://cloud.tencent.com/developer/labs/lab/10122
Tencent cloud coupons https://cloud.tencent.com/redirect.php?redirect=1040&cps_key=09ff33cfb418db124451885bff0af0c4&from=console
Ready LAMP environment
Task time: 10min ~ 20min
LAMP is the Linux, Apache, MySQL and PHP acronym is Wordpress system relies on the basis of the operating environment. Let's take a ready LAMP environment:
(As part of the services required to show the installation process, you will be under the terminal height of the drag way part of it up a bit)
Install Apache2
In the command input terminal, used apt-get
to install Apache2:
sudo apt-get install apache2 -y
After installation, you can access the lab IP address http: // <your CVM IP address> view "it works" interface, indicating apache2 installed successfully.
Installing PHP Components
apt-get there php7.0, so we can install php7.0 directly:
sudo apt-get install php7.0 -y
Install php-related components:
sudo apt-get install libapache2-mod-php7.0
MySQL Installation Service
MySQL installation process, the console will prompt you to enter the MySQL password, you need to enter the password twice, and remember the password you enter, the next steps will need:
sudo apt-get install mysql-server -y
Install php MySQL related components:
sudo apt-get install php7.0-mysql
Install phpmyadmin
Use apt-get
installation phpmyadmin, the installation process, you need to follow the prompts to select apache2, and then enter the root password and database password:
sudo apt-get install phpmyadmin -y
Establish /var/www/html
flexible connections under:
sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin
Restart MySQL service
sudo service mysql restart
Restart the Apache service:
sudo systemctl restart apache2.service
Install and configure Wordpress
Task time: 10min ~ 20min
Wordpress installation
We need to download a Wordpress archive: [ ? ]
wget https://cn.wordpress.org/wordpress-4.7.4-zh_CN.zip
Once downloaded, unzip the archive
sudo unzip wordpress-4.7.4-zh_CN.zip
After decompression, you will be able to Wordpress to see the Wordpress source folder
Wordpress official website to find an installation package and copy the installation package download path.
Configure a database for wordpress
After entering the mysql, enter the following code, follow the prompts to enter your MySQL password:
mysql -u root -p
Create a database called wordpress to wordpress:
CREATE DATABASE wordpress;
Set up a database for the user to wordpressuser:
CREATE USER wordpressuser;
Configure a password for the user password123:
SET PASSWORD FOR wordpressuser= PASSWORD("password123");
Access to the database of user profiles:
GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser IDENTIFIED BY"password123";
These configurations take effect
FLUSH PRIVILEGES;
Then quit mysql
exit;
Configuration wordpress
Since PHP default access / var / www / html / folder, so we need to wordpress folder files are copied to / var / www / html / folder
sudo mv wordpress/* /var/www/html/
Modify / var / www / html / directory permissions:
sudo chmod -R 777 /var/www/html/
Assigned to the apache index.html
sudo mv /var/www/html/index.html /var/www/html/index~.html
Restart the Apache service:
sudo systemctl restart apache2.service
Test Access
- Web installation interface: HTTP: // <your CVM IP address>
- Blog access address: HTTP: // <your CVM IP address> [ ? ]
If still see it works page, please clear your browser cache reload
Preparation and analytical domain name
Task time: 15min ~ 30min
domain registration
If you do not have a domain name, you can buy Tencent cloud , the process can refer to the video below.
- Video - purchase the domain name on Tencent cloud
DNS
After domain purchase is complete, the domain name resolution needs to experiment on cloud host, IP test cloud host is:
<您的 CVM IP 地址>
Tencent cloud in the domain name purchase may be to add the console resolution records , the process may refer to the following video:
- Video - How to resolve the domain name Tencent cloud
Domain settings parsed need some time to take effect, by ping
whether the entry into force command to check domain name [ ? Such as]:
ping www.yourdomain.com
If the ping command returns information contained in your resolve to set the IP address, indicating successfully resolved.
Note Replace the following command in
www.yourmpdomain.com
your own registered domain name
We're done!
Congratulations, your WordPress blog has been deployed, you can visit the blog to see the effect through a browser.
View by IP address:
Blog access address: HTTP: // <your domain>
View by domain:
Blog access address: http://www.yourdomain.com , which replace the www.yourdomain.com
domain name applications prior to.