LNMP环境--搭建Discuz论坛
为什么80%的码农都做不了架构师?>>>
安装php
下载和解压
wget http://cn2.php.net/distributions/php-5.6.30.tar.gztar -zxvf php-5.6.30.tar.gz
进入解压后php目录
cd php-5.6.30
编译和make
#编译
./configure --prefix=/usr/local/php-fpm --with-config-file-path=/usr/local/php-fpm/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm -with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-libmcrypt=/usr/local/libmcrypt --enable-soap --enable-gd-native-tty --enable-ftp --enable-mbstring --enable-exif--with-pear --with-curl --with-openssl#make
make && make install
编译php所遇到的错误及解决方法
1.error: xml2-config not found. Please check your libxml2 installation.解决:
yum install -y libxml2-devel2.error: Cannot find OpenSSL's <evp.h>解决:
yum install -y openssl-devel3.error: Please reinstall the libcurl distribution -easy.h should be in <curl-dir>/include/curl/解决:
yum install -y libcurl-devel4.error: jpeglib.h not found.
解决:
yum install -y libjpeg-turbo-devel5.error: png.h not found.解决:
yum install -y libpng-devel6.error: freetype-config not found.解决:
yum install -y freetype-devel7.error: Cannot find MySQL header files under /usr/local/mysql.
Note that the MySQL client library is not bundled anymore!解决:wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.35-linux-glibc2.5-x86_64.tar.gztar -zxvf mysql-5.6.35-linux-glibc2.5-x86_64.tar.gzmv mysql-5.6.35-linux-glibc2.5-x86_64 /usr/local/mysql
拷贝配置文件
cp php.ini-production /usr/local/php-fpm/etc/php.ini
拷贝启动脚本
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm#赋予权限
chmod 755 /etc/init.d/php-fpm
进入 /usr/local/php-fpm/etc/下,创建php-fpm.conf
vim php-fpm.conf[global]
pid = /usr/local/php-fpm/var/run/php-fpm.pid
error_log = /usr/local/php-fpm/var/log/php-fpm.log
[www]
#listen = /tmp/php-fcgi.sock
listen = 127.0.0.1:9000
listen.mode = 666
user = php-fpm
group = php-fpm
pm = dynamic
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 500
rlimit_files = 1024
把php-fpm加入服务列表及开机启动
chkconfig --add php-fpm
chkconfig php-fpm on
启动php
#启动
service php-fpm start
Starting php-fpm [02-Oct-2017 18:17:39] ERROR: [pool www] cannot get uid for user 'php-fpm'
[02-Oct-2017 18:17:39] ERROR: FPM initialization failedfailed说明:启动报错,需要创建php-fpm用户#创建php-fpm用户
useradd php-fpm#重新启动就成功了
service php-fpm start
安装nginx
下载和解压nginx
wget http://nginx.org/download/nginx-1.12.1.tar.gztar -zxvf nginx-1.12.1.tar.gz
编译和make
#进入nginx目录
cd nginx-1.12.1#编译
./configure --prefix=/usr/local/nginx#make
make && make install
给nginx创建启动脚本
vim /etc/init.d/nginx #!/bin/bash
# chkconfig: - 30 21
# description: http service.
# Source Function Library
. /etc/init.d/functions
# Nginx Settings
NGINX_SBIN="/usr/local/nginx/sbin/nginx"
NGINX_CONF="/usr/local/nginx/conf/nginx.conf"
NGINX_PID="/usr/local/nginx/logs/nginx.pid"
RETVAL=0
prog="Nginx"
start()
{echo -n $"Starting $prog: "mkdir -p /dev/shm/nginx_tempdaemon $NGINX_SBIN -c $NGINX_CONFRETVAL=$?echoreturn $RETVAL
}
stop()
{echo -n $"Stopping $prog: "killproc -p $NGINX_PID $NGINX_SBIN -TERMrm -rf /dev/shm/nginx_tempRETVAL=$?echoreturn $RETVAL
}
reload()
{echo -n $"Reloading $prog: "killproc -p $NGINX_PID $NGINX_SBIN -HUPRETVAL=$?echoreturn $RETVAL
}
restart()
{stopstart
}
configtest()
{$NGINX_SBIN -c $NGINX_CONF -treturn 0
}
case "$1" instart)start;;stop)stop;;reload)reload;;restart)restart;;configtest)configtest;;*)echo $"Usage: $0 {start|stop|reload|restart|configtest}"RETVAL=1
esac
exit $RETVAL#设置权限
chmod 755 /etc/init.d/nginx
自定义nginx.conf
user nobody nobody;
worker_processes 2;
error_log /usr/local/nginx/logs/nginx_error.log crit;
pid /usr/local/nginx/logs/nginx.pid;
worker_rlimit_nofile 51200;
events
{use epoll;worker_connections 6000;
}
http
{include mime.types;default_type application/octet-stream;server_names_hash_bucket_size 3526;server_names_hash_max_size 4096;log_format combined_realip '$remote_addr $http_x_forwarded_for [$time_local]'' $host "$request_uri" $status'' "$http_referer" "$http_user_agent"';sendfile on;tcp_nopush on;keepalive_timeout 30;client_header_timeout 3m;client_body_timeout 3m;send_timeout 3m;connection_pool_size 256;client_header_buffer_size 1k;large_client_header_buffers 8 4k;request_pool_size 4k;output_buffers 4 32k;postpone_output 1460;client_max_body_size 10m;client_body_buffer_size 256k;client_body_temp_path /usr/local/nginx/client_body_temp;proxy_temp_path /usr/local/nginx/proxy_temp;fastcgi_temp_path /usr/local/nginx/fastcgi_temp;fastcgi_intercept_errors on;tcp_nodelay on;gzip on;gzip_min_length 1k;gzip_buffers 4 8k;gzip_comp_level 5;gzip_http_version 1.1;gzip_types text/plain application/x-javascript text/css text/htm application/xml;server{listen 80;server_name localhost;index index.html index.htm index.php;root /data/www/discuz;location ~ \.php$ {include fastcgi_params;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME /data/www/discuz$fastcgi_script_name;} }
}
把nginx加入服务列表及开机启动
chkconfig --add nginxchkconfig nginx on
安装discuz
安装准备
#创建安装目录
mkdir -p /data/www/discuz#进入目录
cd /data/www/discuz#下载安装包
wget http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_UTF8.zip#解压
unzip Discuz_X3.2_SC_UTF8.zip #将安装文件移动到指定目录mv upload/* ./#删除无关文件rm -rf readme upload utility Discuz_X3.2_SC_UTF8.zip#根据readme.txt文件提示执行如下操作
chmod 777 -R data config uc_client uc_server
开始安装
浏览器访问discuz安装目录所对应的站点 discuz.com (执行该操作前将域名和IP加入本地hosts),然后根据浏览器中的提示进行后续操作。
检查安装环境
说明:环境检查;目录、文件权限检查;函数依赖性检查,需所有显示打钩,说明没问题,执行下一步.
设置运行环境
说明:第一次安装所以需要选择全新安装
数据库设置
#登录Mysql
mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.35 MySQL Community Server (GPL)Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.#创建discuz库
mysql> create database discuz;
Query OK, 1 row affected (0.00 sec)#创建discuz用户和设置密码,以及来源IP
mysql> grant all on discuz.* to 'discuz'@'192.168.2.157' identified by '123456';
Query OK, 0 rows affected (0.05 sec)mysql> quit
Bye
数据库配置
说明:只需填写红色框框圈起来的地方,其余保持默认,点击下一步完成安装
显示已经安装成功
说明: 使用刚刚设置的管理员用户名和密码登录即可(管理员用户名:admin 密码:123456)
转载于:https://my.oschina.net/AnnaWu/blog/1546624
LNMP环境--搭建Discuz论坛相关推荐
- Nginx环境搭建Discuz论坛
1.简介: Crossday Discuz! Board(简称 Discuz!)是北京康盛新创科技有限责任公司推出的一套通用的社区论坛软件系统.自2001年6月面世以来,Discuz!已拥有14年以上 ...
- Nginx实战基础篇六 通过源码包编译安装部署LNMP搭建Discuz论坛
Nginx实战基础篇六 通过源码包编译安装部署LNMP搭建Discuz论坛 版权声明: 本文遵循"署名非商业性使用相同方式共享 2.5 中国大陆"协议 您可以自由复制.发行.展览. ...
- 手把手教你,嘴对嘴传达------源码编译LNMP部署及应用 , 手动搭建discuz论坛
文章目录 前言 一.LNMP架构的部署(理论) 1.LNMP架构概述 2.MySQL安装配置 3.PHP解析环境的安装 4.配置Ngnx支持PHP环境 5.常见的PHP开源产品介绍 二.LNMP应用部 ...
- LNMP架构以及Discuz论坛搭建
LNMP架构以及Discuz论坛搭建 文章目录 LNMP架构以及Discuz论坛搭建 前言 实验环境 实验所需要的源码包 实验步骤 1.Nginx的搭建 2.MySQL的搭建 3.PHP的搭建 实验测 ...
- LNMP架构安装及搭建Discuz论坛
文章目录 一.LNMP概述 1.LNMP 2.Nginx 3.MySQL 4.PHP 5.LNMP工作原理 二.安装Nginx服务 1.关闭防火墙及SElinux 2.将nginx软件包拖入到/opt ...
- 转载:linux环境下搭建discuz论坛
今天写一个Linux下搭建Discuz论坛的全过程教程. 本例使用的Linux系统为:RHEL5.3. 1.[root@linux ~]# mkdir /mnt/cdrom 2.[root@linux ...
- CentOS7下搭建Discuz论坛
搭建Discuz论坛的前提条件: LNMP环境 Discuz压缩包 一.检查各服务是否已经启动并且进程正常 检查Nginx服务的进程是否已启动和是否有监听80端口: [root@localhost ~ ...
- ngnix之lnmp环境搭建及Dvbbs搭建
LNMP环境搭建 引导语:前面我们做过LAMP环境的搭建,而对于后起之秀nginx而言,其性能相对apache提高了很多, 故本实验借助于nginx来LNMP环境, 环境搭建分三步:mysql绿色包安 ...
- LAMP搭建Discuz论坛
搭建Discuz论坛 1. 准备LAMP环境 LAMP是Linux,Apache,MySql和PHP的缩写,是Discuz论坛系统依赖的基础运行环境 1.安装Apache2 Ubuntu需要安装Ap ...
最新文章
- linux进入节点权限,一种基于索引节点的Linux访问权限控制方法与流程
- 写论文神器APEX-NET:自动重新绘制图像
- 二.第五单元 lvm管理
- xp与Linux双系统共存
- 汇编 整数变量 浮点数变量 符号常量
- ElasticSearch的update_by_query使用
- HDU3930(离散对数与原根)
- Spark算子:统计RDD分区中的元素及数量
- Xshell连接FTP服务器
- css 3D 旋转 - Demo
- 欣赏的心态去发现生活中的美
- pytorch中的normalize应用
- Weakly-Supervised Physically Unconstrained Gaze Estimation论文翻译
- 数据结构第一次上机实验报告
- POJ-3255 Roadblocks
- JAVA 画图 给图片底部添加文字标题
- Voron2.2 3D打印机制作-软件篇(1)
- Delong test
- 计算机网络的物理层 基本概念
- 面试突击81:什么是跨域问题?如何解决?
热门文章
- csp认证多少分通过_一级结构工程师考试难不难?多少分通过?
- sscanf 实现_中国实现全球首个5G独立组商网,5G还没铺完6G重磅方案已经出台!...
- 单例设计模式 序列化破坏单例模式原理解析及解决方案?
- SpringCloud 从菜鸟到大牛之六 消息和异步 MQ
- WxParse手机端报console.dir错误
- 多级反向代理下,Java获取请求客户端的真实IP地址多中方法整合
- 《Go 语言程序设计》读书笔记 (九) 命令工具集
- Spring IOC核心原理分析
- nodejs通过响应回写的方式渲染页面资源
- fusion按照多个centos,设置静态ip