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.