这个脚本由https://teddysun.com/lamp大哥提供:
截至至2016.11.12,支持CentOS/Redhat/Debian/Ubuntu各大linux系发行版。
关于该脚本:
支持 PHP 自带几乎所有组件;
支持 MySQL ,MariaDB, Percona 数据库;
支持 memcached (可选安装);
支持 ImageMagick (可选安装);
支持 GraphicsMagick (可选安装);
支持 Zend Guard Loader (可选安装);
支持 ionCube PHP Loader (可选安装);
支持 XCache ,Zend OPcache (可选安装);
命令行新增虚拟主机,操作简便;
自助升级 Apache,PHP,phpMyAdmin,MySQL/MariaDB/Percona 至最新版本;
支持一键卸载(切记,卸载前请注意备份数据)。
下载
Github 项目主页:
https://github.com/teddysun/lamp
通过 Github 页面下载最新版:
https://github.com/teddysun/lamp/archive/master.zip
旧版本存档:
https://github.com/teddysun/lamp/archive/archive.zip
使用方法:
$ ~ sudo wget https://github.com/teddysun/lamp/archive/master.zip
$~ sudo unzip master.zip
$~ cd ./master
$~ sudo ./lamp.sh
{照着序号选择你想要的版本就可以了}
github上的主页对此脚本做了详细说明:
Installation
If your server system: CentOS
yum -y install wget screen unzip
wget --no-check-certificate -O lamp.zip https://github.com/teddysun/lamp/archive/master.zip
unzip lamp.zip
cd lamp-master
chmod +x *.sh
screen -S lamp
./lamp.sh
If your server system: Debian/Ubuntu
sudo apt-get -y install wget screen unzip
sudo wget --no-check-certificate -O lamp.zip https://github.com/teddysun/lamp/archive/master.zip
sudo unzip lamp.zip
cd lamp-master
sudo chmod +x *.sh
sudo screen -S lamp
sudo ./lamp.sh
Upgrade
./upgrade.sh // Select one to upgrade
./upgrade.sh apache // Upgrade Apache
./upgrade.sh db // Upgrade MySQL/MariaDB/Percona
./upgrade.sh php // Upgrade PHP
./upgrade.sh phpmyadmin // Upgrade phpMyAdmin
Backup
You must modify the config before run it
Backup MySQL/MariaDB/Percona datebases, files and directories
Backup file is encrypted with AES256-cbc with SHA1 message-digest (option)
Auto transfer backup file to Google Drive (need installgdrivecommand) (option)
Auto transfer backup file to FTP server (option)
Auto delete Google Drive's or FTP server's remote file (option)
./backup.sh
Uninstall
sudo ./uninstall.sh
Default Location 安装默认使用的存放位置,这个用来查询
Apache LocationPath
Install Prefix /usr/local/apache
Web root location /data/www/default
Main Configuration File /usr/local/apache/conf/httpd.conf
Default Virtual Host conf /usr/local/apache/conf/extra/httpd-vhosts.conf
Virtual Host location /usr/local/apache/conf/vhost/
PHP LocationPath
Install Prefix /usr/local/php
Configuration File /usr/local/php/etc/php.ini
ini additional location /usr/local/php/php.d
MySQL LocationPath
Install Prefix /usr/local/mysql
Data Location /usr/local/mysql/data
my.cnf Configuration File /etc/my.cnf
MariaDB LocationPath
Install Prefix /usr/local/mariadb
Data Location /usr/local/mariadb/data
my.cnf Configuration File /etc/my.cnf
Percona LocationPath
Install Prefix /usr/local/percona
Data Location /usr/local/percona/data
my.cnf Configuration File /etc/my.cnf
Process Management 进程管理
ProcessCommand
Apache /etc/init.d/httpd (start|stop|status|restart)
MySQL /etc/init.d/mysqld (start|stop|status|restart)
MariaDB /etc/init.d/mysqld (start|stop|status|restart)
Percona /etc/init.d/mysqld (start|stop|status|restart)
Memcached /etc/init.d/memcached (start|stop|restart)
Redis-Server /etc/init.d/redis-server (start|stop|restart)
lamp Command lamp命令
CommandDescription
lamp add create a virtual host
lamp list list all virtual host
lamp del remove a virtual host