ESXI6修改网页端口号

感谢,转载https://www.ruoyer.com/esxiport.html

一、终端开启SSH功能,方便修改出错维护

1.可进入登录界面,输入用户名和密码;

2.Troublesboot Options 按enter键进入下级页面;

3.在选择ssh选项是enter键切换启用或者禁用。(显示Disable为已开启,是关闭选项)

或者直接在网页后台打开SSH功能

二、VI编辑器修改网页端口号
 
 
  1. vi /etc/vmware/rhttpproxy/config.xml

找到以下原内容

 
 
  1. <!-- HTTP port to be used by the reverse proxy -->
  2. <httpPort>80</httpPort>
  3.  
  4. <!-- HTTPS port to be used by the reverse proxy -->
  5. <httpsPort>443</httpsPort>

 

修改后具体的端口号

 
 
  1. <!-- HTTP port to be used by the reverse proxy -->
  2. <httpPort>7780</httpPort>
  3.  
  4. <!-- HTTPS port to be used by the reverse proxy -->
  5. <httpsPort>7779</httpsPort>
三、增加防火墙配置

1.防火墙的配置文件在这里

/etc/vmware/firewall/service.xml

2.在用VI修改时如果提示无权限修改,请给予权限:

 
 
  1. chmod 644 /etc/vmware/firewall/service.xml
  2. chmod +t /etc/vmware/firewall/service.xml

3.将文字复制到最下面即可。

  
  
  1. <service id='0088'>
  2. <id>http7780</id>
  3. <rule id='0000'>
  4. <direction>inbound</direction>
  5. <protocol>tcp</protocol>
  6. <porttype>dst</porttype>
  7. <port>7780</port>
  8. </rule>
  9. <enabled>true</enabled>
  10. <required>false</required>
  11. </service>
  12. <service id='0089'>
  13. <id>hhtps7779</id>
  14. <rule id='0000'>
  15. <direction>inbound</direction>
  16. <protocol>tcp</protocol>
  17. <porttype>dst</porttype>
  18. <port>902</port>
  19. </rule>
  20. <rule id='0001'>
  21. <direction>inbound</direction>
  22. <protocol>tcp</protocol>
  23. <porttype>dst</porttype>
  24. <port>7779</port>
  25. </rule>
  26. <enabled>true</enabled>
  27. <required>true</required>
  28. </service>

4.将端口开放后,记得回来恢复文件的权限:

 
 
  1. chmod 444 /etc/vmware/firewall/service.xml
  2. chmod -t /etc/vmware/firewall/service.xml

 

四、添加引导文件

默认重启后,防火墙规则会恢复回原来,需要修改引导文件。

1.1将变动的文件打个 压缩包,生成的文件要放到 /bootbank目录下

 
 
  1. tar -cvzf service.tgz /etc/vmware/firewall/service.xml

1.2使用bootModuleConfig脚本向将该文件添加到启动配置文件里 /bootbank/boot.cfg

 
 
  1. BootModuleConfig.sh --add=service.tgz

1.3查看 boot.cfg,看看里面有没有---service.tgz。有即表示配置添加成功。

1.4重启以后,可以使用bootOption -m 查看新增加的配置是否生效

注意:这种方法比较方便,但有可能在下一次打系统补丁后消失,因为新的补丁的配置文件里并不包含你修改的部分。

五、重启系统即可。
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值