CentOS7下搭建Nginx+MariaDB+php5.4笔记(非自编译)
来源:互联网 发布:最小的linux 编辑:程序博客网 时间:2024/06/07 03:57
一、搭建前准备
1、关闭firewall:
#systemctl stop firewalld #停止firewall
#systemctl disable firewalld #禁止firewall开机启动
2、安装iptables防火墙
#yum install iptables-services #安装
#vi /etc/sysconfig/iptables #编辑防火墙配置文件
增加80,3306等端口
#systemctl restart iptables #最后重启防火墙使配置生效
#systemctl enable iptables #设置防火墙开机启动
3、关闭SELINUX
vi /etc/selinux/config
SELINUX=enforcing #注释掉
SELINUXTYPE=targeted #注释掉
SELINUX=disabled #增加
#setenforce 0 #使配置立即生效
4、安装所需组件及工具
yum install gcc-c++ pcre-devel zlib-devel (openssl-devel perl-Digest-SHA1.x86_64)可选
二、升级安装MariaDB
#yum install mariadb mariadb-server
#cp /usr/share/mysql/my-huge.cnf /etc/my.cnf #拷贝配置文件
#systemctl restart mariadb #重启MariaDB
#systemctl enable mariadb #设置开机启动
#mysql_secure_installation #安全配置向导
三、PHP安装
#yum install php php-fpm php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash
#vi /etc/php.ini #编辑
#date.timezone = PRC(或者Asia/Shanghai)
#short_open_tag = ON #支持php短标签
#systemctl restart php-fpm #重启php-fpm
#systemctl enable php-fpm #设置开机启动
四、安装nginx
1、下载编译安装
#wget http://nginx.org/download/nginx-1.7.6.tar.gz
#tar zxvf nginx-1.7.6.tar.gz
#cd nginx-1.7.6
#./configure
#echo "export PATH=$PATH:/usr/local/nginx/sbin" >>/etc/profile #添加到全局变量
#source /etc/profile #使配置立即生效
1、关闭firewall:
#systemctl stop firewalld #停止firewall
#systemctl disable firewalld #禁止firewall开机启动
2、安装iptables防火墙
#yum install iptables-services #安装
#vi /etc/sysconfig/iptables #编辑防火墙配置文件
增加80,3306等端口
#systemctl restart iptables #最后重启防火墙使配置生效
#systemctl enable iptables #设置防火墙开机启动
3、关闭SELINUX
vi /etc/selinux/config
SELINUX=enforcing #注释掉
SELINUXTYPE=targeted #注释掉
SELINUX=disabled #增加
#setenforce 0 #使配置立即生效
4、安装所需组件及工具
yum install gcc-c++ pcre-devel zlib-devel (openssl-devel perl-Digest-SHA1.x86_64)可选
二、升级安装MariaDB
#yum install mariadb mariadb-server
#cp /usr/share/mysql/my-huge.cnf /etc/my.cnf #拷贝配置文件
#systemctl restart mariadb #重启MariaDB
#systemctl enable mariadb #设置开机启动
#mysql_secure_installation #安全配置向导
三、PHP安装
#yum install php php-fpm php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-bcmath php-mhash
#vi /etc/php.ini #编辑
#date.timezone = PRC(或者Asia/Shanghai)
#short_open_tag = ON #支持php短标签
#systemctl restart php-fpm #重启php-fpm
#systemctl enable php-fpm #设置开机启动
四、安装nginx
1、下载编译安装
#wget http://nginx.org/download/nginx-1.7.6.tar.gz
#tar zxvf nginx-1.7.6.tar.gz
#cd nginx-1.7.6
#./configure
#make && make install
#echo "export PATH=$PATH:/usr/local/nginx/sbin" >>/etc/profile #添加到全局变量
#source /etc/profile #使配置立即生效
#echo "/usr/local/nginx/sbin/nginx" >>/etc/rc.local #添加到启动项
把php的FastCGI那块取消注释
#nginx #开启nginx
在你的php网站目录建立个php测试文件
#vi /usr/local/nginx/html/index.php #我的路径
<?phpinfo();?>
然后在地址栏输入http://localhost/index.php
0 0
- CentOS7下搭建Nginx+MariaDB+php5.4笔记(非自编译)
- CentOS7下安装apache+php5+mariaDB
- centos7 下安装Apache2+MariaDB+PHP5过程详解
- centos7 下安装Apache2+MariaDB+PHP5过程详解
- CentOs7.3下搭建LAMP环境(Apache2.4 + Mysql5.7 + PHP5.6 + Laravel5.2)
- Centos7.0 下搭建 Nginx
- centos7下编译安装nginx
- centos7下编译安装nginx
- centos7下编译安装nginx
- Nginx笔记(一)----Centos7编译安装Nginx
- centos7安装mariadb 笔记
- centos7下安装MYSQL(mariadb)
- centos7下安装mariadb
- centos7下安装mariadb
- centos7搭建lnmp编译安装nginx【二】
- 【Mariadb】centos7搭建mariadb Galera集群
- CentOS7下配置nginx开机自启
- centos7搭建(mariadb)mysql搭建主备
- Servlet执行过程和Servlet生命周期的区别:
- Android Cursor 源码分析
- 【Shell】【学习笔记】Linux Shell脚本应用(二)
- jQuery Ajax中文问题
- LeetCode:Maximum Product Subarray
- CentOS7下搭建Nginx+MariaDB+php5.4笔记(非自编译)
- VC编程用CyUsb开发USB问题
- HTML5+Canvas实现本地压缩上传图片功能
- mysql新添加用户与删除用户具体操作命令
- UIViewController 与加载其中的View之间的相互引用
- 【Shell】【学习笔记】Linux Shell脚本应用(三)
- Java 栅栏 CyclicBarrier 介绍
- C++中cin、cin.get()、cin.getline()、getline()、gets()等函数的用法
- 使用commons-codec包加密字符串(MD5,SHA1,BASE64)