sed -i 's/SELINUX=enabled/SELINUX=disabled/g' /etc/selinux/config

getenforce 0

/etc/init.d/iptables stop

cat /etc/redhat-release

uname -r

uname -m

#安装nginx

#su -

#chmod 777 /usr/local/src

yum -y install  wget libtool expat-devel pcre-devel zlib-devel openssl openssl-devel pcre

yum -y install gcc gcc-c++ glibc automake autoconf libtool make

yum -y install libmcrypt-devel mhash-devel libxslt-devel \

libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel \

zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel \

ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel \

krb5 krb5-devel libidn libidn-devel openssl openssl-devel

#安装pcre

cd /usr/local/src

wget http://sourceforge.net/projects/pcre/files/pcre/8.39/pcre-8.39.tar.gz/download -O  pcre-8.39.tar.gz

tar -zxvf pcre-8.39.tar.gz

cd pcre-8.39

./configure

make && make install

#安装zlib

cd /usr/local/src

wget http://zlib.net/zlib-1.2.11.tar.gz

tar -zxvf zlib-1.2.11.tar.gz

cd zlib-1.2.11

./configure

make && make install

#安装openssl

cd /usr/local/src

wget https://www.openssl.org/source/openssl-1.1.0b.tar.gz

tar -zxvf openssl-1.1.0b.tar.gz

cd openssl-1.1.0b

./config

make && make install

#安装nginx

cd /usr/local/src

wget http://nginx.org/download/nginx-1.10.2.tar.gz

tar -zxvf nginx-1.10.2.tar.gz

cd nginx-1.10.2

groupadd -r nginx

useradd -r -g nginx nginx

./configure \

--prefix=/usr/local/nginx \

--sbin-path=/usr/local/nginx/sbin/nginx \

--conf-path=/usr/local/nginx/nginx.conf \

--pid-path=/usr/local/nginx/nginx.pid \

--user=nginx \

--group=nginx \

--with-http_ssl_module \

--with-http_flv_module \

--with-http_mp4_module  \

--with-http_stub_status_module \

--with-http_gzip_static_module \

--http-client-body-temp-path=/var/tmp/nginx/client/ \

--http-proxy-temp-path=/var/tmp/nginx/proxy/ \

--http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ \

--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi \

--http-scgi-temp-path=/var/tmp/nginx/scgi \

--with-pcre=/usr/local/src/pcre-8.39 \

--with-zlib=/usr/local/src/zlib-1.2.11 \

--with-openssl=/usr/local/src/openssl-1.1.0b \

;

make && make install

netstat -ano|grep 80

mkdir -p /var/tmp/nginx/client

/usr/local/nginx/sbin/nginx

#搭建MYSQL

useradd -s /sbin/nologin -M mysql

wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz

tar -zxvf mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz

mv mysql-5.7.17-linux-glibc2.5-x86_64 /usr/local/mysql-5.7.17

ln -s /usr/local/mysql-5.7.17 /usr/local/mysql

#创建数据库文件目录

mkdir -p /data/mysql

chown -R mysql.mysql /data/

#配置启动脚本文件,并加入系统服务,自启动

cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld

chmod +x /etc/init.d/mysqld

chkconfig --add mysqld

chkconfig mysqld on

#配置mysql配置文件

cat > /etc/my.cnf << EOF

[client]

port = 3306

socket = /tmp/mysql.sock

default-character-set = utf8

[mysqld]

port = 3306

socket = /tmp/mysql.sock

basedir = /usr/local/mysql

datadir = /data/mysql

pid-file = /data/mysql/mysql.pid

user = mysql

bind-address = 0.0.0.0

server-id = 1

init-connect = 'SET NAMES utf8'

character-set-server = utf8

#skip-name-resolve

#skip-networking

back_log = 300

max_connections = 1000

max_connect_errors = 6000

open_files_limit = 65535

table_open_cache = 128

max_allowed_packet = 4M

binlog_cache_size = 1M

max_heap_table_size = 8M

tmp_table_size = 16M

read_buffer_size = 2M

read_rnd_buffer_size = 8M

sort_buffer_size = 8M

join_buffer_size = 8M

key_buffer_size = 4M

thread_cache_size = 8

query_cache_type = 1

query_cache_size = 8M

query_cache_limit = 2M

ft_min_word_len = 4

log_bin = mysql-bin

binlog_format = mixed

expire_logs_days = 30

log_error = /data/mysql/mysql-error.log

slow_query_log = 1

long_query_time = 1

slow_query_log_file = /data/mysql/mysql-slow.log

performance_schema = 0

explicit_defaults_for_timestamp

#lower_case_table_names = 1

skip-external-locking

default_storage_engine = InnoDB

#default-storage-engine = MyISAM

innodb_file_per_table = 1

innodb_open_files = 500

innodb_buffer_pool_size = 64M

innodb_write_io_threads = 4

innodb_read_io_threads = 4

innodb_thread_concurrency = 0

innodb_purge_threads = 1

innodb_flush_log_at_trx_commit = 2

innodb_log_buffer_size = 2M

innodb_log_file_size = 32M

innodb_log_files_in_group = 3

innodb_max_dirty_pages_pct = 90

innodb_lock_wait_timeout = 120

bulk_insert_buffer_size = 8M

myisam_sort_buffer_size = 8M

myisam_max_sort_file_size = 10G

myisam_repair_threads = 1

interactive_timeout = 28800

wait_timeout = 28800

[mysqldump]

quick

max_allowed_packet = 16M

[myisamchk]

key_buffer_size = 8M

sort_buffer_size = 8M

read_buffer = 4M

write_buffer = 4M

EOF

#初始化数据库:

/usr/local/mysql/bin/mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql

#配合环境变量

echo "export PATH=$PATH:/usr/local/mysql/bin" >>/etc/profile

. /etc/profile

#启动MySQL服务

/etc/init.d/mysqld start

#修改root密码

mysql -uroot

#mysql -uroot -pk8008.com -e "use mysql;update user set authentication_string=password('新密码') where user='root';"

update mysql.user set authentication_string=password("xmrbiyfzx2016") where user='root';

#安装PHP

#安装第三方yum源

wget http://www.atomicorp.com/installers/atomic

sh ./atomic

#使用yum命令安装

yum -y install  libxml libjpeg freetype libpng gd curl libiconv zlib-devel gd-devel curl-devel openssl-devel libxslt-devel

php-mcrypt libmcrypt libmcrypt-devel mhash mhash-devel libevent libevent-devel libxml2 libxml2-devel bzip2-devel libcurl-

devel libjpeg-devel libpng-devel freetype-devel

yum -y install zlib

wget http://mirrors.sohu.com/php/php-5.6.30.tar.gz

tar zxvf php-5.6.30.tar.gz

cd php-5.6.30

./configure \

--prefix=/usr/local/php \

--with-config-file-path=/usr/local/php/etc \

--enable-inline-optimization \

--enable-fpm \

--with-mysql=/usr/local/mysql \

--with-mysqli=/usr/local/mysql/bin/mysql_config \

--with-pdo-mysql=/usr/local/mysql \

--with-gettext \

--enable-mbstring \

--with-iconv=/usr/local/libiconv \

--with-mcrypt \

--with-mhash \

--enable-bcmath \

--enable-soap \

--with-libxml-dir \

--enable-sockets \

--with-curl \

--with-zlib \

--enable-zip \

--with-bz2 \

--with-gd \

--with-freetype-dir \

--with-jpeg-dir \

--with-iconv \

--with-png-dir

#--with-openssl \

make

make install

cp php.ini-production /usr/local/php/etc/php.ini

#到此LNMP安装完成!

mkdir /usr/local/nginx/xmrbi.wiki.com

##配置nginx

user  www www;

pid /var/run/nginx.pid;

worker_processes auto;

worker_rlimit_nofile 100000;

events

{

use epoll;

multi_accept on;

worker_connections 51200;

}

http {

server_tokens off;

sendfile on;

tcp_nopush on;

tcp_nodelay on;

access_log off;

error_log /var/log/nginx/error.log crit;

keepalive_timeout 10;

client_header_timeout 10;

client_body_timeout 10;

reset_timedout_connection on;

send_timeout 10;

limit_conn_zone $binary_remote_addr zone=addr:5m;

limit_conn addr 100;

include /usr/local/nginx/mime.types;

default_type text/html;

charset UTF-8;

gzip on;

gzip_disable "msie6";

gzip_proxied any;

gzip_min_length 1000;

gzip_comp_level 6;

gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss

text/javascript;

gzip_disable “MSIE [1-6].(?!.*SV1)”;

open_file_cache max=100000 inactive=20s;

open_file_cache_valid 30s;

open_file_cache_min_uses 2;

open_file_cache_errors on;

include /usr/local/nginx/conf.d/*.conf;

server  {

listen 9001;

location ~ /nginx_status {

stub_status on;

access_log off;

allow all;

#deny all;

}

}

server {

server_name xmrbi.wiki.com;

server_name 172.16.50.51;

listen 80;

autoindex off;

client_max_body_size 15M;

client_body_buffer_size 128k;

index index.html index.htm index.php doku.php;

access_log  /usr/local/nginx/xmrbi.wiki.com/access.log;

error_log  /usr/local/nginx/xmrbi.wiki.com/error.log;

root /usr/local/nginx/html/dokuwiki;

location / {

try_files $uri $uri/ @dokuwiki;

}

location ~ ^/lib.*\.(gif|png|ico|jpg)$ {

expires 30d;

}

location = /robots.txt  { access_log off; log_not_found off; }

location = /favicon.ico { access_log off; log_not_found off; }

location ~ /\.          { access_log off; log_not_found off; deny all; }

location ~ ~$           { access_log off; log_not_found off; deny all; }

location @dokuwiki {

rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;

rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;

rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;

rewrite ^/(.*) /doku.php?id=$1 last;

}

location ~ \.php$ {

try_files $uri =404;

fastcgi_pass   unix:/var/run/php-fpm/xmrbi.wiki.com.sock;

fastcgi_index  index.php;

fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;

include /usr/local/nginx/fastcgi_params;

fastcgi_param  QUERY_STRING     $query_string;

fastcgi_param  REQUEST_METHOD   $request_method;

fastcgi_param  CONTENT_TYPE     $content_type;

fastcgi_param  CONTENT_LENGTH   $content_length;

fastcgi_intercept_errors        on;

fastcgi_ignore_client_abort     off;

fastcgi_connect_timeout 60;

fastcgi_send_timeout 180;

fastcgi_read_timeout 180;

fastcgi_buffer_size 128k;

fastcgi_buffers 4 256k;

fastcgi_busy_buffers_size 256k;

fastcgi_temp_file_write_size 256k;

}

location ~ /(data|conf|bin|inc)/ {

deny all;

}

location ~ /\.ht {

deny  all;

}

}

}

##php高并发nginx优化http://www.cnblogs.com/dawnlee/p/5142724.html

cd /usr/local/php/etc

cp php-fpm.conf.default php-fpm.conf

##vi php-fpm.conf

listen = /var/run/php-fpm/xmrbi.wiki.com.sock

listen.backlog = 65535

listen.owner = www

listen.group = www

listen.mode = 0660

###################

chmod 777 -R /usr/local/nginx/html/dokuwiki

/usr/local/php/sbin/php-fpm

/usr/local/nginx/sbin/nginx -s reload

LNMP搭建HDwiki相关推荐

  1. centos 桥接配置 设置网络代理 lnmp搭建

    一.桥接配置 centos设置  编辑->虚拟网络编辑器->桥接模式->还原默认设置 虚拟机->设置->网络适配器->桥接 cd /etc/sysconfig/ne ...

  2. Nginx实战基础篇六 通过源码包编译安装部署LNMP搭建Discuz论坛

    Nginx实战基础篇六 通过源码包编译安装部署LNMP搭建Discuz论坛 版权声明: 本文遵循"署名非商业性使用相同方式共享 2.5 中国大陆"协议 您可以自由复制.发行.展览. ...

  3. 实操:基于LNMP搭建zabbix监控

    文章目录 一:环境准备: 二:zabbix概述 2.1 查看官网 2.2 zabbix与nagios 2.3 zzbbix介绍 2.4 zabbix软件包 三:基于LNMP搭建zabbix 3.1 创 ...

  4. LNMP搭建过程详解,验证搭建论坛

    LNMP搭建过程详解,验证搭建论坛 一.安装Nginx服务 1.安装依赖包 2.创建运行用户 3.编译安装 4.优化路径 5.添加Nginx 系统服务 二.安装MySQL服务 1.安装Mysql环境依 ...

  5. LNMP搭建+论坛搭建

    LNMP搭建+论坛搭建 一:关闭防火墙 systemctl stop firewalld systemctl disable firewalld setenforce 0 二:创建运行用户 usera ...

  6. CentOS 7.4 基于LNMP搭建wordpress

    之前有好多次搭建wordpress的经历,有在Ubuntu系统上,有在CentOS7.2系统上,但都是搭完还是稀里糊涂的,因为好多都是教程上照着敲的.这次好好出个教程,以便以后方便查看. 准备工作:C ...

  7. Lnmp搭建zabbix运维监控系统

    使用目的? 在公司项目中需要做一个日志监控,最开始选择的是efk,但是efk的资料相对较少并且之前对这几个产品都没接触过,使用起来难度.于是选择了zabbix作为项目的运维监控系统. zabbix能做 ...

  8. 部署LNMP并利用LNMP搭建wordpress论坛

    1.LNMP是什么? LNMP是指一组通常一起使用来运行动态网站或者服务器的自由软件名称首字母缩写.L指Linux,N指Nginx,M一般指MySQL,也可以指MariaDB,P一般指PHP,也可以指 ...

  9. centos6 搭建hdwiki

    前期准备:安装好Mysql+apache+PHP,测试apache能够解析index.php文件后就可以. 用户名 xiaohe 密码 123456 #### mysql安装好后: adduser w ...

最新文章

  1. CheckStyle
  2. Qt学习笔记之网络相关概念
  3. CS224n笔记一:开端
  4. Python基础-----列表、元组、集合(2)
  5. 用PHP做一道单选选择题的页面,【大神看过来】根据一个用PHP做的单选投票,改成多选,且可显示...
  6. ios 监测网页按钮_苹果IOS备忘录便签软件敬业签恢复删除内容应该怎么操作?...
  7. Django REST framework 的快速入门教程
  8. python中双向索引_对索引Include子句的深入分析
  9. 百练6183-人民币支付-2014正式A题
  10. 【空间分析-文章学习笔记】1 基于卫星数据反演及空间分析方法对由pm2.5引导的中国男性肺癌的发病率的预测
  11. 转 Java工程师成神之路
  12. Deeping Learning学习与感悟——《深度学习工程师》_1
  13. Cannot use import statement outside a module
  14. Ubuntu常用软件下载以及视频流裁剪转码获取教程(可直接下载油管、B站、优酷等视频资源!)
  15. Yii2中如何使用CodeCeption
  16. parse_depend_manifests Could not find dependent assembly LMicrosoft.Windows.Common-Controls
  17. laravel评价详情及商家回复api
  18. GTC2019大会的部分总结
  19. 未来侠机器人教育:不能脱离教育的本质去谈机器人教育培训
  20. 是对马的鬼魂日本RPG

热门文章

  1. 美女图片采集器 源码+解析
  2. 扫码签到突破100000用户
  3. 两因素身份验证增强您的Spring Security
  4. spo0lsv病毒分析
  5. 概率的性质——连续性
  6. Java-TreeSet与Comparable的详讲与实现
  7. html a href 文件下载 IE直接打开 内容乱码
  8. web全栈工程师简历
  9. 网络分层和对应的协议列表
  10. 最新发布!2018年区块链数字货币项目最赚钱方法排行榜