看到了一片讲解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. 原 Debian设置开机自动启动与关闭

    发表于1年前(2013-01-08 13:01)   阅读(2380) | 评论(0) 2人收藏此文章, 我要收藏 赞0 开机自动启动 update-rc.d chkconfig 熟悉debian系统 ...

  2. 简洁判断一个byte中有多少位为1的bit?

    以下是Brian W. Kernighan公开的一个方法 unsigned bit_count(unsigned v) { unsigned int c; //置位总数累计 ; v; c++) { v ...

  3. 常用免费快递查询API对接案例

    现在许多电商公司和ERP都会寻找比较适用的集成快递查询接口,减少对接难度,现在整理一下常用的免费快递查询接口,并附上调用案例,如果有觉得不对的地方,望能够一起沟通探讨! 一.快递查询接口 目前有提供免 ...

  4. ListView控件的列表项的文字不满一行的时候,如何实现点击该列表项的空白区域仍可触发列表项的点击事件

    今天在做Demo的过程中,使用到了ListView.然而在实现过程中,发现一个出现了一个问题:只能点击列表项的文字区域可以触发点击事件,而点击列表项的空白区域无法触发点击事件. 如下图: listit ...

  5. Centos 6.5 安装 chrome , mplayer , alarm , clock

    http://my.oschina.net/jianweizhang/blog/306946 Chrome wget http://chrome.richardlloyd.org.uk/install ...

  6. 【转载】Git的安装与使用

    Git的安装与使用  转载来源:http://www.cnblogs.com/Bonker/p/3441781.html 1,下载git https://code.google.com/p/msysg ...

  7. iis7 php urlrewrite 并隐藏index.php

    <rewrite> <rules> <rule name="OrgPage" stopProcessing="true"> ...

  8. c# 远程监控(3) RTP协议 RTP.NET.DLL

    我们在上一期已经可以获取视频或者摄像头数据,并可以获取帧数据,那么我们这一期就研究下RTP,并发送数据到目标服务器. RTP协议简介 这位朋友讲的很好:http://blog.csdn.net/bri ...

  9. 快速了解Scala技术栈

    http://www.infoq.com/cn/articles/scala-technology/ 我无可救药地成为了Scala的超级粉丝.在我使用Scala开发项目以及编写框架后,它就仿佛凝聚成为 ...

  10. Extjs3 Combo实现百度搜索查询

    在Extjs中实现Combo手输模糊筛选出下拉框数据.之前一直利用的Combo的keyup来实时的请求数据库进行查询.最近发现了一个更好的方式:只需要引用一个ComboBoxQuery Ext.ns( ...