💗心爱的💗-小沨

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

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

2014年9月1日 3192点热度 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

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

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

文章评论

您需要 登录 之后才可以评论
站内搜索
联系我
分类
  • AI智能
  • Android
  • Linux系统
  • VPS服务器
  • windows系统
  • wordpress
  • 域名相关
  • 建站分享
  • 教程学习
  • 数据库类
  • 旅行点滴
  • 未分类
  • 网络服务
  • 资源分享
  • 跨境出海
  • 金融投资
友情链接
  • LINUX DO
  • QQTM论坛
  • 轨迹博客
  • 豆博
  • 寥寥后花园
  • 怪鸟博客
  • 朱志瑞
  • QQPCC
  • semnew
  • Shucheng Li
  • 我的图库
  • 娃娃博客
  • 夜狐
  • 傻子-跸西的blog
  • 死老鬼
  • 爱购啦
  • 我喔喔喔
  • 李子博客
  • 麦麦同学
  • 撸羊毛
  • 光的魔术师
  • vzone
  • 小沨记事本
  • 天下无鱼
  • 陈否否

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

Theme Kratos Made By Seaton Jiang