一、LNMP的安装

##先要下载,并根据不同系统进行安装:

wget -c http://soft.vpser.net/lnmp/lnmp1.2.tar.gz

tar zxvf lnmp1.2.tar.gz

cd lnmp1.0

./install.sh#开始进行安装操作

以上为下载及进入安装过程,以下为安装前简易设置,切记输入个其它域名及牢记mysql密码:

+------------------------------------------------------------------------+

| LNMP V1.2for Ubuntu Linux Server, Written by Licess |

+------------------------------------------------------------------------+

| A tool to auto-compile &install LNMP/LNMPA/LAMP on Linux |

+------------------------------------------------------------------------+

| Formore information please visit http://www.lnmp.org ; |

+------------------------------------------------------------------------+

Please setup root password of MySQL.(Default password: root)

Please enter: vpsmm.com#输入mysql的root密码

MySQL root password: vpsmm.com

===========================

Do you want toenable or disable the InnoDB Storage Engine?

Defaultenable,Enter your choice [Y/n]: n#是否安装InnoDB

You will disable the InnoDB Storage Engine!

===========================

You have 5 optionsfor your DataBaseinstall.

1: Install MySQL 5.1.73

2: Install MySQL 5.5.42 (Default)

3: Install MySQL 5.6.23

4: Install MariaDB 5.5.42

5: Install MariaDB 10.0.17

Enter your choice (1, 2, 3, 4 or 5): 3#选择mysql版本

You will Install MySQL 5.6.23

===========================

You have 5 optionsfor your PHPinstall.

1: Install PHP 5.2.17

2: Install PHP 5.3.29

3: Install PHP 5.4.41 (Default)

4: Install PHP 5.5.25

5: Install PHP 5.6.9

Enter your choice (1, 2, 3, 4 or 5): 5#选择php版本

You willinstall PHP 5.6.9

===========================

You have 3 optionsfor your Memory Allocatorinstall.

1: Don'tinstall Memory Allocator. (Default)

2: Install Jemalloc

3: Install TCMalloc

Enter your choice (1, 2 or 3): 1#小夜用不上,所以选择1

You willinstall notinstall Memory Allocator.

#按任意键,设置完成,正式进入安装,预计20-40分钟完成

常见lnmp管理命令:

#1.2版本以后,不需要再执行/root/lnmp了,可以在任意位置执行lnmp命令

lnmp#会出现一些提示信息

lnmp restart#重启

lnmp vhost add#添加网站绑定

lnmp database add#添加数据库信息

二,域名绑定详解

其实所谓的域名绑定,就是通过命令的形式,简易创建一个conf文件到/usr/local/nginx/conf/vhost下面,这个过程完全可以手工创建conf,或者,平时修改目录、域名等,直接修改conf文件,效果完全一样:

lnmp vhost add#执行lnmp添加网站命令

+-------------------------------------------+

| Managerfor LNMP, Written by Licess |

+-------------------------------------------+

Please enter domain(example: www.lnmp.org): vpsmm.com#输入绑定的主域名

======================================

Your domain: vpsmm.com

======================================

Do you want to addmore domain name? (y/n) y#是否绑定其它域名

Enter domain name(example: lnmp.org *.lnmp.org): www.vpsmm.com#输入其它域名

domain list: www.vpsmm.com

Please enter the directoryfor the domain: vpsmm.com

(Default directory: /home/wwwroot/vpsmm.com):#默认创建的网站文件所在目录

Virtual Host Directory: /home/wwwroot/vpsmm.com

===========================

Allow Rewrite rule? (y/n)

===========================

y#是否添加伪静态文件

Please enter the rewrite of programme:

wordpress,discuz,typecho,sablog,dabr rewrite was exist.

(Default rewrite: other):typecho#小夜用的typecho程序

===========================

You choose rewrite=typecho

===========================

===========================

Allow access_log? (y/n)

===========================

n#是否启用日志文件

======================================================

Create database and MySQL user with same name (y/n)

======================================================

y#是否创建mysql数据库

verify your current MySQL root password: ****#输入安装时的mysql数据库root密码

Warning: Using a password on thecommand line interface can be insecure.

MySQL root password correct.

Enter database name: vpsmm_user#创建数据库用户名

Your will create a database and MySQL user with same name: vpsmm_user

Please enter passwordfor mysql user vpsmm_user: vpsmmpasswd

Your password: vpsmmpasswd#创建相应密码

Press any key to start create virtul host...

Create Virtul Host directory......

set permissions of Virtual Host directory......

Youselect the exist rewrite rule:/usr/local/nginx/conf/typecho.conf

Gracefully shutting down php-fpm .done

Starting php-fpmdone

Test Nginx configurefile......

nginx: the configurationfile /usr/local/nginx/conf/nginx.conf syntax is ok

nginx: configurationfile /usr/local/nginx/conf/nginx.conftest is successful

Restart Nginx......

Warning: Using a password on thecommand line interface can be insecure.

Warning: Using a password on thecommand line interface can be insecure.

User vpsmm_user create Sucessfully.

Warning: Using a password on thecommand line interface can be insecure.

Warning: Using a password on thecommand line interface can be insecure.

Warning: Using a password on thecommand line interface can be insecure.

Database: vpsmm_user create Sucessfully.

Warning: Using a password on thecommand line interface can be insecure.

Warning: Using a password on thecommand line interface can be insecure.

GRANT ALL PRIVILEGES ON vpsmm_user Sucessfully.

Warning: Using a password on thecommand line interface can be insecure.

FLUSH PRIVILEGES Sucessfully.

================================================

Virtualhost infomation:

Your domain: vpsmm.com

Home Directory: /home/wwwroot/vpsmm.com

Rewrite: typecho

Enable log: no

Database username: vpsmm_user

Database userpassword: vpsmmpasswd

Database Name: vpsmm_user

Createftp account: no

#以上为新创建网站的一些信息

================================================

三、自定义伪静态规则

如果lnmp默认的伪静态规则不能满足你的需要,或者,你要自行定义伪静态规则,可以新建一个conf文件,放置于 /usr/local/nginx/conf 下,在域名配置文件,即:/usr/local/nginx/conf/vhost/legcloud.com.conf 里引用。

server

{

listen 80;

server_name legcloud.com www.legcloud.com;#绑定的域名

index index.html index.htm index.php default.html default.htm default.php;#首页文件

root /home/legcloud.com;#网站存放目录

include wordpress.conf;#伪静态规则文件,可自定义成你需要的

location ~ .*\.(php|php5)?$

{

try_files $uri =404;

fastcgi_pass unix:/tmp/php-cgi.sock;

fastcgi_index index.php;

include fcgi.conf;

}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$

{

expires 30d;

}

location ~ .*\.(js|css)?$

{

expires 12h;

}

access_log off;

}

修改设置以后,一定要重新载入lnmp或者,重新载入nginx,以下任决命令都一样:

/root/lnmp reload#使用lnmp重新载入配置

/etc/init.d/nginx reload#只重新载入nginx配置,我一般用这个

四、自定义404、503等常见错误

不管是404还是503等常见错误,还是设置/usr/local/nginx/conf/vhost/legcloud.com.conf文件来完成:

listen 80;

server_name legcloud.com www.legcloud.com;

index index.html index.htm index.php default.html default.htm default.php;

root /home/legcloud.com;

error_page 404 /404.php;#放在这里,可自定义文件名,再重载nginx就可以了

include wordpress.conf;

五、判断当前域名并自动301到主域名

if ($host != 'vpsmm.com' ) {rewrite ^/(.*)$ http://www.vpsmm.com/$1 permanent;}

#判断当前域名,如果不是则自动301到主域名,放置于error_page ...;上下均可。

六、关闭或开启FSO等php函数

lnmp最新版,默认禁用了一些函数,例如fso等,可修改/usr/local/php/etc/php.ini

disable_functions = passthru,exec,system,chroot,scandir....

#----这是禁用函数,把不想禁用的删除即可----如果自用主机,最简单的修改方案:

disable_functions =

; passthru,exec,system,chroot,scandir....

#----设置为全部开启

修改后,使用/etc/init.d/php-fpm restart,重新启动php

七、升级PHP和NGINX版本

cd lnm0.9#进入lnmp安装目录

./upgrade_nginx.sh#升级nginx,只要输入你要升级的版本即可(可见nginx.org)

./upgrade_php.sh#升级php,只要输入你要升级的版本即可(可见php.net)

memory allocator php,LNMP的安装相关推荐

  1. A good memory allocator is everything that I need

    A good memory allocator is everything that I need A good memory allocator is everything that I need, ...

  2. lnmp yum安装mysql_centos5 yum安装lnmp

    之所以转载这篇文章,是因为咱们如果一直使用军歌的编译安装包的话,那么时间上浪费不少(性能优秀的vps都至少需要17分钟安装lnmp.org的lnmp),因此阿福极力推荐使用yum安装. YUM安装特点 ...

  3. Centos下lnmp编译安装详细过程

    整理下lnmp安装步骤: 相关软件用的lnmp一键安装的全包,懒得去到处找软件源 完整版:http://soft.vpser.net/lnmp/lnmp0.7-full.tar.gz(66.64MB) ...

  4. Lnmp上安装Yaf学习(二)

    上一节主要实践了在Lnmp上安装Yaf扩展,那么这一节将测试 Yaf 的一个简单demo的运行. 一.通过Lnmp 创建 vhost 文件 [root@localhost yaf-3.0.6]# ln ...

  5. wordpress支持MySQL5.5_CentOS 5.5安装Nginx、PHP(FastCGI)、MySQL --搭建LNMP环境安装Wordpress...

    一.总体介绍 系统环境  CentOS release 5.5 (Final)   ,kernel  2.6.18-194.el5 安装 Nginx . PHP(FastCGI)   . MySQL  ...

  6. linux安装yum的脚本,lnmp一键安装脚本yum方式快速安装

    自己编写的yum安装方式的LNMP一键安装脚本,yum方式安装,速度非常快,目前只有centos版本,其他系统没有弄. Centos5 chmod +x lnmp.sh sh lnmp.sh Cent ...

  7. Lnmp上安装Yaf学习(一)

    今天学习Lnmp上面如何安装Yaf流程 一.安装Lnmp 集成环境 访问路径:https://lnmp.org/install.html 这里我安装稳定版lnmp 1)   wget -c http: ...

  8. LNMP编译安装(centos7+nginx1.9+mysql5.6+php5.5)

    LNMP编译安装 # 需先配置IP # 软件包的路径 /usr/local/src yum install -y libjpeg-devel libpng-devel freetype-devel c ...

  9. lnmp编译安装mysql_LNMP编译安装教程

    LNMP编译安装教程 此次安装在Centos上,我采用的CentOS的版本是:CentOS release 6.5 (Final) 可以通过以下命令查看:lsb_release -a 一.准备工作: ...

  10. 内存分配器 (Memory Allocator)

    对于大多数开发者而言,系统的内存分配就是一个黑盒子,就是几个API的调用.有你就给我,没有我就想别的办法.来UC前,我就是这样认为的.实际深入进去时,才发现这个领域里也是百家争鸣,非常热闹.有操作系统 ...

最新文章

  1. iOS和android h5字体差异,关于移动hybrid开发中H5页面的字体应与系统保持一致的问题...
  2. truffle详细使用教程
  3. 深度学习基础系列(八)| 偏差和方差
  4. 我想看基金27005_宅家变富,你知道如何挑选股票基金吗?
  5. fluent计算进出口的流量差
  6. java中math方法语句,下列有关Java中标准类Math的random()方法的说法中,正确的是。 - 上学吧学历考试...
  7. 80-30-010-原理-React模式-简介
  8. upload组件 获得焦点_HTML Input FileUpload autofocus用法及代码示例
  9. 2019年 iPad无法充电
  10. vivo怎么设置默认桌面_vivoz3怎样设置默认桌面?
  11. 留言列表模板HTML代码
  12. win10系统与时间服务器同步超时,Win10时间同步出错怎么办 Win10时间同步出错解决方法...
  13. 人生的苦难需要时间去磨练
  14. 防火墙多选路出口(ISP选路、策略路由、智能选路)
  15. SEO到了岌岌可危的时刻吗?
  16. win7电脑无法设置默认打开方式
  17. win10忘记密码,重装系统
  18. python帮拿王者荣耀金币
  19. 前端要失业了么,sketch-code让草图秒变HTML
  20. SNMP协议以及著名的MIB详解

热门文章

  1. 青龙2.9及2.8Faker仓库互助教程
  2. 字符串匹配算法之Aho-Corasick
  3. Chrome浏览器数据本地备份
  4. 【无线电】摩尔斯电码的快速记忆法
  5. Executors一篇就够
  6. DNS是什么意思?什么是DNS服务器?(中科三方)
  7. 当年,学姐把这份Java总结给我,让我在22k的校招王者局乱杀
  8. Aurora使用技巧详解
  9. 12抽象工厂(Abstract Factory)
  10. [转载].NET Core使用NPOI导出复杂,美观的Excel详解