첫째, 기본 환경
lnmp 1 국 ECS 1 SLB 2 세트 RDS 스테이션로드 밸런싱
두, lnmp 빌드
Nginx의 1, # 얌 저장소 구성
2, # 냠 -y의 nginx를 설치
3, # yum을 설치 -y PHP는 PHP-MySQL은 GD의 PHP-GD
. 4, [루트 zjz1 @ ~] # 개의 빔의 /etc/nginx/conf.d/default.conf (구성 파일 연결의 nginx의 PHP를 수정하는)
. 5 [아파치 루트 @ ~] # 개의 RM -rf는 / usr / share / HTML / *
[아파치 루트 @ ~] # 빔 /usr/share/html/index.php (테스트 연결)
<? PHP
$ 링크 =로 mysql_connect ( '데이터베이스 네트워크 주소', '로그인', '암호');
IF ($ 링크)
"successfuly"에코;
(가) 다른
"Faile을"에코;
mysql_close를 ();
?>
6 [루트 @의 zjz1 ~] # systemctl 다시 시작의 nginx
7, 테스트 액세스
세, SLB 및 RDS
1 SLB 부하 개의 ECS 바인딩 균형
2, 데이터베이스 권한 부여 및 계정 로그인 허용 된 사이트 목록
3는 워드 프레스 라이브러리를 생성 할 MySQL의 데이터베이스 로그
넷째, 온라인 블로그 코드
하나는 / 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)
图形方式