Koozali.org: home of the SME Server

Remove External Access to Port 80

PhilV

Remove External Access to Port 80
« on: May 27, 2004, 05:20:25 PM »
My httpd log is full of requests from ip address on the WAN trying to run various scripts on my server, (of course these don't work, but it's annoying!)

How can I configure SME to not allow access to port 80 from external? I still need port 80 open for connection from the lan, (to access server manager and the like), and I still want my mail port open on both interfaces, but I do NOT want my primary domain presenting a web page to the outside world.

At the moment if I go to my url it presents just the page with a file listing, (which is empty), and the usual link to 'Parent directory' which does nothing as that is already the root for the webserver). how do I stop my SME dispalying this webpage at all?

Thanks,

Phil

Ed

Remove External Access to Port 80
« Reply #1 on: May 27, 2004, 07:24:37 PM »
I haven't tried but
1.  Turn off httpd-e-smith
    (Lose insternal web page as well but the server-manager is handled by httpd-admin)

or

2.  portforward port 80 to an invalid internal address

Ed

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Remove External Access to Port 80
« Reply #2 on: May 27, 2004, 07:41:00 PM »
> My httpd log is full of requests ...........it's annoying

This is the "joy" of having a server on the Internet !
These are not really a problem so just tolerate it.


> At the moment if I go to my url it presents just the page with a file listing.......how do I stop my SME displaying this webpage at all?

Just delete all the files in the Primary/html folder

If you change your configuration from "Server and Gateway" to "Private Server and Gateway", you will disable all external access. You have to log on as admin and run Configure this server again.

The world won't know you exist then !
...

Offline Boris

  • *
  • 783
  • +0/-0
Re: Remove External Access to Port 80
« Reply #3 on: May 27, 2004, 07:52:30 PM »
Quote from: "RayMitchell"
If you change your configuration from "Server and Gateway" to "Private Server and Gateway", you will disable all external access. You have to log on as admin and run Configure this server again.
The world won't know you exist then !

This will disable external e-mail as well.
As for listing in the default folder, it shows then you don't have index.html file. So create a simple one (even blank page).
...

PhilV

Remove External Access to Port 80
« Reply #4 on: May 28, 2004, 11:35:19 AM »
So there is no easy way to just drop packets for port 80 on the external interface? I was thinking of using iptable / chains, (can't remember which is the better), but I'm not to hot on how to manipulate them. Can anyone help me out there?

Thanks again,

Phil

mbachmann

Remove External Access to Port 80
« Reply #5 on: May 28, 2004, 01:13:28 PM »
Create an iptables custom template fragment and drop tcp/ip/udp/whatever/all requests to port 80.

type iptables -L to see current rules.

Default template:
/etc/e-smith/templates/etc/rc.d/init.d/masq/

Custom template directory:
/etc/e-smith/templates-custom/etc/rc.d/init.d/masq/

Search for posts from bobk and our french friend Muzo a.k.a MasterSleepy, they've good knowledge about this.

There has been a contrib "e-smith-denyport" but i don't know what's happen to it.