企业部分--LNMP之博客搭建

在上篇“企业部分–集群中的mysql和PHP的编译安装”的基础下搭建lnmp架构。

什么是lnmp?

LNMP代表的就是:Linux系统下Nginx+MySQL+PHP这种网站服务器架构。
-Nginx是一个高性能的HTTP和反向代理服务器,也是一个IMAP/POP3/SMTP代理服务器。
-Mysql是一个小型关系型数据库管理系统。
-PHP是一种在服务器端执行的嵌入HTML文档的脚本语言。
这四种软件均为免费开源软件,组合到一起,成为一个免费、高效、扩展性强的网站服务系统。

LNMP之搭建博客实现

本篇博客着重于实践,将一步步搭建一个简单的LNMP架构。

1.安装编译Mysql和PHP。

具体操作见:“企业部分–集群中的mysql和PHP的编译安装”。

2.安装编译nginx

cd /root/lnmp/
tar zxf nginx-1.14.0.tar.gz 
cd nginx-1.14.0
vim auto/cc/gcc

企业部分--LNMP之博客搭建
注释debug以简化安装项目

yum install pcre-devel -y

开始编译

 ./configure --prefix=/usr/local/lnmp/nginx --with-http_ssl_module --with-http_stub_status_module --with-threads --with-file-aio --user=nginx --group=nginx

make && make install

3.nginx配置:

cd /usr/local/lnmp/nginx/conf/
vim nginx.conf

企业部分--LNMP之博客搭建

企业部分--LNMP之博客搭建
企业部分--LNMP之博客搭建

将index.php放在第一位,访问nginx时先显示index.php的内容。

企业部分--LNMP之博客搭建

fastcgi.conf:添加fastcgi模块。(介绍见文章末尾)

ln -s /usr/local/lnmp/nginx/sbin/nginx /usr/local/sbin/
vim /usr/local/lnmp/nginx/html/index.php

企业部分--LNMP之博客搭建
cd /usr/local/lnmp/nginx/html/
ls
企业部分--LNMP之博客搭建

nginx
nginx -s reload

测试:
企业部分--LNMP之博客搭建

4.博客搭建

yum install unzip                ##下载unzip
unzip Discuz_X3.2_SC_UTF8.zip -d /usr/local/lnmp/nginx/html/  ##将php论坛解压在nginx发布目录
cd /usr/local/lnmp/nginx/html/
ls
mv upload/ bbs

企业部分--LNMP之博客搭建

测试 企业部分--LNMP之博客搭建

企业部分--LNMP之博客搭建
权限不够给权限.

cd bbs
chmod 777 config/ -R
chmod 777 data/ -R
chmod 777 uc_server/ uc_client/ -R

重载页面

企业部分--LNMP之博客搭建
企业部分--LNMP之博客搭建
企业部分--LNMP之博客搭建

vim /usr/local/lnmp/php/etc/php.ini      ##填写更改socket的路径

企业部分--LNMP之博客搭建
企业部分--LNMP之博客搭建
企业部分--LNMP之博客搭建
/etc/init.d/php-fpm reload

重载页面

企业部分--LNMP之博客搭建

chmod 755 /usr/local/lnmp/mysql/data/

重载页面

企业部分--LNMP之博客搭建
企业部分--LNMP之博客搭建
搭建成功!!!!!!!