在 Ubuntu 8.0.4下设置静态IP和虚拟机
2011-02-15 15:04
441 查看
1-手动修改网络配置文件:
sudo gedit /etc/network/interfaces
加入(或者修改)下列行:
auto lo eth0
iface lo inet loopback
iface eth0 inet static
address 192.168.1.6
netmask 255.255.255.0
gateway 192.168.1.1
auto eth0:0
iface eth0:0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
auto eth0:1
iface eth0:1 inet static
address 192.168.1.12
netmask 255.255.255.0
gateway 192.168.1.1
保存修改。
2.2-手动修改DNS配置文件:
sudo nano /etc/resolv.conf
加入(或者修改)下列行:
# Generated by NetworkManager
nameserver 192.168.1.1
nameserver 202.106.46.151
保存修改。
2.3- 手动重启网络服务:
sudo /etc/init.d/networking restart
返回结果如下:
*Reconfiguring network interfaces… [OK]
现在,你可以在终端里输入ifconfig命令来查看你修改的结果。如果不对,你还需要重启下。
设置apache的虚拟机
1 在workspace里添加doucument root
2 在/etc/apache2/sites-available 创建虚拟机配置文件 192.168.1.10, 内容如下:
3 重启apache 服务
sudo gedit /etc/network/interfaces
加入(或者修改)下列行:
auto lo eth0
iface lo inet loopback
iface eth0 inet static
address 192.168.1.6
netmask 255.255.255.0
gateway 192.168.1.1
auto eth0:0
iface eth0:0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
auto eth0:1
iface eth0:1 inet static
address 192.168.1.12
netmask 255.255.255.0
gateway 192.168.1.1
保存修改。
2.2-手动修改DNS配置文件:
sudo nano /etc/resolv.conf
加入(或者修改)下列行:
# Generated by NetworkManager
nameserver 192.168.1.1
nameserver 202.106.46.151
保存修改。
2.3- 手动重启网络服务:
sudo /etc/init.d/networking restart
返回结果如下:
*Reconfiguring network interfaces… [OK]
现在,你可以在终端里输入ifconfig命令来查看你修改的结果。如果不对,你还需要重启下。
设置apache的虚拟机
1 在workspace里添加doucument root
2 在/etc/apache2/sites-available 创建虚拟机配置文件 192.168.1.10, 内容如下:
<VirtualHost 192.168.1.10:80> ServerAdmin webmaster@localhost DocumentRoot /home/edwin/Zend/workspaces/DefaultWorkspace/ZfProjects-Main/Public Options FollowSymLinks AllowOverride None Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all ErrorLog /var/log/apache2/192.168.1.10.error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/192.168.1.10.access.log combined Alias /doc/ "/usr/share/doc/" Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 <VirtualHost *:80>
3 重启apache 服务
sudo a2ensite 192.168.1.10 sudo /etc/init.d/apache2 restart
相关文章推荐
- 虚拟机中ubuntu设置静态IP的方法
- Vmware 虚拟机安装ubuntu server 16.04 设置静态ip
- VMWARE中的UBUNTU虚拟机设置静态IP通过NAT上网的方法
- 虚拟机ubuntu14.04系统设置静态ip
- 虚拟机中ubuntu设置静态IP
- VMware Fusion 设置ubuntu16.04虚拟机静态ip和DNS
- 桥接模式下,虚拟机Ubuntu设置静态IP上网
- 虚拟机ubuntu14.04设置静态ip
- vmware中的ubuntu 虚拟机 静态IP设置
- 虚拟机中设置ubuntu为静态ip
- Ubuntu下静态IP的设置(VirtualBOX)
- Centos7在虚拟机中连接网络及静态IP设置
- Ubuntu10设置静态IP
- Ubuntu中设置固定ip和静态DNS
- ubuntu14.04设置静态ip
- 虚拟机设置静态ip
- ubuntu 永久设置静态ip和dns
- Windows Azure 设置虚拟机静态外网IP地址
- Ubuntu设置静态IP的方法