标签:style blog http color ar os sp 文件 div
yum list nginx
[nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=0 enabled=1
$releasever 是你centos的版本我的centos6.3 所以是
http://nginx.org/packages/centos/6/$basearch/
执行下面命令,并把上面的代码复制进去
vi /etc/yum.repos.d/nginx.repo
yum install nginx
这样就安装好了
/etc/init.d/nginx start
ps -ef | grep nginx
你可以通过浏览器访问 输入ip地址访问(注意防火墙关了)
yum list php php-fpm
yum install php php-fpm
/etc/init.d/php-fpm start
php和nginx正常情况是没有交集的,这里要改nginx的配置文件,开启fastcgi
vim /etc/nginx/conf.d/default.conf
绿色区块去掉注释,绿色区块那两个红色区块要修改,root就用上面的,其实就是网站根目录。
/etc/init.d/nginx restart
<?php phpinfo(); ?>
再从浏览器访问它
也可直接用php访问它
php /urs/share/nginx/html/phpinfo.php
yum list mysql mysql-server
yum install mysql mysql-server
mysql_install_db
mysqld_safe & //后台起动
mysql -uroot
yum list php-mysql // php装mysql扩展
现在就全安装好了
php,mysql,nginx状态管理
/etc/init.d/nginx stop /etc/init.d/nginx start /etc/init.d/nginx restart /etc/init.d/mysqld stop /etc/init.d/mysqld start /etc/init.d/mysqld restart /etc/init.d/php-fpm start /etc/init.d/php-fpm restart /etc/init.d/php-fpm stop
标签:style blog http color ar os sp 文件 div
原文地址:http://www.cnblogs.com/waughf/p/4069336.html