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经典算法题50道
原文 JAVA经典算法50题[程序1] 题目:古典问题:有一对兔子,从出生后第3个月起每个月都生一对兔子,小兔子长到第三个月后每个月又生一对兔子,假如兔子都不死,问每个月的兔子总数为多少?1.程序 ...
- docker swarm和 k8s对比
Swarm的优势:swarm API兼容docker API,使得swarm 学习成本低,同时架构简单,部署运维成本较低.Swarm的劣势:同样是因为API兼容,无法提供集群的更加精细的管理.在网络方 ...
- Linux -- 进程或线程独占CPU
如果想让特定进程或线程独占某一或某些CPU,我们需要做三件事. 一,隔离CPU,避免其它线程run在被隔离的CPU上. 二,绑定所有的interrupts到非隔离的CPU上,避免被隔离的CPU收到in ...
- CDH集群部署hive建表中文乱码
背景:部署CDH集群的 hive 服务,选用 mysql 作为 hive 元数据的存储数据库,通过 hive cli 建表时发现中文注释均乱码. 现象:hive端建表中文注释乱码. 定位: 已经确认过 ...
- js 高级程序设计 第三章学习笔记——Number数据类型需要注意的事项
1.浮点数值 虽然小数点前面可以没有整数,但是并不推荐这种写法. 由于保存浮点数值需要的内存空间是保存整数值的两倍,因此ECMAScript会不失时机地将浮点数值转化为整数数值.显然,如果小数点后面没 ...
- 新式类__new__()方法
概述 __new__() 是在新式类中新出现的方法,在 Python 中类实例化时,__new__()方法用在 __init__() 启动之前,决定是否要使用该 __init__() 方法,因为__n ...
- 【DSP开发】CMD文件
DSP的存储器的地址范围,CMD是主要是根据那个来编的. CMD 它是用来分配rom和ram空间用的,告诉链接程序怎样计算地址和分配空间. 所以不同的芯片就有不同大小的rom和ram.放用户程序的地方 ...
- C/C++.字符串分割
1.ZC:只测试使用了 自己改编的函数SplitStr_ZZ(...),其它的 未测试 #include <string> #include <vector> #include ...
- get_object_var 返回一个数组
语法:get_object_var($object),返回一个数组.获取$object对象中的属性,组成一个数组 实例: <?php class person{ public $name=&qu ...
- 最新 钢银电商java校招面经 (含整理过的面试题大全)
从6月到10月,经过4个月努力和坚持,自己有幸拿到了网易雷火.京东.去哪儿.钢银电商等10家互联网公司的校招Offer,因为某些自身原因最终选择了钢银电商.6.7月主要是做系统复习.项目复盘.Leet ...