Centos7 配置LAMP+fastcgi(Centos7.2+php7.0+mariadb+httpd)
环境:阿里云centos7.3
一、安装并配置数据库
1.安装数据库
#yum install mariadb-server mariadb -y
2.启动服务并设置开机自启
# systemctl start mariadb && systemctl enable mariadb && systemctl status mariadb
3.初始化数据库
# mysql_secure_installation
二、安装PHP7.0
1.配置源
#yum install -y epel-release
#rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
2.安装php7
#yum install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64 -y
3.配置php-fpm源
#rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
4.安装php-fpm
#yum install -y php70-php-fpm.x86_64
三、安装并配置httpd
1.安装httpd
#yum install httpd -y
2.启动服务并设置开机自启
#systemctl start httpd && systemctl enable httpd && systemctl status httpd
3.编辑配置文件,使httpd支持PHP
vi /etc/httpd/conf/httpd.conf
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>
4.重启服务并验证
# systemctl restart httpd
#echo "<?php phpinfo();?>" > /var/www/html/index.php
浏览器访问IP
#vi /var/www/cgi-bin/php.fastcgi
#!/bin/bash
PHPRC="/etc/php.ini"
PHP_FCGI_CHILDREN=4
PHP_FCGI_MAX_REQUESTS=1000
export PHPRC
export PHP_FCGI_CHILDREN
export PHP_FCGI_MAX_REQUESTS
exec /usr/bin/php-cgi
#chown apache:apache /var/www/cgi-bin/php.fastcgi
#chmod +x /var/www/cgi-bin/php.fastcgi
#vi /etc/httpd/conf.d/fastcgi.conf
<VirtualHost *:80>
ServerName svr1.tecadmin.net
ServerAdmin admin@tecadmin.net
DocumentRoot /var/www/html
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
<Directory "/var/www/html">
Options +Indexes +FollowSymLinks +ExecCGI
AddHandler php-fastcgi .php
Action php-fastcgi /cgi-bin/php.fastcgi
AllowOverride All
Order allow,deny
Allow from All
</Directory>
</VirtualHost>
重启服务
# systemctl restart httpd
再次登录访问http://IP
参考: https://tecadmin.net/setup-httpd-with-fastcgi-and-php-on-centos-redhat/
Centos7 配置LAMP+fastcgi(Centos7.2+php7.0+mariadb+httpd)的更多相关文章
- centos7 配置lamp 环境
搭建版本 版本组合 php5.6+apache/2.4.6(centos7)+mysql5.7.24 因为新系统不能确认哪些指令已经搭建 所以安装前需要确认下是否拥有 检测是否已经安装过Vim rp ...
- centos7.5环境下编译安装php7.0.30并安装redis和mongo扩展
.安装php7..30的脚本 # vim install_php.sh #!/bin/bash # 安装基本依赖 yum install -y gcc gcc-c++ htop telnet ioto ...
- [LAMP]【转载】——PHP7.0的安装
***原文链接:http://my.oschina.net/sallency/blog/541287 php编译过程报错解决可参考:http://www.cnblogs.com/z-ping/arch ...
- Centos7编译安装lnmp(nginx1.10 php7.0.2)
我使用的是阿里云的服务器 Centos7 64位的版本 1. 连接服务器 这个是Xshell5的版本 安装好之后我们开始连接服务器 2. 安装nginx 首先安装nginx的依赖 yum instal ...
- CentOS7 配置LAMP
这两天要带新同事.没办法,只有现学现卖,又回到Linux的怀抱了.今晚想配置一下LAMP环境,但是之前用的6.6,今晚想闷声做大死,用一次7试试.网上找了很多教程,但是好像转载的都不负责任,有些到下一 ...
- linux配置LAMP(CentOS7.4 Apache2.4 PHP5.6)
1.安装Apache 这个就不手动安装了,直接上脚本执行 bash apache.sh 以下为脚本的内容: #!/bin/bashversion=`lsb_release -a|grep Releas ...
- centos7配置lamp成功安装过
linux+apache+mysql/mariadb+php 首先apache的安装: yum install httpd 接着mysql/mariadb的安装: yum install mysql ...
- centos安装配置LAMP,https,fastcgi
Centos7 配置LAMP+fastcgi(Centos7.2+php7.0+mariadb+httpd) 环境:阿里云centos7.3 一.安装并配置数据库 1.安装数据库 #yum ins ...
- Centos7 安装配置Apache+Mysql5.7+PHP7.0+phpmyadmin
Centos7 下安装配置Apache+Mysql5.7+PHP7.0+phpmyadmin 搭建LAMP =========================================Apach ...
随机推荐
- 20175212童皓桢 实验四 Android程序设计
20175212童皓桢 实验四 Android程序设计 实验内容 参考<Java和Android开发学习指南(第二版)(EPUBIT,Java for Android 2nd)>并完成相关 ...
- web长时间不激活 终止用户回话
参考资料: http://web.jobbole.com/89072/ http://www.cnblogs.com/1175429393wljblog/p/5570606.html http://w ...
- React 中 refs 的作用是什么?
Refs 是 React 提供给我们的安全访问 DOM 元素或者某个组件实例的句柄.我们可以为元素添加 ref 属性然后在回调函数中接受该元素在 DOM 树中的句柄,该值会作为回调函数的第一个参数返回 ...
- Mysql的BTREE和HASH索引
建议默认使用BTree索引,如果时间太长,可以尝试HAST索引,但限制如下: 不支持between and 只支持 = IN <> 不支持范围查询如between and和like. 无法 ...
- SpringBoot 启动流程
SpringBoot 启动流程 加载 resources/META-INF/spring.factories 中配置的 ApplicationContextInitializer 和 Applicat ...
- [Python]操作shell脚本报错Permission denied
问题: In []: os.system('./test_shell_no_para.sh') : ./test_shell_no_para.sh: Permission denied Out[]: ...
- Jmeter(五)检查点
录制的脚本回放成功了, 但是运行有可能出现失败的情况, 所以有必要让JMeter来帮我们验证测试结果的正确性. 在Jmeter中是用断言组件来实现此功能的. 首先, 在需要添加断言的请求后面, 添加响 ...
- iOS 图表工具charts介绍
charts是一个很好的绘图工具,功能非常强大,可以用来绘制折线,柱状图,饼状图,k线图,k线分时图,雷达图,气泡图等等,charts是一款仿照安卓 MPAndroidChart而来的一个基于swif ...
- 创建策略(Creation Policy )和生命周期(Life Cycle)
前言 在前面的介绍中我们已经知道:导入和导出的匹配成功需要ContractType,ContractName,Metadata都匹配,这里我们还要介绍一个新的东西:创建策略(creation poli ...
- zk 两阶段提交(待完善)
zk 节点是一个 QuorumPeer,选举结束后,leader 和 follower 各自执行自己的逻辑: org.apache.zookeeper.server.quorum.QuorumPeer ...