The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Redirect port to another directory

Discussion in 'General Discussion' started by danielvasc, Jun 25, 2014.

  1. danielvasc

    danielvasc Active Member

    Joined:
    Mar 5, 2014
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    My server has the ip 186.209.138.66. I need when someone access the address 186.209.138.66:4000 be directed to the page http: //brphonia.com.br/bloqueio. On my server, the index.html "bloqueio" is in "/dominios/brphonia/public_html /bloqueio/index.html".

    How to do this?
     
    #1 danielvasc, Jun 25, 2014
    Last edited: Jun 25, 2014
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,684
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    You would likely need to implement some custom iptables firewall rules along with some custom entries in the Apache configuration file. You will likely find several potential solutions by searching for a term such as "redirect Apache port iptables" in a search engine.

    Thank you.
     
  3. danielvasc

    danielvasc Active Member

    Joined:
    Mar 5, 2014
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    I added the following firewall rule:

    iptables -A INPUT -p tcp --dport 4000 -j ACCEPT

    Now I need to insert a rule in the apache configuration file (/usr/local/apache/conf/includes/post_virtualhost_global.conf).

    But what content do I enter?
     
Loading...

Share This Page