Ubuntu 12.04 创建源服务器
来源:互联网 发布:矩阵在密码学中的应用 编辑:程序博客网 时间:2024/05/02 02:15
需求:在本地搭载一个更新源作为服务器,这样在局域网内的其他虚拟机就可以通过在服务器端下载软件包,可以节省很多时间
首先要确保要作为服务器的主机能连上网络,下面是具体的配置步骤
1、使用apt-mirror创建Ubuntu Source服务器的本地镜像服务器
sudo apt-get install apt-mirror
2、sudo apt-get install apache2
需要以上两个软件来构建我们的Ubuntu12.04的服务器
3、修改/etc/apt/mirror.list的配置文件为以下情况:
############# config ##################
#
# set base_path /var/spool/apt-mirror
#
# set mirror_path $base_path/mirror
# set skel_path $base_path/skel
# set var_path $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch <running host architecture>
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set
nthreads 20
set
_tilde 0
#
############# end config ##############
deb http:
//debian
.ustc.edu.cn
/ubuntu/
precise main multiverse restricted universe
deb http:
//debian
.ustc.edu.cn
/ubuntu/
precise-backports main multiverse restricted universe
deb http:
//debian
.ustc.edu.cn
/ubuntu/
precise-proposed main multiverse restricted universe
deb http:
//debian
.ustc.edu.cn
/ubuntu/
precise-security main multiverse restricted universe
deb http:
//debian
.ustc.edu.cn
/ubuntu/
precise-updates main multiverse restricted universe
deb-src http:
//debian
.ustc.edu.cn
/ubuntu/
precise main multiverse restricted universe
deb-src http:
//debian
.ustc.edu.cn
/ubuntu/
precise-backports main multiverse restricted universe
deb-src http:
//debian
.ustc.edu.cn
/ubuntu/
precise-proposed main multiverse restricted universe
deb-src http:
//debian
.ustc.edu.cn
/ubuntu/
precise-security main multiverse restricted universe
deb-src http:
//debian
.ustc.edu.cn
/ubuntu/
precise-updates main multiverse restricted universe
deb-i386 http:
//debian
.ustc.edu.cn
/ubuntu/
precise main multiverse restricted universe
deb-i386 http:
//debian
.ustc.edu.cn
/ubuntu/
precise-backports main multiverse restricted universe
deb-i386 http:
//debian
.ustc.edu.cn
/ubuntu/
precise-proposed main multiverse restricted universe
deb-i386 http:
//debian
.ustc.edu.cn
/ubuntu/
precise-security main multiverse restricted universe
deb-i386 http:
//debian
.ustc.edu.cn
/ubuntu/
precise-updates main multiverse restricted universe
备注:debian
.ustc.edu.cn为我们使用的中国科技大学的Ubuntu Source服务器作为的我们的源服务器。
deb-i386 http://* 表示下载32位版本的deb软件。
因为之前也修改了/etc/apt/source.list,但是两个配置文件都修改了之后,后续的步骤不能下载成功,所以把source.list又还原成了系统自带的,结果成功了
4、执行 sudo apt-mirror
这会启动20个线程到设置中的地址去下载响应的deb包,这个会运行很长时间,因为要下载的东西很多
执行完成后,/var/spool/apt-mirror目录下就有了所有需要的deb包和相应的配置
我们需要一个web服务器来启动我们本地的ubuntu source服务器,这里选择的是apache2。apache2服务器安装后,默认使用/var/www/目录作为
web的根目录。
5、
cd
/var/www/
ln
/var/spool/apt-mirror/mirror/debian
.ustc.edu.cn
/ubuntu/
-s
在/var/www目录下创建一个Ubuntu超链接,链接到/var/spool/apt-mirror/mirror/debian.ustc.edu.cn/ubuntu/上
6、sudo /etc/init.d/apache2 start/restart/stop/status 命令可以管理apache2服务器。
deb http:
//222
.24.24.175
/ubuntu/
precise main multiverse restricted universe
deb http:
//222
.24.24.175
/ubuntu/
precise-backports main multiverse restricted universe
deb http:
//222
.24.24.175
/ubuntu/
precise-proposed main multiverse restricted universe
deb http:
//222
.24.24.175
/ubuntu/
precise-security main multiverse restricted universe
deb http:
//222
.24.24.175
/ubuntu/
precise-updates main multiverse restricted universe
deb-src http:
//222
.24.24.175
/ubuntu/
precise main multiverse restricted universe
deb-src http:
//222
.24.24.175
/ubuntu/
precise-backports main multiverse restricted universe
deb-src http:
//222
.24.24.175
/ubuntu/
precise-proposed main multiverse restricted universe
deb-src http:
//222
.24.24.175
/ubuntu/
precise-security main multiverse restricted universe
deb-src http:
//222
.24.24.175
/ubuntu/
precise-updates main multiverse restricted universe
debhttp://192.168.1.199/ubuntu/ precise main multiverse restricted universe
debhttp://192.168.1.199/ubuntu/ precise-backports main multiverse restricteduniverse
debhttp://192.168.1.199/ubuntu/ precise-proposed main multiverse restricteduniverse
debhttp://192.168.1.199/ubuntu/ precise-security main multiverse restricteduniverse
debhttp://192.168.1.199/ubuntu/ precise-updates main multiverse restricteduniverse
deb-srchttp://192.168.1.199/ubuntu/ precise main multiverse restricted universe
deb-srchttp://192.168.1.199/ubuntu/ precise-backports main multiverse restricteduniverse
deb-srchttp://192.168.1.199/ubuntu/ precise-proposed main multiverse restricteduniverse
deb-srchttp://192.168.1.199/ubuntu/ precise-security main multiverse restricteduniverse
deb-srchttp://192.168.1.199/ubuntu/ precise-updates main multiverse restricteduniverse
其中,192.168.1.199为服务器计算机的ip地址。- Ubuntu 12.04 创建源服务器
- ubuntu 12.04 LTS 中创建FTP服务器
- ubuntu tftp 服务器创建
- ubuntu创建FTP服务器。
- Ubuntu NFS服务器创建步骤
- ubuntu 12.04创建本地源
- 阿里云服务器ubuntu创建SVN版本控制服务器
- ubuntu服务器源配置
- 创建本地ubuntu 12.04 64位和32位版本的source镜像服务器.
- ubuntu 12.04进程创建
- Ubuntu 12.04创建快捷方式
- ubuntu本地源创建
- 创建和使用本地ubuntu source镜像服务器
- ubuntu创建samba服务器,实现不同系统之间的互访
- 创建和使用本地ubuntu source镜像服务器
- ubuntu下安装svn服务器并创建分支
- ubuntu 16.04 环境为 docker 创建 网络 代理 服务器 proxy
- ubuntu 作为服务器,创建新用户,并设置为管理员权限。
- 黑马程序员_Java高新技术之反射 Constructor类
- android 启动过程分析
- log4j最佳配置备份
- LINUX内核经典面试题
- 获取咕咚运动移动应用中的数据——非官方API
- Ubuntu 12.04 创建源服务器
- django 正则表达式
- C++中const理解
- JAVA设计模式学习5——工厂方法模式
- Android的开发者文档
- Block学习和理解
- Shell字符串比较、判断是否为数字
- 浅谈JAVA的IO流
- 用CArchive对CFile文件进行写和读