apt-get方式安装lnmp环境
2015-07-05 17:27
531 查看
安装nginx sudo apt-get install nginx 安装php和mysql sudo apt-get install php5-cli php5-cgi php5-curl php5-mysql php5-fpm mysql-server 修改nginx配置文件 /etc/nginx/nginx.conf 添加 /etc/nginx/vhost/localhost.conf 文件
server { listen 80; server_name localhost; #绑定域名 index index.htm index.html index.php; #默认文件 root /data/webroot; #网站根目录 location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; } access_log /data/logs/access.log; error_log /data/logs/error.log; } server { listen 80; server_name test.localhost; #绑定域名 index index.htm index.html index.php; #默认文件 root /data/webroot/testRoot; #网站根目录 location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; } access_log /data/logs/test_access.log; error_log /data/logs/test_error.log; }检查nginx配置
sudo /usr/sbin/nginx -t
重启nginx
sudo /usr/sbin/nginx -s reload
启动php-cgi
php-cgi -b 127.0.0.1:9000
相关文章推荐
- cdlinux U盘启动制作方法
- C语言学习笔记:12_变量的存储方式和生存期
- 题目1070:今年的第几天?
- SOJ.Robot
- How to do research?
- 修改mysql密码出现Access denied for user ''@'localhost' to database 'mysql'
- SQL学习(时间,存储过程,触发器)
- 数据字典
- oracle 中的几个函数AVG (平均) COUNT (计数) MAX (最大值) MIN (最小值) SUM (总合)
- 天下游安装步骤
- Ubuntu12.04编译hadoop2.6.0源码与源码导入windows下的Eclipse查看方法
- do...while(0)的妙用
- 存储器
- 设计模式之工厂
- 百度2013校园笔试题
- 浅谈单调队列、单调栈
- php file_get_contents返回空 无效解决办法
- Reward(拓扑排序)
- 利用贪心的思维对算法剪枝(POJ 2376)
- 技术学习步骤