http://www.lanmps.com/install.html
安装环境:centos6.5,centos6.7中均安装成功
安装
1.使用SSH工具登陆服务器
登陆成功后运行:screen -S lanmps
注意:此步为了防止SSH登陆超时或掉线,中断安装(lanmps 为自定义名称)。
如果掉线了,执行 screen -r lanmps ,即可恢复 掉线前的执行界面,如果忘记名字了,执行 screen -ls 会列出所有会话列表,其中 数字.lanmps 即为刚才的会话
如果提示screen: command not found 命令不存在。
CentOS 可以执行:yum install -y screen
Ubuntu可以执行:apt-get install -y screen
查看是什么系统的命令:cat /etc/issue
然后上传文件到服务器上,在当前目录下执行(根据最新版本的版本号,更改下面相应的代码版本号):
tar -zxvf lanmps-2.2.2.tar.gz && cd lanmps-2.2.2 && ./lanmps.sh
执行上述命令后,会出现以下提示:
2.1 上图中是要选择安装套件类别(默认选1)
目前只有 一种 nginx php mysql opcache memcache phpmyadmin xdebug sphinx
以后会在新版中增加功能
don’t install is now :现在不安装,退出
2.2 上图中是选择php版本(默认选则1,都选默认的比容易安装成功)
don’t install is now :现在不安装,退出
2.3 上图中,提示”Press any key to start…”,按任意键开始安装
LANMPS脚本就会自动安装编译Nginx、MySQL、PHP、phpMyAdmin、Opencache、Memcache、Xdebug这几个软件。
其中Xdebug默认关闭,如需使用在php.ini开启(开启教程)。
安装时间可能会几十分钟到几个小时不等,主要是机器的配置网速等原因会造成影响。
3.安装完成
如果出现以下界面,则说明安装成功!
设置开机自动启动:
把启动程序的命令添加到/etc/rc.d/rc.local文件中,在rc.local中增加红色的那几行;
[root@localhost ~]# cat /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
/www/lanmps/action/nginx start
/www/lanmps/action/httpd start
/www/lanmps/action/mysql start
/www/lanmps/action/php-fpm start
/www/lanmps/action/memcached start
[root@localhost ~]#
nginx下配置站点:
进入安装文件所在目录
[root@iZ62vgzgugyZ ~]# ls
lanmps lanmps-2.2.3 lanmps-2.2.3.tar.gz vhost.sh
运行./vhost.sh,按提示输入域名即可
[root@iZ62vgzgugyZ ~]# ./vhost.sh
然后会产生一个配置文件于:/www/lanmp/nginx/conf/vhost/上一步输入的域名.conf
如:
[root@iZ62vgzgugyZ vhost]# ls
00000.default.conf www.3gcb.com.conf www.gupiaojz.com.conf
00000.default.conf为默认配置文件
thinkphp rewrite模式=2时伪静态配置:
加入红色那段代码即可
[root@iZ62vgzgugyZ vhost]# cat www.3gcb.com.conf
server
{
listen 80;
server_name www.3gcb.com ;
root /www/wwwroot/www.3gcb.com;
location / {
index index.html index.htm index.php default.html default.htm default.php;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 30d;
}
location ~ .*.(js|css)?$ {
expires 12h;
}
location ~ .php$ {
#fastcgi_pass 127.0.0.1:9000;
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass bakend;
fastcgi_index index.php;
include fastcgi.conf;
}
include /www/wwwroot/www.3gcb.com/lanmps-*.conf;
access_log off;
}
phpmyadmin默认帐号
安装完成后直接访问主机ip地址,在里面的链接中可以进入phpmyadmin,默认用户名和密码均为root
- 相关文章
- win7中将文件拷贝到虚拟机linux下
- linux下切换root用户
- linux目录结构
- 为linux指定运行级别
- linux下vi编辑器的使用
- linux下安装java
- linux下安装tomcat
- linux下安装mysql
- linux下安装五笔输入法
- linux下在终端命令行中显示中文
- 热门文章
- win7中将文件拷贝到虚拟机linux下
- phpexcel设置行高及列宽,背景颜色,
- rabbitmq无法启动
- intellij idea不显示git push按钮
- php7中使用mongodb的aggregate进行
- centos7.4 64位下swoole安装及配置
- laravel页面静态化的方法
- navicate连接mycat报1184错误
- 单点登录sso原理及php实现方式及de
- devops-jenkins容器为pending状态
- 好评文章
- phpexcel设置行高及列宽,背景颜色,
- php7中使用mongodb的aggregate进行
- intellij idea打开文件所在文件夹
- windows下使用MongoDB Compass Com
- win7中将文件拷贝到虚拟机linux下
- laravel 中悲观锁 & 乐观锁的使用
- 单点登录sso原理及php实现方式及de
- navicate连接mycat报1184错误
- rabbitmq无法启动
- laravel整合dingo/api方法步骤:jwt
- 我的项目
- 【github】www.github.com/hurong241
- 【码云】gitee.com/hu_rong/projects
- 【docker hub】hub.docker.com/repositories/hurong241
- 【packagist】packagist.org/users/hurong241/packages
- 站点信息
- 建站时间:2011年
- 文章数:607篇
- 浏览数:935521