Centos 7.3 搭建php7,mysql5.7,nginx1.10.1,redis
# yum update
# wget http://nginx.org/download/nginx-1.15.2.tar.gz
# tar zxvf nginx-1.15.2.tar.gz
# cd nginx-1.15.2
./configure --prefix=/usr/local/nginx \
--pid-path=/usr/local/nginx/run/nginx.pid \
--with-http_ssl_module \
--user=nginx \
--group=nginx \
--with-pcre \
--without-mail_pop3_module \
--without-mail_imap_module \
--without-mail_smtp_module
3.安装
# make
# make install
make完了就说明安装好了
刚才编译的时候讲nginx编译在了/usr/local/nginx文件夹下,过去启动一下
/usr/local/nginx/sbin/nginx
如果没有任何报错 就说明启动成功了
如果出现了下面代码:
nginx: [emerg] getpwnam("nginx") failed
说明你的服务器上没有nginx用户,新建一个用户和用户组,把nginx放进去了,然后设置不能登录就好了。命令如下:
groupadd nginx
useradd -g nginx -M nginx
-g为用户指定组 -M不自动生成home目录,毕竟我们只是让系统上有这个帐号,不给登录权限的
vi /etc/passwd
把/bin/bash改为/sbin/nologin 这样nginx就不能登录了

# yum localinstall http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
# yum install mysql-community-server
yum install mysql-community-devel
# service mysqld start
Redirecting to /bin/systemctl start mysqld.service
# service mysqld status
# grep 'temporary password' /var/log/mysqld.log
# --28T02::.449839Z [Note] A temporary password is generated for root@localhost: 8Ba=2gtz+?wx
mysql -uroot -p
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPasdfs4!';
mysql> quit;
mysql> mysql -uroot -p
cd /root & wget -O php7.tar.gz http://cn2.php.net/get/php-7.0.30.tar.gz/from/this/mirror
tar -xvf php7.tar.gz
cd php-7.0.
yum install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel
# ./configure --prefix=/usr/local/php --with-config-file-path=/etc --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-soap --with-libxml-dir --with-xmlrpc --with-openssl --with-mcrypt --with-mhash --with-pcre-regex --with-sqlite3 --with-zlib --enable-bcmath --with-iconv --with-bz2 --enable-calendar --with-curl --with-cdb --enable-dom --enable-exif --enable-fileinfo --enable-filter --with-pcre-dir --enable-ftp --with-gd --with-openssl-dir --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir --enable-gd-native-ttf --enable-gd-jis-conv --with-gettext --with-gmp --with-mhash --enable-json --enable-mbstring --enable-mbregex --enable-mbregex-backtrack --with-libmbfl --with-onig --enable-pdo --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-zlib-dir --with-pdo-sqlite --with-readline --enable-session --enable-shmop --enable-simplexml --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --with-libxml-dir --with-xsl --enable-zip --enable-mysqlnd-compression-support --with-pear --enable-opcache
.configure: error: xml2-config not found. Please check your libxml2 installation.
解决:# yum install libxml2 libxml2-devel
.configure: error: Cannot find OpenSSL's <evp.h>
解决:# yum install openssl openssl-devel
.configure: error: Please reinstall the BZip2 distribution
解决:# yum install bzip2 bzip2-devel
.configure: error: Please reinstall the libcurl distribution - easy.h should be in <curl-dir>/include/curl/
解决:# yum install libcurl libcurl-devel
.If configure fails try --with-webp-dir=<DIR> configure: error: jpeglib.h not found.
解决:# yum install libjpeg libjpeg-devel
.If configure fails try --with-webp-dir=<DIR>
checking for jpeg_read_header in -ljpeg... yes
configure: error: png.h not found.
解决:# yum install libpng libpng-devel
.If configure fails try --with-webp-dir=<DIR>
checking for jpeg_read_header in -ljpeg... yes
checking for png_write_image in -lpng... yes
If configure fails try --with-xpm-dir=<DIR>
configure: error: freetype-config not found.
解决:# yum install freetype freetype-devel
.configure: error: Unable to locate gmp.h
解决:# yum install gmp gmp-devel
.configure: error: mcrypt.h not found. Please reinstall libmcrypt.
解决:# yum install libmcrypt libmcrypt-devel
如果出现 No package libmcrypt available.
No package libmcrypt-devel available.
执行:#yum install libmcrypt libmcrypt-devel mcrypt mhash epel-release
然后再安装:#yum install libmcrypt libmcrypt-devel
.configure: error: Please reinstall readline - I cannot find readline.h
解决:# yum install readline readline-devel
.configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1. distribution
解决:# yum install libxslt libxslt-devel
make && make install
vim /etc/profile
PATH=$PATH:/usr/local/php/bin
export PATH
# source /etc/profile
# echo $PATH
# php -v
# cp php.ini-production /etc/php.ini
# cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
# cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf
# cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
# chmod +x /etc/init.d/php-fpm
/etc/init.d/php-fpm start
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /$document_root$fastcgi_script_name;
include fastcgi_params;
}
service nginx reload
vim /var/www/html/php7/index.php
<?php
phpinfo();
?>
sudo yum install gcc-c++
wget http://download.redis.io/releases/redis-3.2.8.tar.gz
tar -zxvf redis-3.2..tar.gz
cd redis-3.2.
make MALLOC=libc
make install // make test
./redis-server
you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
echo never > /sys/kernel/mm/transparent_hugepage/enabled
mkdir -p /etc/redis
cp redis.conf /etc/redis
/usr/local/bin/redis-server /etc/redis/redis.conf
ps -ef | grep redis
redis-cli
Centos 7.3 搭建php7,mysql5.7,nginx1.10.1,redis的更多相关文章
- CentOS 7 安装 LNMP 环境(PHP7 + MySQL5.7 + Nginx1.10)
记录下在CentOS 7 安装 LNMP 环境(PHP7 + MySQL5.7 + Nginx1.10)过程笔记. 工具 VMware版本号 : 12.0.0 CentOS版本 : 7.0 一.修改 ...
- 在ubuntu16.04上安装php7 mysql5.7 nginx1.10并支持http2
安装nginx 首先更新软件包 并且安装nginx sudo apt-get update sudo apt-get install nginx 开放防火墙配置 sudo ufw allow 'Ngi ...
- lnmp环境搭建(centos6.9+mysql5.7+php7.1+nginx1.10)
安装前准备:CentOS 6.9 64位 最小化安装 yum install -y make gcc gcc-c++ perl zlib-devel libaio libpng libpng-deve ...
- CentOS 7.2.1511编译安装Nginx1.10.1+MySQL5.7.14+PHP7.0.11
准备篇 一.防火墙配置 CentOS 7.x默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewalld.se ...
- CentOS 7.2mini版本下编译安装php7.0.10+MySQL5.7.14+Nginx1.10
一.安装前的准备工作 1.yum update #更新系统 2.yum install gcc gcc-c++ autoconf automake cmake bison m4 libxml2 ...
- CentOS 7.3.1611编译安装Nginx1.10.3+MySQL5.7.16+PHP7.1.2
前传: 1.CentOS 7.3.1611系统安装配置图解教程 http://www.jb51.net/os/RedHat/597874.html 2.CentOS服务器初始化设置 http://ww ...
- CentOS 7.2mini版本下编译安装php7.0.10+MySQL5.7.14+Nginx1.10.1
一.安装前的准备工作 1.yum update #更新系统 1.1)vi /etc/selinux/config # 禁止SELINUX,设置SELINUX=disabled 2.yum in ...
- CentOS 7.2下编译安装PHP7.0.10+MySQL5.7.14+Nginx1.10.1
一.安装前的准备工作 1.yum update #更新系统 2.yum install gcc gcc-c++ autoconf automake cmake bison m4 libxml2 ...
- CentOS 7.2.1511编译安装Nginx1.10.1+MySQL5.7.15+PHP7.0.11
准备篇 一.防火墙配置 CentOS 7.2默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewalld.se ...
随机推荐
- Linux:sed
[参考文章]:shell中sed命令的用法 [参考文章]:SED 简明教程 1. 简述 sed是一种流编辑器,它是文本处理中非常重要的工具,能够完美的配合正则表达式使用. 执行命令时,一次处理一行内容 ...
- pwn学习日记Day19 《程序员的自我修养》读书笔记
windows PE/COFF章总结 本章学习了windows下的可执行文件和目标文件格式PE/COFF.PE/COFF文件与ELF文件非常相似,它们都是基于段的结构的二进制文件格式.Windows下 ...
- ph:做参考
1 波动学 <伯克利物理学教程>第三卷 上.下册2 场论(朗道)3 场论与粒子物理学(上册)(李政道)出国留学必备书之一!4 场论与粒子物理学(下册)(李政道)5 非平衡态热力 ...
- 微信小程序倒计时的方法
timeOut: function(time) { var that = this; var end = new Date(time).getTime(); var Interval = setInt ...
- kotlin之注解
注解是用来代码添加元数据的一种手段,要声明一个 注解,需要在类之前添加annotation修饰符 annotation class demo 注解其他属性,可以通过向注解类添加元注解的方式来指定 @T ...
- asp.net MVC AngularJS
http://www.cnblogs.com/powertoolsteam/category/834105.html
- jackson将json数组转成List、普通数组。
package com.mkyong; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jacks ...
- Maven项目添加阿里云HBase依赖之后第一行才出现红叉报错“Missing artifact jdk.tools:jdk.tools:jar:1.6”的解决办法
首先是从阿里云上下载了一个样例项目"hbase-demo",然后用eclipse打开,此时eclipse会去下载aliyun.hbase依赖. 等待一段时间后,pom.xml却报错 ...
- iOS-自定义导航控制器
BasicNavigationViewController:UINavigationViwController /* 隐藏导航底部线条 */ -(void)viewDidLoad{ [super ...
- STM32命名规则解析