yum安装nginx,它会默认作为一个服务加到系统中,启动nginx:

service nginx start/nginx -s start

他有4个参数(start|stop|restart|reload)
 
安装PHP及重要插件php-fpm:

yum install php php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-fpm php-mbstring

yum install epel-release //扩展包更新包
yum  update //更新yum源
yum install php-mcrypt

这个时候php就安装完成拉,写个脚本测试一下
 

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

输入
 
<?php
phpinfo();
?>
 
修改nginx配置加载PHP:

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

location ~ \.php$ {
       root           /usr/share/nginx/html;
       fastcgi_pass   127.0.0.1:9000;
       fastcgi_index  index.php;
       fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html$fastcgi_script_name;
       include        fastcgi_params;
}
 
配置 /etc/php-fpm.d/www.conf:
 
找到并取消注释,设置成你希望管理 www 应用的用户(我这里统一用用户 theflash)
listen.owner = theflash
listen.group = theflash
 

更换目录所有者:

chown theflash:theflash /data/wwwroot -R

启动FastCGI形式的PHP:

service php-fpm start(start|stop|restart)

启动MySQL:

service mysqld start(start|stop|restart|reload)

 
设置这三个服务自动启动:
chkconfig nginx on
chkconfig php-fpm on
chkconfig mysqld on
 

最新文章

  1. iOS版打地鼠游戏源码
  2. excel 转换日期
  3. 【随笔】mvc使用forms身份验证实现登陆
  4. Android 坐标系统
  5. 分析SIX锁和锁分区导致的死锁
  6. JavaScript系列:《JavaScript高级程序设计》,chapter2, 在html中使用JavaScript
  7. Ubuntu14.04 切换root账户su root失败解决办法
  8. ajax 本地测试,使用Chrome 浏览器
  9. C#_Fileuploadify_notMvc
  10. mapping 详解1(mapping type)
  11. FileUtils类介绍
  12. 我所理解的设计模式(C++实现)——状态模式(State Pattern)
  13. zTree实现地市县三级级联DAO接口测试
  14. HDU 1034(传递糖果 模拟)
  15. 关于C++ const 的全面总结 (转)
  16. Initialize a vector in C++ (5 different ways)
  17. github或码云协同开发
  18. 【bat/cmd】脚本开发
  19. transform.rotation和GetComponent&lt;Rigidbody&gt;().MoveRotation
  20. 记开发个人图书收藏清单小程序开发(五)Web开发

热门文章

  1. eclipse汉化
  2. ES6新特性:Javascript中的Reflect对象
  3. poj3294 出现次数大于n/2 的公共子串
  4. CodeForces 450B 矩阵
  5. Elasticsearch静态集群配置
  6. C#-WinForm-ListView-表格式展示数据、如何将数据库中的数据展示到ListView中、如何对选中的项进行修改
  7. java.lang.Exception: No runnable methods
  8. HIVE: collect_set(输出未包含在groupby的字段);
  9. Java多线程与并发库高级应用-传统线程互斥技术
  10. SCP注意事项