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 ...
随机推荐
- elasticsearch java client
1.集群名相同,且机器处于同一局域网同一网段,es会自动去发现其他的节点.2.集群不在同一局域网同一网段时,只需要在 elasticsearch.yml 中配置目标机器和端口即可discovery.z ...
- 初学Linux之标准I/O和管道
标准输入和输出 程序是由指令+数据组成 程序的数据流有三种: 输入数据流:<–标准输入(stdin),一般默认是键盘 输出数据流:–>标准输出(stdout),一般默认到终端窗口 错误输出 ...
- Get Raster Properties获得栅格的信息
Summary Returns the properties of a raster dataset. Usage The property returned will be displayed in ...
- ArcGIS超级工具SPTOOLS-线封闭,点集转面
一.线封闭 操作视频:https://weibo.com/tv/v/HvyvbAxKh?fid=1034:4375207666991674 将末端不闭合线,自动生成闭合的线,效果如下 原始线:末端不闭 ...
- mysql数据库学习二
最近又复习了mysql中的一些概念:视图,触发器,存储过程,函数,事务,记录下. 1.视图 视图是一个虚拟表,本身并不存储数据,当sql在操作视图时所有数据都是从其他表中查出来的,因此其本质是:根据S ...
- 19 个强大、有趣、又好玩的 Linux 命令!
民工哥技术之路 今天 点击上方“民工哥技术之路”选择“置顶或星标” 每天10点为你分享不一样的干货 1. sl 命令 你会看到一辆火车从屏幕右边开往左边…… 安装 $ sudo apt-get ins ...
- git服务器搭建---便签做备注
今天,简单搭建了一下git服务器.发现一篇文章写的挺好的 http://www.cnblogs.com/trying/archive/2012/06/28/2863758.html 并简单和廖雪峰的结 ...
- scikit-learn机器学习(三)多项式回归(二阶,三阶,九阶)
我们仍然使用披萨直径的价格的数据 import matplotlib matplotlib.rcParams['font.sans-serif']=[u'simHei'] matplotlib.rcP ...
- 不要在viewWillDisappear:方法中移除通知
都知道viewWillAppear:方法是在控制器的view将要显示的时候调用的,而viewWillDisappear:方法是在控制器的view将要隐藏的时候调用. 这看上去没什么问题,键盘的显示和隐 ...
- Thinking - 一些有效阅读的方法
有策略,忌盲目.讲方法,别蛮干! 1- 阅读方法 1.1 做好眼前事 排除其他事项干扰,营造适合阅读的状态和环境,专注地投入阅读之中. 如果被一堆乱糟糟的事情烦扰,身心处于一个疲惫的状态,必然无法保持 ...