LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 03-01-2012, 01:20 PM   #1
mlnm
Member
 
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, 03:09 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,075
Blog Entries: 14

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
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 "www.mypage.com:3000" 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.
 
  


Reply


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 06:11 AM
Error resolving host name hrough transparent squid amitkush Red Hat 2 06-22-2009 06:37 AM
Allow single website from iptables Madhushanka Linux - Security 1 11-21-2008 01:05 AM
Transfering files hrough internet karthik1983 Linux - Networking 1 12-24-2003 05:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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