文档出自:广通学院
安装Ubuntu服务器版
http://www.ubuntu.com/download/server
配置ip
======NAT网络模式=======我们选用虚拟主机的
NAT网络模式1.网络邻居
VMnet8就是对应虚拟主机NAT网络模式的
![安装虚拟机,安装Ubuntu服务器版,配置ip,配置ssh - worm128 - Winlone技术博客](http://img0.ph.126.net/S9seAYxjq8eyuPwoNwqQyg==/1260444945810516852.jpg)
我们配置NAT的ip为192.168.59.1
![安装虚拟机,安装Ubuntu服务器版,配置ip,配置ssh - worm128 - Winlone技术博客](http://img1.ph.126.net/hdQHScufDFioL2Wg0NIRVw==/6608492592957126487.jpg)
然后我们编辑ip配置的文件:sudo vi /etc/network/interfaces,如图 ip地址和网关一定要对应会电脑里面的59网段
![安装虚拟机,安装Ubuntu服务器版,配置ip,配置ssh - worm128 - Winlone技术博客](http://img0.ph.126.net/AGZXIkaeOYtrgYSLcVMv_g==/6608232008702318328.jpg)
然后,ping baidu.cn ,我们在虚拟主机就能ping通外网
最后还需要window主机能连接虚拟主机内部
打开虚拟网络编辑器:
![安装虚拟机,安装Ubuntu服务器版,配置ip,配置ssh - worm128 - Winlone技术博客](http://img0.ph.126.net/x9_rx8yv57Rng_d9SoTONw==/2992641952487919687.jpg)
对应VMnet8的网络连接
![安装虚拟机,安装Ubuntu服务器版,配置ip,配置ssh - worm128 - Winlone技术博客](http://img2.ph.126.net/yFBau3AI9YfmTGC4USnBQA==/6608669614329198515.jpg)
我们配置虚拟主机和window主机的端口映射
![安装虚拟机,安装Ubuntu服务器版,配置ip,配置ssh - worm128 - Winlone技术博客](http://img1.ph.126.net/zlmlgE83cqTUG9KdX7jtXg==/1414693233048788248.jpg)
======桥接模式======= 配置好虚拟网络:
![](http://pic002.cnblogs.com/images/2011/355296/2011121019233213.jpg)
选择你的本地连接
![](http://pic002.cnblogs.com/images/2011/355296/2011121019243635.jpg)
对应那个CentOS的虚拟机选择桥接方式的网络链接
![安装虚拟机,安装Ubuntu服务器版,配置ip,配置ssh - worm128 - Winlone技术博客](http://img0.ph.126.net/QmOojs7DJVRCnlXafyrb9A==/6608910407375951730.jpg)
在虚拟主机配置ip,网段要和你的宿主主机(192.168.0.101)一样,都是0网段
![安装虚拟机,安装Ubuntu服务器版,配置ip,配置ssh - worm128 - Winlone技术博客](http://img2.ph.126.net/oQuncaBrcBK3yCxXVd34tQ==/1423418957326596698.jpg)
注意:桥接配置完毕后,最好重启一下路由器,很奇怪,重启后,内网才能访问安装sshsudo apt-get -f install
//不寻找依赖直接安装apt-getsudo apt-get -f install openssh-server
//不寻找依赖直接安装ssh安装sambasudo apt-get -f install samba
//不寻找依赖直接安装sambaSamba的配置看一下地址(已验证可以)
http://www.iteye.com/topic/1127790
安装mysqlsudo apt-get install mysql-server mysql-client #中途会让你输入一次root用户密码
sudo start mysql #手动的话这样启动
sudo stop mysql #手动停止
pgrep mysqld #如果进程开启,这个命令将会返回该进程的 id。
mysql -u root -p #进入MySQL
//设置mysql账号密码, grant all:允许所有权限,账号:winlone,%:表示所有ip可以访问,123456:密码
grant all on *.* to 'winlone'@'%' identified by "123456";
必备软件安装安装geditsudo apt-get install gedit
首先需要安装software-properties-commonsudo apt-get install software-properties-common
然后安装python-software-propertiessudo apt-get install python-software-properties
修改更新源sudo gedit /etc/apt/sources.list
升级apt-get软件sudo apt-get update --更新apt管理软件
sudo apt-get upgrade ---更新系统配置
如果在更新apt报错如下,则是ppa源的问题,删掉/etc/apt/sources.list.d/文件夹W: Failed to fetch 404 Not Found
W: Failed to fetch 404 Not Found
安装JDK1.6sudo add-apt-repository ppa:ferramroberto/java --更新java安装列表
sudo apt-get install sun-java6-jdk --安装jdk6
安装nginxsudo add-apt-repository ppa:nginx/stable --更新nginx安装列表
sudo apt-get install nginx --安装nginx
安装make命令sudo apt-get install make gcc
安装dpkg命令sudo apt-get install dpkg
安装linux管理启动服务命令sudo apt-get install chkconfig
安装文本编辑器vim命令(vim比vi好用)sudo apt-get install vim