01.部署linux系统
02.部署nginx网站服务
03.部署mysql数据库服务
04.部署php动态解析服务
01.配置Nginx配置文件
02.配置mysql数据库信息(SQL语句)
03.配置wordpress博客网站
01.数据库数据信息迁移(web服务器上的mysql数据 迁移到10.0.0.51 数据库服务器上)
02.将本地储存数据挂载到NFS共享储存服务器里(共享储存用户上传的数据信息)
工作原理讲解说明:
①. 用户请求的静态文件,由nginx服务自行处理,根据静态的location配置进行处理
用户请求的动态文件,由php服务进行处理,根据动态的location配置进行处理
②. nginx服务接收到动态请求,会将请求抛送给fastcgi,类似于nginx服务接收动态请求的秘书,秘书会将动态请求送给PHP程序
③. PHP如果可以处理,会将处理结果直接通过fastcgi返回给nginx程序;如果不可以处理,还会请求后端数据库,最终再把处理结果返回给nginx
基本优化(ip地址 yum更新 字符集)
安全优化完成(iptables关闭 selinux关闭 tmp目录权限777)
说明:详细配置参见 https://www.cnblogs.com/znix/p/7736899.html
- [root@web01 ~]# cat /etc/redhat-release
- CentOS release 6.9 (Final)
- [root@web01 ~]# uname -r
- 2.6.32-696.el6.x86_64
- yum install - y pcre - devel openssl - devel
pcre:兼容perl语言正则表达式,perl compatible regular expressions
rewirte模块 参数信息(perl方式定义正则表达式)
openssl:ssh---openssh/openssl---https
总结:所有安装依赖软件,后面都要加上-devel
- wget http://nginx.org/download/nginx-1.10.2.tar.gz
说明:软件很小,用心查看一下
解压软件
- tar xf nginx - 1.10.2.tar.gz
- useradd - M - s / sbin / nologin www
软件编译安装步骤
a>软件解压配置(将软件程序安装到哪个目录中 开启nginx软件的哪些功能)
b>软件编译过程
c>软件编译安装过程
注意顺序,顺序不对软件安装会出错
1、配置软件,在软件的解压目录中
- [root@web01 nginx - 1.10.2]#. / configure--prefix = /application/nginx - 1.10.2--user = www--group = www--with - http_stub_status_module--with - http_ssl_module
编译参数说明:
--prefix 表示指定软件安装到哪个目录中,指定目录不存在会自动创建
--user/--group nginx工作进程由哪个用户运行管理
--with-http_stub_status_module 启动nginx状态模块功能(用户访问nginx的网络信息)
--with-http_ssl_module 启动https功能模块
通过软件编译过程中的返回值是否正确,确认配置是否正确
- [root@web01 nginx-1.10.2]# echo $?
- 0
2、编译软件
- [root@web01 nginx - 1.10.2]#make
3、编译安装
- [root@web01 nginx - 1.10.2]#make install
- [root@web01 application]#ln - s / application / nginx - 1.10.2 / /application/nginx
- [root@web01 conf]# egrep -v "#|^$" nginx.conf.default >nginx.conf
- [root@web01 application]# /application/nginx/sbin/nginx
- [root@web01 application]#
检查是否启动
- [root@web01 application]# ps -ef |grep nginx
- root 26548 1 0 20:13 ? 00:00:00 nginx: master process /application/nginx/sbin/nginx
- www 26549 26548 0 20:13 ? 00:00:00 nginx: worker process
- root 26551 23431 3 20:13 pts/0 00:00:00 grep --color=auto nginx
检查端口信息
- [root@web01 application]# netstat -lntup |grep 80
- tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 26548/nginx
服务部署完成, 修改hosts解析文件,进行浏览器访问测试
至此软件安装完毕!
这里使用的是5.6.34版本;在下载mysql的时候一定要注意与系统匹配的版本。
- mysql - 5.6.34 - linux - glibc2.5 - x86_64.tar.gz
方法一:mysql官网下载地址
https://dev.mysql.com/downloads/mirrors/
尽量使用ftp下载,http的下载方式较为繁琐。下载的时候选择与自己近的服务进行下载即可。
方法二: 使用搜狐的镜像站也可以进行下载,注意使用的软件版本。
http://mirrors.sohu.com/mysql/
来源: http://www.cnblogs.com/clsn/p/8025324.html