Default Firewall settings

I have a LAMP setup with Ubuntu 9.10 and want to know if there is one command or the easiest way to simply block all ports on a firewall and open up only the ports that are required for web server functionality. (email, http, etc)

What ports and configurations does everyone have and/or recommend? I'm wanting to limit as many open holes as possible. Thanks.

2 Replies

The ports you need open depends on what you're doing, a LAMP stack you need 80.

Here's a guide to configuring a firewall for debian, which is pretty much the same as ubuntu … bian-lenny">

Or, take a look at ufw, which is documented in the Ubuntu Server Guide: … ewall.html">


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct