centos下安装nginx+apache+php+mysql

版权声明:未经允许,不得转载 https://blog.csdn.net/wanchaopeng/article/details/84256170

1.安装信息

nginx               1.13.0

php                  5.6.38

mysql               5.7

2. 编译安装nginx

wget  http://nginx.org/download/nginx-1.13.0.tar.gz
mkdir /usr/local/nginx
tar -xf nginx-1.13.0.tar.gz 
##编译安装检查
yum install pcre-devel openssl-devel -y
rpm -qa |egrep "pcre|openssl"
##添加nginx运行用户
Useradd  -s /sbin/nologin -M www
cd nginx-1.13.0
./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/run/nginx/nginx.lock --user=nginx --group=nginx --with-http_ssl_module --with-http_flv_module --with-http_stub_status_module --with-http_gzip_static_module --http-client-body-temp-path=/usr/local/nginx/client/ --http-proxy-temp-path=/usr/local/nginx/proxy/ --http-fastcgi-temp-path=/usr/local/nginx/fcgi/ --http-uwsgi-temp-path=/usr/local/nginx/uwsgi --http-scgi-temp-path=/usr/local/nginx/scgi --with-pcre --with-file-aio --with-http_image_filter_module 
echo $?   #检查
make && make install 
ln -s /usr/local/nginx/sbin/nginx  /usr/bin
nginx 
lsof -i:80  #查看

2. yum安装apache

查看是否安装
rpm -qa httpd
安装Apache
yum install httpd -y
安装完成之后修改配置文件指定服务具体目录,从根目录出发,修改配置信息 ,具体见配置文件
mysql数据库配置在card-db01文件中mysql链接信息请注意修改

3. yum安装php

安装依赖包
yum -y install gcc gcc-c++ cmake make automake autoconf libtool patch perl \
unzip zlib zlib-devel bison bison-devel ncurses ncurses-devel libaio libaio-devel
检查安装包
yum list installed |grep php
添加epel源
yum install epel-release
rpm -ivh  http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
安装php5.6.38
yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof php-gd php-redis

yum install --enablerepo=remi --enablerepo=remi-php56 php-fpm
安装完成
systemctl start php-fpm

4. yum安装mysql配置主从

https://blog.csdn.net/wanchaopeng/article/details/80826148   

猜你喜欢

转载自blog.csdn.net/wanchaopeng/article/details/84256170