看到了一片讲解ubuntu下安装lnmp的文章,跟着一步步的来,竟然很顺利的成功了,将文章复制如下,原著勿怪

一、操作步骤

1.安装Nginx

sudo apt-get install update
sudo apt-get install nginx
2.测试Nginx,如果显示如下图则代表安装成功 ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//' #查看本机IP地址
curl http://127.0.0.1 或者 curl http://本机ip
curl nginx 3.安装MySQL sudo apt-get install mysql-server
# 连续输入两次相同的密码
4.安装PHP sudo apt-get install php5-fpm php5-mysql
5.配置PHP,修改php.ini文件 # 备份php.ini文件
cp /etc/php5/fpm/php.ini /etc/php5/fpm/php.ini.back
# 取消有安全隐患的pathinfo模式
vim /etc/php5/fpm/php.ini
# 将cgi.fix_pathinfo=1 设置为 cgi.fix_pathinfo=0
cgi.fix_pathinfo=0
#启动php-fpm
sudo service php5-fpm restart
6.配置Nginx让其使用php-fpm进程 #备份/etc/nginx/sites-available/default文件
cp /etc/nginx/sites-available/default /etc/nginx/sites-available/default.back
#修改defalut文件内容如下
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on; root /usr/share/nginx/html;
index index.php index.html index.htm; server_name server_domain_name_or_IP; location / {
try_files $uri $uri/ =404;
} error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
} location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
7.重启nginx服务器 sudo service nginx restart
8.在/usr/share/nginx/html/里面建立info.php写入如下内容 <?php
phpinfo();
?>
浏览器输入: http://ip/info.php
phpinfo显示 二、写在最后 这篇文章只是简单的介绍了Nginx+php-fpm的安装。如果你对Linux有更深入的研究,完全可以使用手动安装源码包的方式进行安装和配置。当然,你看到这篇文章的时候应该已经知道了Nginx的优秀之处了,后续文章会继续剖析Nginx的经典配置和Nginx与Apahce的异同。 Ubuntu 14.04 LTS 安装 LNMP Nginx\PHP5 (PHP-FPM)\MySQL http://www.linuxidc.com/Linux/2014-05/102351.htm Ubuntu 13.04 安装 LAMP\Vsftpd\Webmin\phpMyAdmin 服务及设置 http://www.linuxidc.com/Linux/2013-06/86250.htm CentOS 6.4 下的LNMP 生产环境搭建及安装脚本 http://www.linuxidc.com/Linux/2013-11/92428.htm 生产环境实用之LNMP架构的编译安装+SSL加密实现 http://www.linuxidc.com/Linux/2013-05/85099.htm LNMP 全功能编译安装 for CentOS 6.3笔记 http://www.linuxidc.com/Linux/2013-05/83788.htm CentOS 6.3 安装LNMP (PHP 5.4,MyySQL5.6) http://www.linuxidc.com/Linux/2013-04/82069.htm 在部署LNMP的时候遇到Nginx启动失败的2个问题 http://www.linuxidc.com/Linux/2013-03/81120.htm Ubuntu安装Nginx php5-fpm MySQL(LNMP环境搭建) http://www.linuxidc.com/Linux/2012-10/72458.htm

  最后在执行composer时候遇到问题,报错找不到mcrypt,一顿Google,终于找到解决办法,也粘贴如下

Try this:

sudo updatedb
locate mcrypt.ini
Should show it located at /etc/php5/mods-available locate mcrypt.so
Edit mcrypt.ini and change extension to match the path to mcrypt.so, example: extension=/usr/lib/php5/20121212/mcrypt.so
Now this: php5enmod mcrypt - (optional since its already enabled during phpmyadmin setup)
Verify that new files exists here (they should be auto created from the issue above) ls -al /etc/php5/cli/conf.d/20-mcrypt.ini
ls -al /etc/php5/apache2/conf.d/20-mcrypt.ini
Otherwise do the following Create symbol links now ln -s /etc/php5/mods-available/mcrypt.ini /etc/php5/cli/conf.d/20-mcrypt.ini
ln -s /etc/php5/mods-available/mcrypt.ini /etc/php5/apache2/conf.d/20-mcrypt.ini
Restart Apacahe service apache2 restart

终于解决!  

ubuntu14.04配置lnmp的更多相关文章

  1. Caffe+CUDA7.5+CuDNNv3+OpenCV3.0+Ubuntu14.04 配置参考文献 以及 常见编译问题总结

    Caffe+CUDA7.5+CuDNNv3+OpenCV3.0+Ubuntu14.04  配置参考文献 ---- Wang Xiao Warning: Please make sure the cud ...

  2. Caffe+CUDA8.0+CuDNNv5.1+OpenCV3.1+Ubuntu14.04 配置参考文献 以及 常见编译问题总结

    Caffe + CUDA8.0 + CuDNNv5.1 + OpenCV3.1 + Ubuntu14.04  配置参考文献 ---- Wang Xiao  Anhui University  CVPR ...

  3. Ubuntu14.04配置gcc4.4.4+Qt4.8.4交叉编译环境

    安装32位程序运行支持 sudo apt-get install lib32stdc++6 lib32z1 lib32ncurses5 lib32bz2-1.0 可能报错: lib32stdc++6 ...

  4. ubuntu14.04 配置网络

    ubuntu14.04 配置网络的练习 本文参考的资料: https://blog.csdn.net/liu782726344/article/details/52912797. 感谢作者的分享! 打 ...

  5. ubuntu14.04 安装LNMP

    新书上市<深入解析Android 5.0系统> 通常我们使用centos来组建LNMP,可是我们开发时多使用ubuntu的桌面版本号来调试,以下将具体介绍怎样在ubuntu上安装一套LNM ...

  6. Ubuntu14.04配置Mono+Jexus

    总所周知,ASP.NET是微软公司的一项技术,是一个网站服务端开发的一种技术,它可以在通过HTTP请求文档时再在Web服务器上动态创建它们,就是所谓动态网站开发,它依赖运行于 IIS 之中的程序 .但 ...

  7. ubuntu14.04 配置中文输入法

    ubuntu14.04自带中文输入法,只要配置就可以了. 1.安装中文支持 System Settings -->  Language Support 点击 install/remove lan ...

  8. ubuntu14.04配置中文latex完美环境(texlive+texmaker+lyx)

    Ubuntu下的文档编辑虽然有libreoffice,但对中文和公式的排版始终不如ms office,因此要想写出高质量的文档,只能靠latex了,现在随着xeCjk的开发,中文文档在ubuntu下的 ...

  9. 64位ubuntu14.04配置adb后提示没有那个文件或目录

    1.配置完adb环境变量后在终端输入adb: ameyume@ameyume-HP-450-Notebook-PC:~$ adb /home/ameyume/adt-bundle-linux-x86_ ...

随机推荐

  1. 学习笔记之APACHE ANT

    http://baike.baidu.com/link?url=KkOWkH_nMVJRbd4oj-aIHMVL4HR-s7fqm3i2brUcZzBinwUXjZgzPcYIWz5qFNNvjait ...

  2. Jordan Lecture Note-5: Kernels

    Kernels 我们首先来回顾kernel函数的定义:一个函数$K(x,y)$为kernel函数当且仅当对$\forall g, \int K(x,y)g(x)g(y)dxdy\geq 0$成立.另外 ...

  3. iOS 中的 block 是如何持有对象的

    Block 是 Objective-C 中笔者最喜欢的特性,它为 Objective-C 这门语言提供了强大的函数式编程能力,而最近苹果推出的很多新的 API 都已经开始原生的支持 block 语法, ...

  4. C# 之 Math取整

    主要用到 System 命名空间下的一个数据类 Math ,调用他的方法. C#取整函数使用详解: 1.Math.Round是"就近舍入",当要舍入的是5时与"四舍五入& ...

  5. android开发之路01

    一.android系统被分为4个层次:1.最下层的是linux核心,包括多个驱动程序,提供了操作系统应该具备的核心功能:2.在linux核心之上,包括两个部分,一部分是Android Runtime( ...

  6. (转)STL

    C++容器类 C++中的容器类包括“顺序存储结构”和“关联存储结构”,前者包括vector,list,deque等:后者包括set,map,multiset,multimap等. 若需要存储的元素数在 ...

  7. canvas实现“探照灯”共能

    简单的样式: body{ margin: 0; padding: 0;}#canvas{ display: block; position: relative; margin: auto;} 创建绘图 ...

  8. 浅谈用java解析xml文档(三)

    接上一篇,本文介绍使用JDOM解析xml文档, 首先我们还是应该知道JDOM从何而来,是Breet Mclaughlin和Jason Hunter两大Java高手的创作成果,2000年初, JDOM作 ...

  9. PHP中长连接的实现

    最近遇到PHP程序在执行大量数据的时候提示超时,于是用到了set_time_limit()函数来设置PHP页面的最大运行时间. 设置允许脚本运行的秒数.如果这是默认的,该脚本返回一个致命的错误.默认限 ...

  10. css3边框、阴影

    一.图像边框border-image 语法:border-image:border-image-source(图片)  ||  border-image-slice(裁剪位置)  ||  border ...