CentOS 6.4安装AMH面板
复制以下代码 然后执行
或者下载wget http://amysql.com/file/AMH/3.2/amh.sh; chmod 775 amh.sh; ./amh.sh 2>&1 | tee amh.log;
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
wget http://down1.chinaunix.net/distfiles/libiconv-1.14.tar.gz
clear;
# Logo ******************************************************************
CopyrightLogo='
AMH 5.2
Powered by amh.sh -
http://amh.sh All Rights Reserved ==========================================================================';
echo "$CopyrightLogo"; # VAR ******************************************************************
InstallModel=$;
InstallFrom=$;
SysName='';
SysBit='';
CpuNum='';
RamTotal='';
RamSwap='';
StartDate='';
StartDateSecond='';
RandomValue=$RANDOM;
IPAddress=`ip addr | egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | egrep -v "^192\.168|^172\.1[6-9]\.|^172\.2[0-9]\.|^172\.3[0-2]\.|^10\.|^127\.|^255\." | head -n `;
DefaultPassword='';
InstallStatus='';
ServerLocation='';
MirrorHost='code.amh.sh'; # Version
AMHVersion='amh-5.2';
AMHConfVersion='amh-conf-5.2';
LibiconvVersion='libiconv-1.14';
MysqlVersion='mysql-generic-5.5.40';
PhpVersion='php-generic-5.3.28';
NginxVersion='nginx-generic-1.6.0'; # InstallModel
if [ "$InstallModel" == 'gcc' ]; then
MysqlVersion='mysql-5.5.40';
PhpVersion='php-5.3.28';
NginxVersion='nginx-1.6.0';
fi; # Function List *******************************************************************************
function CheckSystem()
{
[ $(id -u) != '' ] && echo '[Error] Please use root to install AMH.' && exit;
egrep -i "debian" /etc/issue /proc/version >/dev/null && SysName='Debian';
egrep -i "ubuntu" /etc/issue /proc/version >/dev/null && SysName='Ubuntu';
whereis -b yum | grep '/yum' >/dev/null && SysName='CentOS';
#egrep -i "red hat|redhat" /etc/issue /proc/version >/dev/null && SysName='RedHat';
#egrep -i "centos" /etc/issue /proc/version >/dev/null && SysName='CentOS';
[ "$SysName" == '' ] && echo '[Error] Your system is not supported install AMH' && exit; SysBit='' && [ `getconf WORD_BIT` == '' ] && [ `getconf LONG_BIT` == '' ] && SysBit='';
CpuNum=`cat /proc/cpuinfo | grep 'processor' | wc -l`;
echo "${SysName} ${SysBit}Bit";
RamTotal=`free -m | grep 'Mem' | awk '{print $2}'`;
RamSwap=`free -m | grep 'Swap' | awk '{print $2}'`;
echo "Server ${IPAddress}";
echo "${CpuNum}*CPU, ${RamTotal}MB*RAM, ${RamSwap}MB*Swap";
echo ''; if ! echo "${MysqlVersion}${PhpVersion}" | grep '.*generic.*generic.*' >/dev/null; then
RamSum=$[$RamTotal+$RamSwap];
[ "$SysBit" == '' ] && [ "$RamSum" -lt '' ] && \
echo -e "[Error] Not enough memory install AMH. \n(32bit system need memory: ${RamTotal}MB*RAM + ${RamSwap}MB*Swap > 250MB)" && exit; if [ "$SysBit" == '' ] && [ "$RamSum" -lt '' ]; then
echo -e "[Error] Not enough memory install AMH. \n(64bit system need memory: ${RamTotal}MB*RAM + ${RamSwap}MB*Swap > 480MB)";
[ "$RamSum" -gt '' ] && echo "[Notice] Please use 32bit system.";
exit;
fi;
fi;
} function SetPassword()
{
DefaultPassword=`echo -n "${IPAddress}_${RandomValue}_$(date)" | md5sum | sed "s/ .*//" | cut -b -`;
echo '[Notice] AMH and MySQL Account:';
echo "admin: ${DefaultPassword}";
echo -e "root: \033[36m${DefaultPassword}\033[0m ";
echo '==========================================================================';
} function ConfirmInstall()
{
echo -e "[Notice] Confirm Install - AMH 5.2 \nPlease select your nearest mirror: (1~4)"
select selected in 'China [CN]' 'United States [USA]' 'Japan [JP]' 'Other [ALL]' 'Exit'; do break; done;
[ "$selected" == 'Exit' ] && echo 'Exit Install.' && exit;
[ "$selected" != '' ] && echo -e "[OK] You Selected: ${selected}\n" && ServerLocation=$selected && return ;
ConfirmInstall;
} function CloseSelinux()
{
[ -s /etc/selinux/config ] && sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config;
setenforce >/dev/null >&;
} function InstallReady()
{
rm -rf /etc/localtime;
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime; echo "$ServerLocation" | grep -q 'China' && MirrorHost='code2.amh.sh';
if [ "$SysName" == 'CentOS' ]; then
yum_repos_s=`ls /etc/yum.repos.d | wc -l`;
if [ "$yum_repos_s" == '' ]; then
sed -i 's/^exclude/#exclude/' /etc/yum.conf;
release_n='' && grep 'release 6' /etc/issue && release_n='';
basearch_n='i386' && [ "$SysBit" == '' ] && basearch_n='x86_64';
cd /etc/yum.repos.d;
wget http://${MirrorHost}/files/amh-redhat${release_n}-base.repo;
sed -i "s#\$releasever#$release_n#g" amh-redhat${release_n}-base.repo;
sed -i "s#\$basearch#$basearch_n#g" amh-redhat${release_n}-base.repo;
yum clean all;
yum makecache;
fi;
yum -y install gcc gcc-c++ make curl bzip2 ntp vixie-cron;
else
apt-get -y update;
apt-get -y install gcc g++ make curl bzip2 ntpdate cron;
fi; ntpdate -u pool.ntp.org;
StartDate=$(date);
StartDateSecond=$(date +%s);
echo "Start time: ${StartDate}"; groupadd www;
useradd -m -s /sbin/nologin -g www www; mkdir -p /root/amh/{modules,conf};
mkdir -p /home/{wwwroot,usrdata};
cd /tmp/;
wget http://${MirrorHost}/files/${AMHConfVersion}.tar.gz;
tar -zxvf ${AMHConfVersion}.tar.gz;
\cp -a ./${AMHConfVersion}/conf /root/amh/;
chmod -R /root/amh/conf /root/amh/modules;
gcc -o /bin/amh -Wall ./${AMHConfVersion}/conf/amh.c;
chmod /bin/amh;
echo $ServerLocation >/root/amh/conf/location.conf;
rm -rf ${AMHConfVersion}.tar.gz ${AMHConfVersion} /root/amh/conf/amh.c;
} function InstallBaseModule()
{
amh download ${LibiconvVersion};
amh download ${MysqlVersion};
amh download ${NginxVersion};
amh download ${PhpVersion};
amh download ${AMHVersion}; amh ${LibiconvVersion} install && \
amh ${MysqlVersion} install ${DefaultPassword} && \
amh ${NginxVersion} install && \
amh ${PhpVersion} install && \
amh ${AMHVersion} install ${NginxVersion} ${MysqlVersion} ${PhpVersion} ${DefaultPassword} ${DefaultPassword} ${InstallFrom} && InstallStatus='success';
} # AMH Installing ****************************************************************************
CheckSystem;
SetPassword;
ConfirmInstall;
CloseSelinux;
InstallReady;
InstallBaseModule; echo '==========================================================================';
if [ "${InstallStatus}" == 'success' ]; then
echo '[AMH] Congratulations, AMH 5.2 install completed.';
echo "AMH Management: ";
echo "http://${IPAddress}:8888";
echo "https://${IPAddress}:9999";
echo 'AMH User: admin';
echo -e "AMH Password: \033[36m${DefaultPassword}\033[0m ";
echo "MySQL User: root";
echo -e "MySQL Password: \033[36m${DefaultPassword}\033[0m ";
echo '';
echo "Start time: ${StartDate}";
echo "Completion time: $(date) (Use: $[($(date +%s)-StartDateSecond)/60] minute)";
echo 'More help please visit:http://amh.sh';
else
echo 'Sorry, Failed to install AMH';
echo 'Please contact us: http://amh.sh';
fi;
echo '==========================================================================';
.安装成功的界面如下
CentOS 6.4安装AMH面板的更多相关文章
- CentOS 6.4安装Kangle面板
kangle web server一键安装包是一个用Linux Shell编写的可以为CentOS 6 VPS(VDS)或独立主机安装kangle web server(kangle,easypane ...
- [转]瓦的VPS后台kiwivm面板使用+安装AMH+装VPN
参考网址:http://u-lis.com/archives/4159 ZC:网页图片保存于“百度云 OsSkill --> 全部文件 > 知识__来自网页 > 瓦 > 瓦_面 ...
- 【Python】安装MySQLdb模块centos 6.1 宝塔Linux面板 MySQL5.6
[Python]安装MySQLdb模块centos 6.1 宝塔Linux面板 MySQL5.6 总之是各种坑 先说一下,宝塔安装在centos 6.1 i368 也就是32位系统上的方法 https ...
- Linux Centos安装宝塔面板教程
材料:阿里云服务器远程ip地址和购买服务的账号和密码 版本Centos 6.9版本 用Xshell远程登录安装宝塔 Xshell的界面是这样的,如图 点击左上角新建回话可以创建一个新的SSH连接,如图 ...
- 对比WDCP面板与AMH面板的区别与选择
转载: http://www.laozuo.org/2760.html | 老左博客 随着VPS主机的性价比提高(其实就是降价)我们很多站长会越来越多的选择使用VPS搭建网站或者运营一些项目,相比较而 ...
- [软件研究]对AMH面板的研究
0x00 前言 继续研究,这次来看一下AMH面板,图截自官网 就让我们来看看这个多个"首个"的面板做的怎么样吧. 0x01 安装 官方提供了两种安装方式,一是极速安装,二是编译安装 ...
- Vultr VPS建站攻略 – 一键安装宝塔面板架设LNMP/LAMP Web环境
我们选择VULTR VPS建站的还是比较多的,其主要原因在于商家的稳定,毕竟我们用来建站选择服务器价格考虑的不是主要的(当然VULTR价格也是比较便宜),最为主要的是因为VULTR商家比较稳定,而且多 ...
- CentOS 7 需要安装的常用工具,及centos安装fcitx 搜狗输入法的坑旅
https://blog.csdn.net/tham_/article/details/41868831 Centos常用设置 1.当最大化时隐藏标题栏 或者使用tweak tool 在字体中将标题栏 ...
- Linux课程---1、VMWare安装CentOS虚拟机(安装重要注意)
Linux课程---1.VMWare安装CentOS虚拟机(安装重要注意) 一.总结 一句话总结: 可以先去百度搜一篇对应系统的安装教程:比如 CentOS 7 安装 1.安装VMWare之后,打开w ...
随机推荐
- .NET Session操作
public class SessionHelper { /// <summary> /// 根据session名获取session对象 /// </summary> /// ...
- 算法库:OpenCV3编译配置
2016-01-20 23:55 更新: 关于Opencv3.1的lib文件 opencv_aruco310d.libopencv_bgsegm310d.libopencv_bioinspired3 ...
- Missing artifact com.sun:tools:jar:1.5.0:system 补充
转自:http://blog.csdn.net/sweblish/article/details/6662586 解决方案一: 原来,是${java.home}在作怪,eclipse 没有使用 JAV ...
- SQL server 2016 安装步骤
1.进入安装中心:可以参考硬件和软件要求.可以看到一些说明文档 2.选择全新安装模式继续安装 3.输入产品秘钥:这里使用演示秘钥进行 4.在协议中,点击同意,并点击下一步按钮,继续安装 5.进入全局规 ...
- 查看mysql 的物理存储路径
mysql> show global variables like "%datadir%";
- 关于Windows平台下应用程序加载DLL模块的问题.
本文将讨论以下问题: (1)Windows可执行程序会从哪些目录下加载DLL. (2)如何将可执行使用的DLL放置到统一的目录下,而不是与EXE同一目录. (3)可执行程序加载了不该加载的DLL. ( ...
- Orchard官方文档翻译(六) 建立你的第一个Orchartd站点
让我们开始 该主题内容已在Orchard1.8Release版本下测试通过. 这里通过向导式的教程来告诉大家Orchard的功能如何使用.如果你是第一次使用Orchard,该文档就是为你而准备的! O ...
- flash上传在spring mvc中出现的问题2
转载请注明: TheViper http://www.cnblogs.com/TheViper 这两天本屌在做flash拼图上传遇到点坑 上传原理很简单,就是把上图右边画布区域BitmapData. ...
- 解决ScrollView下嵌套ListView、GridView显示不全的问题
/** * 自定义gridview,解决ListView中嵌套gridview显示不正常的问题(1行半) * @author wangyx * @version 1.0.0 2012-9-14 */ ...
- idea 下的maven使用问题汇总
1,-Dmaven.multiModuleProjectDirectory system propery is not set. Check $M2_HOME environment variable ...