目的:用虚拟机中的Debian 8 操作系统作为web服务器

一、安装操作系统

首先要在vmware中安装一个debian操作系统,由于要让在局域网中的其他计算机能访问到此虚拟操作系统,因此在vmware中的网络连接方式设置为“桥接”模式。

二、设置IP地址

其次需要给debian设置静态IP地址。如下操作:

$ vi /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(). source /etc/network/interfaces.d/* # The loopback network interface
auto lo
iface lo inet loopback # The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp

把内容改成:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(). source /etc/network/interfaces.d/* # The loopback network interface
auto lo
iface lo inet loopback # The primary network interface
allow-hotplug eth0
# iface eth0 inet dhcp iface eth0 inet static
address 10.19.10.0
netmask 255.255.255.0

然后重启服务:

$ sudo /etc/init.d/networking restart

三、虚拟机上网

由于网络受限,只有网络管理员才能给指定IP地址的计算机开通上网权限,所以这里需要借助物理机来作为代理服务器,通过物理机来实现虚拟机上网。

物理机是win7,安装ccproxy软件,把debian的IP地址(就是上面设置的10.19.10.0)加入。

虚拟机中需要知道物理机的IP地址和代理端口号。在debian中编辑 /etc/apt/apt.conf 这个文件,若没有则新建。在文件中输入以下内容:

Acquire{
http::proxy "http://10.19.10.200:808"
}

物理机IP:10.19.10.200

物理机代理端口:808

这样虚拟机就可以进行apt-get了。

发布者:Love Leo,发布时间:2009年3月8日 上午3:50   [ 更新时间:2009年3月9日 上午1:20 ]

Debian全局代理
export http_proxy=”http://user:pass@youProxyAddress:port/
export https_proxy=”http://user:pass@youProxyAddress:port/

#可以将以上内容增添到/etc/profile中,可以在系统启动的时候就自动设置代理

Debian Apt-get代理

sudo nano /etc/apt/apt.conf

添加下列内容

Acquire {
  http::proxy “http://user:pass@yourProxyAddress:port”
  }

https://sites.google.com/site/debianpackageshare/Home/linux-tips/page-47

--End--

虚拟机-Debian服务器配置的更多相关文章

  1. vbox 虚拟机共享文件夹 debian

    主机64位windows7 虚拟机Debian 8 64位 注意:在网络更新时,可能需要修改 etc/apt/sources.list 文件,把前几条从CD更新删除掉,这样就会从网络更新 1.vbox ...

  2. Vitrualbox虚拟机网络设置

    来自http://www.douban.com/group/topic/15558388/ VirtualBox的提供了四种网络接入模式,它们分别是: 1.NAT 网络地址转换模式(NAT,Netwo ...

  3. VirtualBox虚拟机网络设置(四种方式)

    原文地址: https://www.douban.com/group/topic/15558388/ VirtualBox的提供了四种网络接入模式,它们分别是: 1.NAT 网络地址转换模式(NAT, ...

  4. virtualbox - 2台虚拟机之间通过ssh互访

    virtualbox 5.2.12 一台虚拟机是Debian 9,另一台是Ubuntu 18.04. 注意: 2台虚拟机系统里要安装ssh ! sudo apt install ssh 然后在virt ...

  5. 用DVD镜像离线安装Debian的软件包

    先介绍一下环境: 虚拟机:debian7.2.0 主机: Win7 方法一: 由于有时候无法联网就需要离线安装软件包,可以把debian官网上列出的几个DVD镜像都下下来,其实主要是DVD1,这样就不 ...

  6. VirtualBox的四种网络连接方式

    VirtualBox中有4中网络连接方式:a. NAT                          网络地址转换模式(Network Address Translation)b. Bridged ...

  7. VirtualBox--虚拟机网络设置1--(四种方式)

    转载自:https://www.douban.com/group/topic/15558388/ VirtualBox的提供了四种网络接入模式,它们分别是: 1.NAT 网络地址转换模式(NAT,Ne ...

  8. 转:Linux 编译安装 Mysql5.7

    http://broqiang.com/2017/04/18/Mysql-Install-5.7.18-Linux-Compile/ 原文 Linux 编译安装 Mysql5.7 Ubuntu 下快速 ...

  9. VMware设置桥接网络

     VMware设置桥接网络 2011-12-30 08:57:04 分类: LINUX 一.桥接网络的基本原理    配置成桥接网络连接模式的虚拟机就当作主机所在以太网的一部分, 虚拟系统和宿主机器的 ...

随机推荐

  1. webpack打包小图片时进行Base64转码

    关于base64 优点: base64就是一串字符串码表示的图片,在加载页面和js时一块加载出来,减少了加载图片时的http请求.加载一张图片时会发起一次http请求,http请求每次建立都会需要一定 ...

  2. 【代码笔记】iOS-NSJSONSerializationDemo

    一,代码. - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. ...

  3. ArrayList初步

    使用ArrayList,需添加引用:using System.Collections: 第一个例子: ArrayList list = new ArrayList(); list.Add(" ...

  4. NodeJS配置TaoBao源

    npm install -g cnpm --registry=https://registry.npm.taobao.org

  5. 网络基础 HTTP协议之http url简介

    HTTP协议之http url简介 by:授客 QQ:1033553122 http url简介 http url通过http协议,用于定位网络资源,是一种特殊类型的URI(统一资源定位) http_ ...

  6. 【转】使用windeployqt.exe进行依赖查找打包

    原文:https://blog.csdn.net/u011822862/article/details/52166940 Qt 官方开发环境使用的动态链接库方式,在发布生成的可执行程序时,需要复制可执 ...

  7. Leetcode题解之Valid Palindrome II

    1.题目描述 2.问题分析 使用两个下标,检测下标对应的字符是否相等,若不相等,则考察子串. 3.代码 bool validPalindrome(string s) { , j = s.size()- ...

  8. SendMessage,BroadcastMessage

    三者比较 用于向某个GameObject发送一条信息,让它完成特定功能.其实本质是调用绑定GameObject里面的Script里面的函数,可以跨语言的,例如Javascript可以调用C#的函数,我 ...

  9. /etc/resolv.conf服务器客户端DNS重要配置文件

    DNS客户端配置文件:etc/resolv.conf /etc/resolv.conf文件相当于windows如下图: 当然/etc/resolv.conf文件为辅助配置DNS文件,其实在网卡里也可以 ...

  10. 批处理之windows更改网卡IP地址

    新建文本文档,更改后缀为“.bat”,写入以下代码: netsh interface ip set address name="本地连接" source=static 192.16 ...