阿里云和腾讯云默认都是LAN网络,不显示公网IP。
但安装Directadmin需要外网授权IP,所以必须增加一个虚拟网卡才能够进行安装。

比如设置阿里云内网为IP是172.18.13.88, 外网分配IP是120.24.100.100,环境为CentOS6.8

首先设置一张虚拟网卡:

/sbin/ifconfig eth0:0 120.24.100.100 netmask 255.255.255.0 up
echo "/sbin/ifconfig eth0:0 120.24.100.100 netmask 255.255.255.0 up" >> /etc/rc.local

设置NAT转发:

iptables -t nat -A POSTROUTING -s 120.24.100.100 -j SNAT --to-source=172.18.13.88

这是测试一下是否能够正确curl

curl --interface eth0:0 -v https://www.directadmin.com

 

如果能够无错误提示,这是就我们就保存一下iptables

service iptables save

建议reboot服务器,再进行安装DA。

 

安装完以后,

进入IP管理,把内网IP链接到公网IP上。

再打开/usr/local/directadmin/conf/directadmin.conf 增加一行

lan_ip=172.18.13.88

 

保存后重启DA,就可以正常访问了。

另外可参考官方教程 https://www.directadmin.com/lan.php

首页

No Comments Now!

Be the first to comment on this entry.

留下评论

姓名(必填)
Mail (必填),(will not be published)
站点(recommended)

Fields in bold are required. Email addresses are never published or distributed.

Some HTML code is allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
URLs must be fully qualified (eg: http://www.directadmin.cc/blog),and all tags must be properly closed.

Line breaks and paragraphs are automatically converted.

Please keep comments relevant. Off-topic, offensive or inappropriate comments may be edited or removed.