KLOXO无法添加dns模板,无法添加域名,没有IP地址,但能ssh,能上kloxo后台,默认IP没有 显示出来,添加DNS模板时提示没有 IP地址。怎么回事? 这种情况,很可能你的vps是通过DHCP自动获取IP的,所以在安装Kloxo完成设置Kloxo的时候会出现no_ip_address的错误提示,这个时候就需要手动设置上IP,这样才能添加域名和添加dns模板。
初步诊断:
ifconfig -a 能显示IP, 难道是dhcp自动分配的ip?
复查原因:
[[email protected] network-scripts]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
# Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+
DEVICE=eth0
BOOTPROTO=dhcp
DHCPCLASS=
HWADDR=00:16:3E:EF:AD:21
ONBOOT=yes
发现果然说DHCP自动获取IP地址的。唉。。。
解决方案:
如果你设置Kloxo的时候出现no_ip_address的提示你可以按照下面步骤修改:
使用编辑器编辑(如果不会用vi编辑器,可以使用winscp):/etc/sysconfig/network-scripts/ifcfg-eth0
# Configuration for eth0
DEVICE=eth0
BOOTPROTO=none
# This line ensures that the interface will be brought up during boot.
ONBOOT=yes
# eth0 - This is the main IP address.
# The address, netmask and gateway are all necessary.
IPADDR=72.11.150.159 #你的IP地址
NETMASK=255.255.255.0 #子网掩码
GATEWAY=72.11.150.1 #网关
ifconfig -a 可以看到IP和netmask, netstat -rn 可以看到网关gateway
一般这样设置好,再执行命令:service network restart 重启网络就好了,如果还是不通,重启试一下。
这时候你就可以参考这个教程来刷新或添加更多ip了: http://www.ctohome.com/FuWuQi/00/392.html
添加第2个IP,可以创建 /etc/sysconfig/network-scripts/ifcfg-eth0:0
# Configuration for eth0:0
DEVICE=eth0:0
BOOTPROTO=none
# This line ensures that the interface will be brought up during boot.
ONBOOT=yes
# eth0:0
IPADDR=34.56.78.90
NETMASK=255.255.255.0
GATEWAY=12.34.56.1
添加第3个IP,创建 /etc/sysconfig/network-scripts/ifcfg-eth0:1 按上面的内容添加到这个文件中,以此类推。
以上办法都是在CentOS或者Fedora下添加IP的方法,如果是在Debian/Ubuntu下添加IP的方法(注,当然Kloxo没有Debian下的版本):
修改 /etc/network/interfaces
# The loopback interface
auto lo
iface lo inet loopback
# Configuration for eth0 and aliases
# This line ensures that the interface will be brought up during boot.
auto eth0 eth0:0 eth0:1
# eth0 - This is the main IP address that will be used for most outbound connections.
# The address, netmask and gateway are all necessary.
iface eth0 inet static
address 12.34.56.78
netmask 255.255.255.0
gateway 12.34.56.1
# eth0:0
iface eth0:0 inet static
address 34.56.78.90
netmask 255.255.255.0
# eth0:1 - Private IPs have no gateway (they are not publicly routable) so all you need to
# specify is the address and netmask.
iface eth0:1 inet static
address 192.168.133.234
netmask 255.255.128.0
保存,重启网络,/etc/init.d/networking restart 即可。