RHE linux最小化安装步骤,centos6.5 x86_64下yum安装nginx和php

平台:centos 6.5 64位最小化+development tools

rpm -Uvh http://mirrors.yun-idc.com/epel/6/x86_64/epel-release-6-8.noarch.rpm

EPEL,即Extra Packages for Enterprise Linux,企业版linux附加包。这个软件仓库里有很多非常常用的软件,而且是专门针对RHEL设计的,对RHEL标准yum源是一个很好的补充,完全免费使用,由Fedora项目维护,所以如果你使用的是RHEL,或者CentOS,Scientific等RHEL系的linux,可以非常放心的使用EPEL的yum源。

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

remi依赖于EPEL源,有最新版本的PHP、MYSQL等软件。

yum -y install nginx

yum --enablerepo=remi -y install php php-fpm

yum install postfix(可选,有的会提示需要postfix)

yum --enablerepo=remi install php-gd php-mysql php-mbstring php-xml php-mcrypt

chkconfig --level 35 php-fpm on

chkconfig --level 35 nginx on

vi /etc/nginx/conf.d/default.conf

#location / {

root   /usr/share/nginx/html;

index index.php index.html index.htm;

#}

修改以下代码

#location ~ \.php$ {

#    root       html;

#  fastcgi_pass   127.0.0.1:9000;

# fastcgi_index  index.php;

#    fastcgi_param  SCRIPT_FILENAME /scripts$fastcgi_script_name;

#   include        fastcgi_params;

#}

去掉除root行外的#,/scripts 改成$document_root

vi /usr/share/nginx/html/index.php

phpinfo();

?>

service php-fpm start

service nginx start

测试http://serverIP

iptables -I INPUT -p tcp --dport 80 -j ACCEPT

service iptables restart

或者service iptables stop

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值