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 查看新增加的配置是否生效

 注意:這種方法比較方便,但有可能在下一次打系統補丁后消失,因為新的補丁的配置文件里並不包含你修改的部分。

五、重啟系統即可。

 

 

 

 

修改ssh端口號的方法還要找一找,先把防火牆放通了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM