小沨的天空

  • 首页
  • Code
  • 图床
  • 网盘
  • 赞助
私人小天地
谈天说地,学习笔记
  1. 首页
  2. Linux
  3. 正文

腾讯云安装LNMP或自行配置其他环境注意的问题

2014年9月1日 1915点热度 0人点赞 0条评论

因为是腾讯做了安全设置,很多东西都无法直接换,腾讯有个内网更新源,贴出做个笔记

正好帮娃娃MJJ配置腾讯云的VPS环境,在配置环境前先下载内网更新源,更新一下(这个是要登录腾讯云在可以下载的因为是腾讯内网)

wget -c http://mirrors.tencentyun.com/install/softinst.sh
sh softinst.sh

内网软件更新源代码:

#!/bin/sh
PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/user_00/bin
dir=$(dirname $(which $0))
#default eth0
interface=eth1
tmpfile=/tmp/tmp`date +'%Y%m%d%H%M%S'`
/sbin/ifconfig > ${tmpfile} 2>&1
grep ^eth0 ${tmpfile}>/dev/null
[ $? -eq 0 ] && interface=eth0
grep ^eth1 ${tmpfile}>/dev/null
[ $? -eq 0 ] && interface=eth1
[ -f ${tmpfile} ] && rm -f ${tmpfile}
[ -z "${interface}" ] && echo "warn: interface not confirm"
eth1=`/sbin/ifconfig ${interface}|grep addr:|head -n 1|awk '{print $2}'|sed 's/addr://'`
script=`basename $0`
day=`date +%Y%m%d`

check_os()
{
  # check which OS and ver
  if [ -f /etc/SuSE-release ];then
    echo suse
  elif [ -f /etc/tlinux-release ];then
    echo tlinux
  elif [ -f /etc/centos-release ];then
    echo centos
  elif [ -f /etc/redhat-release ];then
    echo redhat
  elif [ -f /etc/os-release ];then
    grep Ubuntu /etc/os-release > /dev/null
    [ $? -eq 0 ] && echo ubuntu
  fi
}

os=`check_os`
if [ -z "$os" ]
then
  echo "ERROR: unknown OS type"
  exit 1
fi

setup_tlinux()
{
  rm *.repo 2>/dev/null
  for file in RPM-GPG-KEY-EPEL-6 RPM-GPG-KEY-rpmforge-dag epel.repo tlinux.repo;do
    wget -q http://mirrors.tencentyun.com/install/tlinux/$file
    if [ $? -ne 0 ];then
        echo "ERROR: download ${file} fail"
      exit 1
    fi
  done
  rm /etc/yum.repos.d/*.repo 2>/dev/null
  cp RPM-GPG-KEY-* /etc/pki/rpm-gpg/
  cp *.repo /etc/yum.repos.d
  yum clean all >/dev/null
  echo "Setup ok"
}

setup_centos()
{
  rm *.repo 2>/dev/null
  for file in RPM-GPG-KEY-EPEL-6 RPM-GPG-KEY-rpmforge-dag epel.repo rpmforge.repo centos.repo;do
    wget -q http://mirrors.tencentyun.com/install/centos/$file
    if [ $? -ne 0 ];then
      echo "Setup error, download fail"
      exit 1
    fi
  done
  #rm /etc/yum.repos.d/*.repo 2>/dev/null
  cp RPM-GPG-KEY-* /etc/pki/rpm-gpg/
  cp *.repo /etc/yum.repos.d
  yum clean all >/dev/null
  echo "Setup ok"
}

setup_redhat5()
{
  rm *.repo 2>/dev/null
  for file in epel.repo centos.repo;do
    wget -q http://mirrors.tencentyun.com/install/redhat5/$file
    if [ $? -ne 0 ];then
      echo "Setup error, download fail"
      exit 1
    fi
  done
  rm /etc/yum.repos.d/*.repo 2>/dev/null
  cp *.repo /etc/yum.repos.d
  yum clean all >/dev/null
  echo "Setup ok"
}

setup_ubuntu()
{
  rm *.repo 2>/dev/null
  for file in sources.list;do
    wget -q http://mirrors.tencentyun.com/install/ubuntu/$file
    if [ $? -ne 0 ];then
      echo "Setup error, download fail"
      exit 1
    fi
  done
  cp /etc/apt/sources.list /etc/apt/sources.list.`date +%F`
  cp sources.list /etc/apt/
  apt-get update
}

setup_suse()
{
  echo "SuSE10 do nothing"
  #do nothing
}


mkdir -p /tmp/softinst
cd /tmp/softinst
rm /tmp/softinst/* 2>/dev/null

echo "$os software install..."
if [ $os = "tlinux" ];then
  setup_tlinux
elif [ $os = "redhat" ];then
  setup_redhat5
elif [ $os = "centos" ];then
  setup_centos
elif [ $os = "ubuntu" ];then
  setup_ubuntu
elif [ $os = "SuSE" ];then
  setup_suse
else
  echo "ERROR: unsupprt OS type"
  exit 1
fi
[ -d /tmp/softinst ] && rm -rf /tmp/softinst*


标签: LNMP 腾讯云
最后更新:2014年9月1日

mikj

这个人很懒,什么都没留下

打赏 点赞
< 上一篇
下一篇 >

文章评论

您需要 登录 之后才可以评论
站内搜索
最新 热点 随机
最新 热点 随机
Ubuntu的远程桌面环境使用Docker与Xfce Azure100美金使用开源的Azure 管理面板 网站Cloudflare使用CDN后如何获取前端真实客户IP Win10 共享文件夹(设置账户密码与终止所有连接) 戴尔PowerEdge R430设置RAID0 安装WINDOWS10 实践Google Voice号码转移到Ultra Mobile Paygo套餐的实体sim卡 Giffgaff英国+44手机SIM卡免费领取 Server酱和Qmsg酱两个好用的推送服务 linux的ssh服务升级后无法启动修复 linux服务器的硬盘使用时间查询
Azure100美金使用开源的Azure 管理面板Ubuntu的远程桌面环境使用Docker与Xfce
Ubuntu的远程桌面环境使用Docker与Xfce 服务器不小心从架子上掉落,摔得头晕眼花! bash代码最新注入漏洞!重要补丁!!! linux查看系统信息的命令 半夜去偷菜被咬 刚刚收款到0.9USD. Kloxo/Lxadmin免费版安装教程,kloxo中文语言包教程,Putty软件使用等 CentOS虚拟机添加单个IP和批量添加多个IP地方法 centos6安装openvz Windows PowerShell批量创建Office 365 子账户(转)
标签聚合
debian Cloudflare 月捐 服务器 linux 域名 面板 代码 网盘 系统 插件 centos ubuntu DirectAdmin wordpress 安装 vps 免费 php 升级
分类
  • Linux
  • VPS服务器
  • windows
  • wordpress
  • 域名相关
  • 建站分享
  • 教程学习
  • 数据库类
  • 未分类
  • 资源分享
友情链接
  • 麦麦同学
  • QQTM论坛
  • 傻子-跸西的blog
  • 我喔喔喔
  • 夜狐
  • 2.int.ru
  • xiaofengsky.free.fr
  • 陈否否
  • 爱购啦
  • 死老鬼
  • 撸羊毛
  • 午夜客
  • 轨迹博客
  • 朱志瑞
  • QQPCC
  • 小沨记事本
  • 我的图库
  • LiCEO
  • 寥寥后花园
  • 豆博
  • 天下无鱼
  • 怪鸟博客
  • logdns.free.fr
  • 回到未来博客
  • 娃娃博客
  • semnew
  • 李子博客
  • vzone
AD

COPYRIGHT © 2022 Xinai.De. ALL RIGHTS RESERVED.@ 网站运行:@ 服务器运行状态

Theme Kratos Made By Seaton Jiang