aliyun ride from zero to a blog

First, the basic environment

lnmp 1 station load balancing SLB 2 sets RDS station ECS 1

 Two, lnmp build

1, # yum repository configuration of nginx

2、#yum install  -y  nginx

3、#yum -y install   php   php-mysql   gd  php-gd

. 4, [the root zjz1 @ ~] # Vim /etc/nginx/conf.d/default.conf (to modify the configuration files connected nginx php)

 . 5, [Apache the root @ ~] # RM -rf / usr / Share / HTML / *
     [Apache the root @ ~] # Vim /usr/share/html/index.php (test connection)
<? PHP
$ Link = mysql_connect ( 'database network address', 'login', 'password');
IF ($ Link)
echo "successfuly";
the else
echo "Faile";
mysql_close ();
?>

6、[root@zjz1 ~]# systemctl restart nginx

7, test access

 

Three, slb and rds

1, SLB load balancing to bind the two ECS

2, database authorization and account login whitelist

 

3, log mysql database to create a wordpress library

 Fourth, on-line blog codes

1、/usr/share/nginx/html/

 [root@zjz1 html]# unzip wordpress-5.0.4.zip  (上传博客代码压缩包并解压到nginx网页文件夹)

 

[root@zjz1 ~]# chmod 755 -R  /usr/share/nginx/html/*
[root@zjz1 ~]# cd /usr/share/nginx/html/

[root@zjz1 html]# vim wp-config.php

..........复制上图中的代码


2、 远程登录rds查看,查看数据是否写入。

[root@zjz1 html]# mysql -h rm-j6cxjn3uog9w77d23.mysql.rds.aliyuncs.com -uroot -pJsc151404
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is 3574
Server version: 5.7.25-log Source distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [(none)]> create database wordpress;
Query OK, 1 row affected (0.01 sec)

图形方式

 

Guess you like

Origin www.cnblogs.com/zjz20/p/11723406.html