技術(shù)員聯(lián)盟提供win764位系統(tǒng)下載,win10,win7,xp,裝機(jī)純凈版,64位旗艦版,綠色軟件,免費(fèi)軟件下載基地!

當(dāng)前位置:主頁 > 教程 > 服務(wù)器類 >

怎么更改OHS端口為80

來源:技術(shù)員聯(lián)盟┆發(fā)布時(shí)間:2018-11-22 06:01┆點(diǎn)擊:

  一般在實(shí)施項(xiàng)目時(shí),客戶都希望域名和地址簡(jiǎn)單明了。但是OHS為了安全起見是不允許使用端口號(hào)小于1024,小于1024端口號(hào)是屬于root,常見的OHS都是有自己的安裝用戶(Oracle)。因此如果想要使用小于1024的端口,需要修改.apachectl的控制權(quán)。

  步驟:

  1.關(guān)閉OHS

  2.重新設(shè)置監(jiān)聽端口

  3.改變 . apachectl的權(quán)限

  4.重啟OHS

  關(guān)閉OHS

  代碼如下

  # assuming your MW_HOME is /u00/app/oracle/product/fmw-11.1.1

  export MW_HOME=http://www.3lian.com/u00/app/oracle/product/fmw-11.1.1

  cd $MW_HOME/Oracle_WT1/instances/instance1/bin

  ./opmnctl stopall

  重新設(shè)置監(jiān)聽端口,在這里我們?cè)O(shè)置為80

  代碼如下

  # assuming you are still connected as oracle user to your sevrer

  cd $MW_HOME/Oracle_WT1/instances/instance1/config/OHS/ohs1

  cp httpd.conf httpd.conf.save

  vi httpd.conf

  # Now go to the line with Listen (normally 777x)

  # and replace the port number to port 80

  Listen 80

  # save the changes

  修改權(quán)限

  代碼如下

  # assuming you are connected to the server as root user

  # use the MW_HOME from step 1

  cd $MW_HOME/Oracle_WT1/ohs/bin

  # be aware, we have to modify the hidden file .apachectl (the dot is correct)

  ls -la .apachectl

  -rwxr-x--- 1 oracle oinstall 13278 Dec 17 03:54 .apachectl

  chown root .apachectl

  chmod 6750 .apachectl

  ls -la .apachectl

  -rwsr-s--- 1 root oinstall 13278 Dec 17 03:54 .apachectl

  注意:在Linux以”.”開頭的文件默認(rèn)為隱藏。

  最后重啟OHS

  代碼如下

  cd $MW_HOME/Oracle_WT1/instances/instance1/bin

  ./opmnctl startall

  # Then check the status with the option -l

  # to see if your Oracle HTTP Server is up and

  # the option -l display the used ports (see picture below)

  ./opmnctl status –l