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 ...
随机推荐
- 【java中的final关键字】
转自:https://www.cnblogs.com/xiaoxi/p/6392154.html 一.final关键字的基本用法 在Java中,final关键字可以用来修饰类.方法和变量(包括成员变量 ...
- ubuntu下如何安装hg(mercurial)?
答: sudo apt-get install mercurial
- 004-jdk-数据结构-ArrayList、LinkedList
一.ArrayList概述 数组集合,无容量限制,非线程安全 ArrayList.Vector是线性表,使用Object数组作为容器去存储数据的,添加了很多方法维护这个数组,使其容量可以动态增长,极大 ...
- Docker save and load,镜像保存
一.起因 docker pull 时发生错误 error pulling image configuration: Get https://dseasb33srnrn.cloudfront.net/r ...
- [Scikit-learn] 1.5 Generalized Linear Models - SGD for Classification
NB: 因为softmax,NN看上去是分类,其实是拟合(回归),拟合最大似然. 多分类参见:[Scikit-learn] 1.1 Generalized Linear Models - Logist ...
- Spring事务管理3----声明式事务管理(1)
声明式事务管理(1)基于 基于 tx/aop 这种事务管理相比编程式事务管理来说对业务层基本没有改动,通过 TransactionProxyFactoryBean 创建业务层的代理,通过A ...
- PHPCMS全局自定义函数 获取用户信息的办法
在这个文件中增加即可\phpcms\libs\functions\global.func.php /** * 获取当前登陆者的信息 * @param $f 取什么字段F就传什么值 */ functio ...
- 【ARTS】01_27_左耳听风-201900513~201900519
ARTS: Algrothm: leetcode算法题目 Review: 阅读并且点评一篇英文技术文章 Tip/Techni: 学习一个技术技巧 Share: 分享一篇有观点和思考的技术文章 Algo ...
- 深度学习中的Attention机制
1.深度学习的seq2seq模型 从rnn结构说起 根据输出和输入序列不同数量rnn可以有多种不同的结构,不同结构自然就有不同的引用场合.如下图, one to one 结构,仅仅只是简单的给一个输入 ...
- jmeter5实现文件上传接口测试
背景:在公司做接口自动化编写过程中,遇到需要测试一个在线下载导入模板的接口,之前都没有接触过关于文件上传下载的接口测试,此处做个记录,为后续工作开展做个参考. 步骤: 打开浏览器按F12 手动进行文件 ...