看到了一片讲解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. kernel debuging

    http://blog.csdn.net/XscKernel/article/category/1276234

  2. Git链接到自己的Github(2)进阶使用

    接着上一篇的,从github clone下代码. 1.先查看当前开发分支 $ cat .git/HEAD ref: refs/heads/master 这里的master是默认分支. 2.查看当前状态 ...

  3. git svn 5点区别

    如果你在读这篇文章,说明你跟大多数开发者一样对GIT感兴趣,如果你还没有机会来试一试GIT,我想现在你就要了解它了. GIT不仅仅是个版本控制系统,它也是个内容管理系统(CMS),工作管理系统等.如果 ...

  4. 【转】字符串分割(C++)

    原文:http://www.cnblogs.com/MikeZhang/archive/2012/03/24/mysplitfuncpp.html 经常碰到字符串分割的问题,这里总结下,也方便我以后使 ...

  5. Android(java)学习笔记121:android.intent.action.MAIN 与 android.intent.category.LAUNCHER 理解

    先看看网路上的说法: android.intent.action.MAIN决定应用程序最先启动的 Activity android.intent.category.LAUNCHER决定应用程序是否显示 ...

  6. felx第二天 ActionScript 基本语法和关键字

    flex中使用的注解有两种分别是:// 和/**/ flex使用的关键字如图

  7. Excel导入导出帮助类

    /// <summary>    /// Excel导入导出帮助类    /// 记得引入 NPOI    /// 下载地址   http://npoi.codeplex.com/rele ...

  8. 自定义异常以及runtime类

    一.自定义异常: 1.自定义异常的概念:在java编程中,我们会遇到很多问题,但是这些问题异常,java并没有给我们定义好,那么我们就要自己定义这些异常,这就是自定义异常: 2.throws 是声明异 ...

  9. matlab中disp函数的使用

    disp函数直接将内容输出在Matlab命令窗口中, 关键是看disp函数怎么把字符和数字在一起进行显示. matlab中disp()就是屏幕输出函数,类似于c语言中的printf()函数 %%以下是 ...

  10. oracle添加表字段跟修改表字段属性

    添加字段 alter table mid_contactinfo add(status varchar(20),createdate varchar(50),modifydate varchar(50 ...