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 ...
随机推荐
- 2019balsn两道web和2019巅峰极客一道web记录
遇到3道有点意思的web,记录一下~ web1 题目地址:http://warmup.balsnctf.com/ 源码如下所示: <?php if (($secret = base64_deco ...
- StringBuffer中delete与setLength清空字符串效率比较
问题: StringBuffer中有delete.setLength两个方法可以快速清空字符数组.哪个效率高呢? 结论:从清空字符串角度看,两者效率都很高,比较来看,setLength效率更高. 分析 ...
- 获得数据源和路径desc.catalogPath
workspace:C:\Users\dell\Documents\ArcGIS\Default.gdb\ddf inPath:c:\users\dell\documents\arcgis\defau ...
- [go]template使用
//index.html {{if gt .Age 18}} <p>hello, old man, {{.Name}}</p> {{else}} <p>hello, ...
- Qt编写安防视频监控系统8-双击节点
一.前言 在所有的视频监控系统中,双击摄像机的节点,对应摄像机加载到当前焦点通道显示,这个都是必须具备的功能,还有一些厂家会做双击NVR节点,自动加载该NVR下的所有摄像机全部显示,从通道1开始到通道 ...
- php 转化整型需要注意的地方
public function tt(){ $num = '19.90'; echo $num; echo '<br/>--------------<br/>'; echo 1 ...
- Leetcode 69. Sqrt(x)及其扩展(有/无精度、二分法、牛顿法)详解
Leetcode 69. Sqrt(x) Easy https://leetcode.com/problems/sqrtx/ Implement int sqrt(int x). Compute an ...
- JAVA数据结构和算法 3-简单排序
排序中的两种基本操作是比较和交换.在插入排序中还有移动. 冒泡排序:两两比较相邻元素,如果较大数位于较小数前面,则交换: 每一趟遍历将一个最大的数移到序列末尾,共遍历N-1趟. 如果执行完一趟之后没有 ...
- C语言字符串之无重复字符的最长子串
题目描述 给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度. 示例 输入: "abcabcbb" 输出: 解释: 因为无重复字符的最长子串是 . 输入: " ...
- 动态中位数-POJ 3784
题目: 依次读入一个整数序列,每当已经读入的整数个数为奇数时,输出已读入的整数构成的序列的中位数. 输入格式 第一行输入一个整数P,代表后面数据集的个数,接下来若干行输入各个数据集. 每个数据集的第一 ...