码迷,mamicode.com
首页 > 系统相关 > 详细

腾讯云的基本配置(ubuntu 14.04)

时间:2017-01-31 21:49:23      阅读:394      评论:0      收藏:0      [点我收藏+]

标签:lis   14.04   fast   ror   配置nginx   server   restart   oca   start   

  因为想在微信上开发些东西,所以租用了一个月的腾讯云。

1.安装nginx

sudo apt-get install nginx

2.安装php5

sudo apt-get install php5-cgi php-apc php5-curl php5-gd php5-mysql php5-mcrypt php5-memcache php5-memcached

3.安装php-fpm

sudo apt-get install php5-fpm

4.启动php-fpm并查看其配置

sudo /etc/init.d/php5-fpm start
sudo gedit /etc/php5/fpm/pool.d/www.conf

  更改为 listen = 127.0.0.1:9000

5.配置nginx的配置文件

sudo gedit /etc/nginx/sites-available/default
#sudo gedit /etc/nginx/nginx.conf

在配置文件中找到以下片段并修改为如下。

 

server {
  listen       80;
  root   /usr/share/nginx/html;
  server_name  localhost;

  #charset koi8-r;
  #access_log  /var/log/nginx/log/host.access.log  main;

  location / {
      index  index.html index.htm;
  }

  #error_page  404              /404.html;

  # redirect server error pages to the static page /50x.html
  #
  error_page   500 502 503 504  /50x.html;
  location = /50x.html {
      root   /usr/share/nginx/html;
  }

  # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  #
  location ~ \.php$ {
      fastcgi_pass   127.0.0.1:9000;
      fastcgi_index   index.php;
      fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
      include        fastcgi_params;
  }

}

6.重启nginx服务

  遇到报错

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

  使用命令关闭占用80端口的程序

sudo fuser -k 80/tcp

  再加载配置文件,重新启动即可

sudo nginx -c /etc/nginx/nginx.conf
sudo nginx -s reload
sudo service nginx restart

 

腾讯云的基本配置(ubuntu 14.04)

标签:lis   14.04   fast   ror   配置nginx   server   restart   oca   start   

原文地址:http://www.cnblogs.com/waynelin/p/6359094.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!