题外话:由于近段时间测试环境ssh链路质量不大好,经常短线。故我把整个安装过程放到screen里去执行,以防止断线中断了安装过程。执行screen -S install,这样断线后,只要再执行screen -r install 就可以恢复之前的安装界面。

1.安装mysql

sudo apt-get install mysql-server mysql-client

安装过程中要设置mysql root用户的密码。

2.安装nginx

sudo apt-get install nginx

3.安装成功后。我们重启下nginx服务

sudo service nginx restart

启动之后我们就可以访问一下我们的地址了。看能不能出现nginx的欢迎界面。

4.安装php5-fpm(PHP5 - FastCGI Process Manager)。

sudo apt-get install php5-fpm

5.接下来我们要修改一下nginx的站点配置了。

ngnix的配置文件存放在/etc/nginx/sites-available/default

server {

listen 80; ## listen for ipv4; this line is default and implied

listen [::]:80 default ipv6only=on; ## listen for ipv6

root /usr/share/nginx/www;

index index.php index.html index.htm;

# Make site accessible from http://localhost/

server_name _;

location / {

# First attempt to serve request as file, then

# as directory, then fall back to index.html

try_files $uri $uri/ /index.html;

}

location /doc {

root /usr/share;

autoindex on;

allow 127.0.0.1;

deny all;

}

#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/www;

}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80

#

#location ~ \.php$ {

# proxy_pass http://127.0.0.1;

#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

#

location ~ \.php$ {

try_files $uri =404;

#fastcgi_pass 127.0.0.1:9000;

fastcgi_pass unix:/var/run/php5-fpm.sock;

fastcgi_index index.php;

include fastcgi_params;

}

# deny access to .htaccess files, if Apache's document root

# concurs with nginx's one

#

location ~ /\.ht {

deny all;

}

}

增加了php解析的一些代码在里面。

6.我们在安装php5相关的一些组件。

sudo apt-cache search php5

apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl

7.重启服务

sudo service php5-fpm restart

sudo service nginx

8.写个探针文件试试吧。呵呵。

ubuntu上安装nginx+mysql+php5-fpm(PHP5 - FastCGI Process Manager)的更多相关文章

  1. 在Ubuntu上安装 nginx, MySQL, PHP (LEMP),phpmyadmin和WordPress

    0)更新 Apt-Get 终端命令:sudo apt-get update 1) 安装php sudo apt-get install php5 2)安装MySql 终端命令: sudo apt-ge ...

  2. ubuntu上安装apache2+mysql+php5-fpm(PHP5 - FastCGI Process Manager)

    1: 安装mysql apt-get install mysql-server mysql-client 安装过程中会被问到设置mysql root的密码     New password for t ...

  3. 在Ubuntu上安装Redis MySQL MongoDB memcached Nginx

    1.安装Redis sudo apt-get install redis-server 2.安装MySQL sudo apt-get install mysql-server 3.安装MongoDB ...

  4. 在 Bash on Ubuntu 上安装Nginx

    前言 Win10 上的 Bash on Ubuntu 是个很好用的玩具,让windows开发环境下的人能无缝操练Linux,但是涉及到网络部分还是有很多要该进的地方,比如Nginx的安装就遇到了问题. ...

  5. Ubuntu下安装Nginx,PHP5(及PHP-FPM),MySQL

    .简介: Tomcat在高并发环境下处理动态请求时性能很低,而在处理静态页面更加脆弱.虽然Tomcat的最新版本支持epoll,但是通过Nginx来处理静态页面要比通过Tomcat处理在性能方面好很多 ...

  6. 使用PPA在Ubuntu上安装php5.4~5.6,7

    使用PPA在Ubuntu上安装php5.4~5.6,7 sudo apt-get install software-properties-common sudo add-apt-repository ...

  7. LEMP--如何在Ubuntu上安装Linux、Nginx、MySQL和PHP

    简介 LEMP是用来搭建动态网站的一组软件,首字母缩写分别表示Linux.Nginx(Engine-X).MySQL和PHP. 本文将讲述如何在Ubuntu安装LEMP套件.当然,首先要安装Ubunt ...

  8. Ubuntu编译安装nginx,php,mysql

    摘要: 整理的Ubuntu编译安装nginx,php,mysql的步骤,主要来自对驻云的sh-1.4.1中脚本的整理,随时代进步,内容中的软件或者命令请自行更新 目录准备 创建用户 userdel w ...

  9. ubuntu上安装mysql 编译安装

    为什么要折腾?首先说明的是ubuntu上安装mysql等软件是非常容易简单的,其简单的程度盖过windows上的安装,一句sudo apt-get install就可以搞定.如果想用最简便的方法安装m ...

随机推荐

  1. Java基础——封装

    最近学习Java面向对象方面的知识点,一直没时间更新博客,因为这块的知识点真的蛮绕的.一个知识点一个知识点的往外冒,而且对于我这个初学者来说区分构造器和方法就花费了一整天的时间.现在准备再重新过一遍知 ...

  2. 解决(防止)DDOS攻击的另一种思想

    本方案适合作最后的处理方案. 在服务器遭到DDOS攻击后,防火墙.高防盾或者其他的方案都已经失去了效力,这时运维人员无任何方案可以处理,并且只能任由DDOS攻击或关闭服务器时,该方案可以有限的抵挡大部 ...

  3. fdisk 非交互式创建 分区

    一. key 非交互式创建分区, 与 交互式创建分区区别不大. 使用 fdisk 的默认选项, 使用空行即可, 不用回车. 创建 主分区 和 扩展分区时, 需要注意 分区号 二. 创建主分区 fdis ...

  4. API 接口规范

    整体规范建议采用RESTful 方式来实施. 1. 协议 API与用户的通信协议,总是使用HTTPs协议,确保交互数据的传输安全. 2. 域名 应该尽量将API部署在专用域名之下. https://a ...

  5. Oracle 分页方法研究

    1.Oracle 中的三大分页方法 1.1.通过分析函数分页 1.2.通过 ROWNUM 分页 1.3.通过 ROWID 分页 2.Oracle 分页解决方案浅析 2.1.纯后端代码完成分页 2.2. ...

  6. BeanUtils.copyProperties()方法引入不同包

    两个对象之间拷贝相同的属性,可以使用BeanUtils.copyProperties()方法, BeanUtils.copyProperties(obj1,obj2); 提示有三个包可选. A,选择o ...

  7. is not allowed to connect to this MySQL server

    解决办法: 这是告诉你没有权限连接指定IP的主机mysql --user=root -p; use mysql; GRANT SELECT,INSERT,UPDATE,DELETE ON host.* ...

  8. js脚本中try与cache捕获异常处理

    <script type="text/javascript"> function add_reason(elm){ try{ var pp=$('.pp').val() ...

  9. Chapter 2. Video Formats and Quality

    本章节主要介绍一些视频格式相关的基础知识. 交织(Interlace) 即每一个采样帧采样时隔行采样,奇数行和偶数行交替. YCbCr 人眼视觉系统(Human Visual System, HVS) ...

  10. 3.ubuntu如何安装搜狗输入法

    1.http://blog.csdn.net/qq_21792169/article/details/53152700 2.http://jingyan.baidu.com/article/54b6b ...