Koozali.org: home of the SME Server

2 Question, Upgrade Apache to v2 and change listening port

Offline girkers

  • *
  • 296
  • +0/-0
    • gk computer services
2 Question, Upgrade Apache to v2 and change listening port
« on: June 27, 2004, 10:05:49 AM »
I am interested how to upgrade to Apache 2 with versin 6.01 of SME.

And/Or

My ISP is blocking port 80 so I want to change it to something else.  I have looked at the how to by Dan Brown but this doesn't work for this version.  Any help would be appreciated.

Thanks. :-D

Offline NickR

  • *
  • 283
  • +0/-0
    • http://www.witzendcs.co.uk/
2 Question, Upgrade Apache to v2 and change listening port
« Reply #1 on: June 27, 2004, 11:32:36 AM »
To change the default port, you need a custom template:
(This is untested, but it should work)

mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf

cp /etc/e-smith/templates/etc/httpd/conf/httpd.conf/35Listen80 \
/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/.

mcedit /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/30Listen80

Change the port in the first & last line of the fragment to the one you want (eg. 85).

/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf

service httpd restart

You'll also need to open that port to allow external connections - do a search for the port opening contrib on here.
--
Nick......

schirrms

2 Question, Upgrade Apache to v2 and change listening port
« Reply #2 on: June 30, 2004, 10:22:42 PM »
Hi,

Maybe another (untested by me on 6.0, worked fine on 5.5) way :

Just let your web server on the 80 port, and do a iptables redirection : for instance, tell that all incoming connections to 8080 are to send back to 80.

HTH,

Offline girkers

  • *
  • 296
  • +0/-0
    • gk computer services
2 Question, Upgrade Apache to v2 and change listening port
« Reply #3 on: July 04, 2004, 04:14:31 AM »
Thanks schirrms for your thoughts and it would make things really easy, but the problem is that my ISP doesn't let port 80 through, but thanks for the thought.

NickR thanks, I will give that a go, I know how to do the port forwarding on my router, so once I do the change to SME server I will let you guys know how it goes.

SSBN

2 Question, Upgrade Apache to v2 and change listening port
« Reply #4 on: July 04, 2004, 04:45:32 AM »
Go to www.no-ip.com when you have your web server on another port. They will allow you to host DNS to web page on a nonstandard port and let the rest of the world se it. It is free as well.

Offline girkers

  • *
  • 296
  • +0/-0
    • gk computer services
2 Question, Upgrade Apache to v2 and change listening port
« Reply #5 on: July 04, 2004, 10:29:03 AM »
Thanks SSBN, I am already using DYNDNS.org so thanks for the thought.

schirrms

2 Question, Upgrade Apache to v2 and change listening port
« Reply #6 on: July 05, 2004, 09:33:43 PM »
Quote from: "girkers"
Thanks schirrms for your thoughts and it would make things really easy, but the problem is that my ISP doesn't let port 80 through, but thanks for the thought.

NickR thanks, I will give that a go, I know how to do the port forwarding on my router, so once I do the change to SME server I will let you guys know how it goes.

OK, that a common problem with my great English :-)
Let's try to explain better :
On your SME box, just let the web server running at port 80.
From your inside network, you can access your web server on port 80
With IPTABLES (I don't know if port forwarding will let you do that), create a rule telling that every incoming connections on port 8080 (for instance) are redirected on port 80.
So, people trying to access your web server have to connect to
http://{your server}.dyndns.org:8080/
On your server, IPTABLES connect each incoming session on the 8080 port to your web server (still running on port 80).

That was the idea.
(But i think that the solution via dyndns.org is smarter, maybe).

Regards,

Offline girkers

  • *
  • 296
  • +0/-0
    • gk computer services
thanks so far, but still no joy
« Reply #7 on: July 06, 2004, 03:40:11 PM »
I have a Netgear WGT624 and unfortunately this does not allow port mapping.

I have copied 35Listen80 to the correct directory and editted it as directed and restarted httpd, but I still can not connect.

Any other thoughts?

Thanks in advanced

Anonymous

2 Question, Upgrade Apache to v2 and change listening port
« Reply #8 on: July 08, 2004, 03:16:34 AM »
I worked it out, it is much simpler than I thought.

There is a file called 05Port with one line in it:

Port 80

I have simpled changed this to the port I wanted and internally I can now access my webserver through this port.

Internally I access the server through 192.168.0.10:8043

But when I try to access the server externally I get an "Invalid Syntax Error" and page can not be displayed, so one problem is solved, but another has been created.

Is there anyway I can track where the connection is being stopped.

For reference the links is:
http://www.girkers.kicks-ass.net:8043

Offline girkers

  • *
  • 296
  • +0/-0
    • gk computer services
2 Question, Upgrade Apache to v2 and change listening port
« Reply #9 on: July 08, 2004, 03:19:33 AM »
Quote from: "Anonymous"
I worked it out, it is much simpler than I thought.

There is a file called 05Port with one line in it:

Port 80

I have simpled changed this to the port I wanted and internally I can now access my webserver through this port.

Internally I access the server through 192.168.0.10:8043

But when I try to access the server externally I get an "Invalid Syntax Error" and page can not be displayed, so one problem is solved, but another has been created.

Is there anyway I can track where the connection is being stopped.

For reference the links is:
http://www.girkers.kicks-ass.net:8043


This was actually posted by me, sorry.

Offline girkers

  • *
  • 296
  • +0/-0
    • gk computer services
Thanks for your help and I have now fixed it
« Reply #10 on: July 08, 2004, 04:07:53 AM »
The problem with having a modem/router and a Wireless Router.  Stupid me was not forwarding the packets from my modem.

waterboy

2 Question, Upgrade Apache to v2 and change listening port
« Reply #11 on: October 20, 2004, 04:17:55 PM »
Quote from: "schirrms"
Quote from: "girkers"
Thanks schirrms for your thoughts and it would make things really easy, but the problem is that my ISP doesn't let port 80 through, but thanks for the thought.

NickR thanks, I will give that a go, I know how to do the port forwarding on my router, so once I do the change to SME server I will let you guys know how it goes.

OK, that a common problem with my great English :-)
Let's try to explain better :
On your SME box, just let the web server running at port 80.
From your inside network, you can access your web server on port 80
With IPTABLES (I don't know if port forwarding will let you do that), create a rule telling that every incoming connections on port 8080 (for instance) are redirected on port 80.
So, people trying to access your web server have to connect to
http://{your server}.dyndns.org:8080/
On your server, IPTABLES connect each incoming session on the 8080 port to your web server (still running on port 80).

That was the idea.
(But i think that the solution via dyndns.org is smarter, maybe).

Regards,


Can any iptables guru out there let me know how to do exactly what has been described here?  My SME box is my Internet/PPPoE gateway so I would like to have all requests coming in on port 8080 get redirected to port 80.  I'm not quite sure what IP to redirect the requests to since there is no other server, my SME server is the only one on my network.  If I can get this to work in conjunction with the dyndns.org redirect service I will have outsmarted my ISP who blocks inbound port 80.

Thanks!

waterboy

2 Question, Upgrade Apache to v2 and change listening port
« Reply #12 on: October 20, 2004, 05:19:22 PM »
I figured it out.  For those interested, this rule got it for me:

iptables -t nat -A PREROUTING -p tcp --dport 8080 -j REDIRECT --to-port 80

splunk

2 Question, Upgrade Apache to v2 and change listening port
« Reply #13 on: April 11, 2005, 06:30:46 PM »
That works for me, the iptables thing.  Been using it since I got my fios.  Is there anyway to have the server automatically configure like that.  Anytime I reboot I have to ssh in and re-enter it.

splunk

2 Question, Upgrade Apache to v2 and change listening port
« Reply #14 on: June 25, 2005, 04:58:29 AM »
I've been using the iptables thing too to get around a blocked port.  

Now, my question is, is there a way to have the server run...

iptables -t nat -A PREROUTING -p tcp --dport 8080 -j REDIRECT --to-port 80

...automatically everytime it boots up so that I don't have to do it myself?  It'd be really convienient, especially when the power goes out longer than the UPS can back up, so that when my server restarts itself, it'd be back to normal.

Thanks.

Offline gordonr

  • *
  • 646
  • +0/-0
    • http://www.smeserver.com.au/
Re: 2 Question, Upgrade Apache to v2 and change listening po
« Reply #15 on: June 26, 2005, 02:45:00 PM »
Quote from: "girkers"


My ISP is blocking port 80 so I want to change it to something else.  I have looked at the how to by Dan Brown but this doesn't work for this version.  Any help would be appreciated.

Thanks. :-D


Leave the web server listening on port 80. On the port-forwarding panel, forward port 8080 (or whatever) to  port 80. In 6.0, the destination IP must be your ExternalIP. For 7.0, you can enter any of "localhost", ExternalIP, InternalIP, or 127.0.0.1 for such redirects.

Gordon
............

splunk

Re: 2 Question, Upgrade Apache to v2 and change listening po
« Reply #16 on: June 29, 2005, 05:59:34 PM »
Quote from: "gordonr"

Leave the web server listening on port 80. On the port-forwarding panel, forward port 8080 (or whatever) to  port 80. In 6.0, the destination IP must be your ExternalIP. For 7.0, you can enter any of "localhost", ExternalIP, InternalIP, or 127.0.0.1 for such redirects.

Gordon



Since I'm on 6.0 and have a dynamic IP, I can't use this method.  I'm hoping someone can pop in with a way to automatically run the iptables thing on startup.

Offline gordonr

  • *
  • 646
  • +0/-0
    • http://www.smeserver.com.au/
Re: 2 Question, Upgrade Apache to v2 and change listening po
« Reply #17 on: June 29, 2005, 10:59:36 PM »
Quote from: "splunk"

Since I'm on 6.0 and have a dynamic IP, I can't use this method.  I'm hoping someone can pop in with a way to automatically run the iptables thing on startup.


I haven't tested, but it's quite likely that the 7.0 e-smith-portforwarding version will work on 6.0. However, it plays with firewall rules, so they need to be checked carefully.
............

splunk

2 Question, Upgrade Apache to v2 and change listening port
« Reply #18 on: July 31, 2005, 04:50:37 AM »
I tried installing some of the rpms for the portforwarding, but they stated I must have an esmith library newer than what I did.  Any other clues?

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
2 Question, Upgrade Apache to v2 and change listening port
« Reply #19 on: July 31, 2005, 06:53:14 PM »
Quote from: "girkers"
Thanks schirrms for your thoughts and it would make things really easy, but the problem is that my ISP doesn't let port 80 through, but thanks for the thought.


Your ISP doesn't need to, if you follow Pascal's advice. All traffic which flows through your ISP would be on port 8080. Apache would still listen on port 80. Iptables would connect the two. All you would need would be to enter a port forward in the port forwarding panel.

However...

The 6.0 and 6.0.1 versions of the portforwarding panel don't correctly support portforwarding to a port on the server itself. You'll need to use an updated version of e-smith-portforwarding (IIRC) to have it work.

splunk

2 Question, Upgrade Apache to v2 and change listening port
« Reply #20 on: October 30, 2005, 12:12:09 AM »
I wasn't able to get any of those running on 6.x.  Is there any way to have the server automatically run an iptable command upon boot?


Thanks