Set up port forwarding

Discussion in 'Installation/Configuration' started by lbru, Dec 17, 2011.

  1. lbru

    lbru New Member HowtoForge Supporter

    I have successfully set up a Perfect Server using the How To Forge procedure found here: http://www.howtoforge.com/perfect-server-ubuntu-10.04-lucid-lynx-ispconfig-3. I have also successfully installed Joomla that I plan to use as my CMS.

    I can easily get to the Joomla home page from inside the network, but cannot reach it from outside. In running down the problem I've discovered that my ISP is blocking Port 80 'for my protection'.

    I've tried several approaches like changing the listen command in the apache ports.conf file but so far nothing I've done allows access from outside my network. I've verified that other ports, such as 8380, are not blocked by the ISP.

    Is there a set up procedure within ISPConfig that will allow me to direct people to my web pages via another port such as 8380?

    Thanks for the help.

    LBRU
     
  2. techweblock.com

    techweblock.com New Member

    Try This

    Hello,

    If it is an issue with port 80 you just need to change it, as you have stated.

    I am very new to ISPConfig but I assume it only needs port 8080 and therefore any other port changes will not be an issue.

    Apache is what hosts the website so that is what will need to be changed.

    I have given this a quick go and it seems to work both internally and externally, however try it at your own risk - I am new to all this.

    Go onto the server or remotley connect:

    Code:
    sudo su
    get root if you can or just sudo each command below

    Code:
    cp /etc/apache2/ports.conf /etc/apache2/ports.conf_backupgedit
    This will back up the file incase it dosent work.

    Code:
    cd /etc/apache2/
    pico ports.conf
    This will go to the directory then pico will allow you to edit that file. You want to find Listen 80 and change that to your new port number. DO NOT CHANGE the "NameVirtualHost *:80" above as you get errors. Now press ctrl + x and press y to save changes to the file and exit (if you are using pico for text editing).

    Lastly run

    Code:
    /etc/init.d/apache2 restart
    
    This resets the webserver with the new port. I have an error appear here

    Code:
     [Sun Dec 18 05:40:33 2011] [warn] NameVirtualHost REMOVED:443 has no VirtualHosts
     ... waiting [Sun Dec 18 05:40:34 2011] [warn] NameVirtualHost REMOVED:443 has no VirtualHosts
    
    This is my openSSL and is the same with port 80 being used so dosent affect me.

    You lastly need to open the port on your router and then in the internal ip login to ISPConfig and then systems>firewall>basic and then add firewall exception or edit the exzisting one for your server where it asks for tcp ports to allow add your new port with a comma and then save.

    This should then foward your site. Your ISP may still block it. If you have any problems just recover the backed up file from the begining.
    Code:
    cd /etc/apache2/
    rm ports.conf
    cp ports.conf_backupgedit ports.conf 
    /etc/init.d/apache2 restart
    This goes to the apache directory, removes the edited ports file, copies the backed up ports file and renames it to the correct name and then restarts apache to the state before the changes were made.

    Enjoy, Connor
     
  3. SwOsHiE

    SwOsHiE New Member

    Or you could just make a redirect to port 80 from a external port that works.

    this way you do not have to change anything in apache configuration and just accept port 8380 (or the port of your choice).
     
  4. lbru

    lbru New Member HowtoForge Supporter

    Connor,

    Thank you for the suggestion. I followed the instructions and am getting closer. However, I'm not quite there yet. I think the problem I have is that I'm not quite clear with the following set of instructions:

    You lastly need to open the port on your router and then in the internal ip login to ISPConfig and then systems>firewall>basic and then add firewall exception or edit the exzisting one for your server where it asks for tcp ports to allow add your new port with a comma and then save.

    I'll describe where I think I'm having the problem by separating the above quote into steps:

    1. You lastly need to open the port on your router
    2. and then in the internal ip login to ISPConfig
    3. Then systems>firewall>basic and then add firewall exception or edit the exzisting one for your server where it asks for tcp ports to allow add your new port with a comma and then save

    I'm OK with steps 1 and 3. It's step 2 I'm not clear on- where is this change made? Thanks.

    LBRU
     
  5. lbru

    lbru New Member HowtoForge Supporter

    SwOsHiE- Thanks for the recommendation. I am now able to get to my web pages from the outside. I appreciate the help. LBRU
     
  6. techweblock.com

    techweblock.com New Member

    I wasnt to sure if it would work, good to see SwOsHiE's one works.
     
  7. lbru

    lbru New Member HowtoForge Supporter

    Connor- thanks again for the help. I'm new to this also and I appreciate the support. All the best!
     

Share This Page