荣耀之链论坛

 找回密码
 立即注册
搜索
查看: 2311|回复: 0

ESXI修改端口

[复制链接]

1326

主题

2373

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
10267
发表于 2019-7-25 17:22 | 显示全部楼层 |阅读模式
https://www.cnblogs.com/hitaoge/p/11158225.html

ESXI 6.7修改网页端口号
一、终端开启SSH功能,方便修改出错维护

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

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

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

二、VI编辑器修改网页端口号

vi /etc/vmware/rhttpproxy/config.xml

原内容

<!-- HTTP port to be used by the reverse proxy -->
<httpPort>80</httpPort>

<!-- HTTPS port to be used by the reverse proxy -->
<httpsPort>443</httpsPort>



修改后

<!-- HTTP port to be used by the reverse proxy -->
<httpPort>8833</httpPort>

<!-- HTTPS port to be used by the reverse proxy -->
<httpsPort>4433</httpsPort>

三、增加防火墙配置

/etc/vmware/firewall/service.xml

防火墙的配置文件在这里
在用VI修改时如果提示无权限修改,请给予权限:
chmod 644 /etc/vmware/firewall/service.xml
chmod +t /etc/vmware/firewall/service.xml
将端口开放后,记得改为文件的权限:
chmod 444 /etc/vmware/firewall/service.xml
chmod -t /etc/vmware/firewall/service.xml

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

复制代码
<service id='0088'>                  
    <id>http8833</id>                  
    <rule id='0000'>                    
      <direction>inbound</direction>   
      <protocol>tcp</protocol>         
      <porttype>dst</porttype>         
      <port>8833</port>                 
    </rule>                             
    <enabled>true</enabled>            
    <required>false</required>         
  </service>                                                     
                                       
  <service id='0089'>                  
    <id>hhtps4433</id>              
    <rule id='0000'>                    
      <direction>inbound</direction>   
      <protocol>tcp</protocol>         
      <porttype>dst</porttype>         
      <port>902</port>                  
    </rule>                             
    <rule id='0001'>                    
      <direction>inbound</direction>   
      <protocol>tcp</protocol>         
      <porttype>dst</porttype>         
      <port>4433</port>                 
    </rule>                             
    <enabled>true</enabled>            
    <required>true</required>           
  </service>

<service id='0090'>                  
    <id>SSH2233</id>                  
    <rule id='0000'>                    
      <direction>inbound</direction>   
      <protocol>tcp</protocol>         
      <porttype>dst</porttype>         
      <port>2233</port>                 
    </rule>                             
    <enabled>true</enabled>            
    <required>false</required>         
  </service>
复制代码
四、添加引导文件

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

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

   tar -cvzf service.tgz /etc/vmware/firewall/service.xml
     1.2使用bootModuleConfig脚本向将该文件添加到启动配置文件里 /bootbank/boot.cfg

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

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

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

五、重启系统即可。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

荣耀之链

GMT+8, 2025-6-18 06:29 , Processed in 0.010647 second(s), 20 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表