Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-01-2012, 12:20 PM   #1
Registered: Jun 2011
Posts: 96

Rep: Reputation: Disabled
hot to allow website to passt hrough iptables

hi friends, i installed apache web server and a public wqebsite in it ,when iptables are on the website is not openig in wan,but after stopping iptables service it works find ,but i want to run websire with iptables how is ti possible.
Old 03-01-2012, 02:09 PM   #2
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,443
Blog Entries: 15

Rep: Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439Reputation: 1439
Turn on iptables then run "iptables -nL" to see what you have. Iptables chains are vary by distribution.

Generally you simply have to add port 80 (for standard web traffic) and/or port 443 (for https traffic). Some web pages have special ports (which would show up in the URL like "" if it were port 3000 for example) so you'd have to open those if you had any.

So for example on a RHEL5 system one might add a rule to open port 80 in the RH-Firewall-1-INPUT chain with:
iptbales -A RH-Firewall-1-INPUT -p tcp -m state --state NEW,ESTABLISHED -m tcp --dport 80 -j ACCEPT

You'd make a similar rule for port 443 or other ports you needed. You can also restrict the ports to certain IPs or ranges.

Typing "man iptables" will give you more details. Note that after you add the rules you need to save the iptables (see iptables-save command) to whatever file is read at boot on your distro to be sure it re-adds the rules after a reboot.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
HOW TO blocking a website with iptables ?? achulxp Linux - Security 11 06-10-2011 05:11 AM
Error resolving host name hrough transparent squid amitkush Red Hat 2 06-22-2009 05:37 AM
Allow single website from iptables Madhushanka Linux - Security 1 11-21-2008 12:05 AM
Transfering files hrough internet karthik1983 Linux - Networking 1 12-24-2003 04:15 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:06 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration