ubuntu14.04配置lnmp
看到了一片讲解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的更多相关文章
- Caffe+CUDA7.5+CuDNNv3+OpenCV3.0+Ubuntu14.04 配置参考文献 以及 常见编译问题总结
Caffe+CUDA7.5+CuDNNv3+OpenCV3.0+Ubuntu14.04 配置参考文献 ---- Wang Xiao Warning: Please make sure the cud ...
- Caffe+CUDA8.0+CuDNNv5.1+OpenCV3.1+Ubuntu14.04 配置参考文献 以及 常见编译问题总结
Caffe + CUDA8.0 + CuDNNv5.1 + OpenCV3.1 + Ubuntu14.04 配置参考文献 ---- Wang Xiao Anhui University CVPR ...
- Ubuntu14.04配置gcc4.4.4+Qt4.8.4交叉编译环境
安装32位程序运行支持 sudo apt-get install lib32stdc++6 lib32z1 lib32ncurses5 lib32bz2-1.0 可能报错: lib32stdc++6 ...
- ubuntu14.04 配置网络
ubuntu14.04 配置网络的练习 本文参考的资料: https://blog.csdn.net/liu782726344/article/details/52912797. 感谢作者的分享! 打 ...
- ubuntu14.04 安装LNMP
新书上市<深入解析Android 5.0系统> 通常我们使用centos来组建LNMP,可是我们开发时多使用ubuntu的桌面版本号来调试,以下将具体介绍怎样在ubuntu上安装一套LNM ...
- Ubuntu14.04配置Mono+Jexus
总所周知,ASP.NET是微软公司的一项技术,是一个网站服务端开发的一种技术,它可以在通过HTTP请求文档时再在Web服务器上动态创建它们,就是所谓动态网站开发,它依赖运行于 IIS 之中的程序 .但 ...
- ubuntu14.04 配置中文输入法
ubuntu14.04自带中文输入法,只要配置就可以了. 1.安装中文支持 System Settings --> Language Support 点击 install/remove lan ...
- ubuntu14.04配置中文latex完美环境(texlive+texmaker+lyx)
Ubuntu下的文档编辑虽然有libreoffice,但对中文和公式的排版始终不如ms office,因此要想写出高质量的文档,只能靠latex了,现在随着xeCjk的开发,中文文档在ubuntu下的 ...
- 64位ubuntu14.04配置adb后提示没有那个文件或目录
1.配置完adb环境变量后在终端输入adb: ameyume@ameyume-HP-450-Notebook-PC:~$ adb /home/ameyume/adt-bundle-linux-x86_ ...
随机推荐
- android122 zhihuibeijing 主页面使用fragment搭建
fragment的生命周期: onAttach()当fragment添加进Activity的时候调用(这个时候Activity对 ...
- android117 下拉列表
- Android(java)学习笔记136:Java类初始化顺序
Java类中初试化的顺序: 由此得出Java普通类初始化顺序结论: 静态变量 静态初始化块 变量 初始化块 构造器 由此得出Java继承类初始化顺序结论: 1 .继承体系的所有静态成员初始化( ...
- python <type 'exceptions.UnicodeDecodeError'>: 'ascii' codec can't decode byte 0xe6 in position 0: ordinal not in range(128)解决
import sysimport osimport stringreload(sys) sys.setdefaultencoding("utf8")
- 分布式 ES 操作流程解析
概念解析 CURD 操作 CURD 操作都是针对具体的某个或某些文档的操作,每个文档的 routing 都是确认的,所以其所在分片也是可以事先确定的.该过程对应 ES 的 Document API. ...
- NUMA CPU optimization
technologies: OS, CPU cache, numa structure, memory access
- 关于Eclipse中配置产品启动的插件
比较省事的是白哥给我一个配置文件(EE_CONF_TEST.launch),使用的方法白哥推荐我新建一个普通的java项目,然后拷贝到这个项目中. 拷贝到项目中之后在Run Configuration ...
- Divide and conquer method
分治法是最广泛使用的算法设计方法之一,其基本思想:把大问题分解成一些较小的问题,然后由小问题的解方便地构造出大问题的解. 分治法说穿了就是把问题放小,如果被分的问题还是比较大,那么久继续分下去.为了能 ...
- 信号量 Semaphore
一.简介 信号量(Semaphore),有时被称为信号灯,是在多线程环境下使用,负责协调各个线程, 以保证它们能够正确.合理的使用公共资源. Semaphore可以控制某个资源可被同时 ...
- jquery easyui combobox 级联及触发事件,combobox级联
jquery easyui combobox 级联及触发事件,combobox级联 >>>>>>>>>>>>>>&g ...