Networking Forums

Networking Forums > Computer Networking > Linux Networking > host my website on my linux box

Reply
Thread Tools Display Modes

host my website on my linux box

 
 
charly
Guest
Posts: n/a

 
      12-01-2003, 09:11 PM
Greetings,

I got an apache server listening on port 80
I have as well a registered domain name which follows my dynamic ip
My router is configured to route all requests from port 80 to my machine
in my lan :

Indx Prot Inside-address:Port Outside-address:Port oreign-address:Port
Flgs Expir State Control

4 6 10.0.0.1:37134 90.14.157.251:11717
204.1.226.226:443 1
60 1
5 6 10.0.0.1:80 90.14.157.251:80 0.0.0.0:0

My iptables follow

# Default rule : All Output accepted
$protec -P OUTPUT ACCEPT


#$protec -A INPUT -i eth0 -p tcp -m state --state RELATED,ESTABLISHED
-j ACCEPT
$protec -A INPUT -i eth0 -p tcp --source-port 80 -j ACCEPT -> Should be
ok no ??
$protec -A INPUT -i eth0 -p tcp --source-port 20 -j ACCEPT
$protec -A INPUT -i eth0 -p tcp --match multiport --sports
110,119,20,21,80,22,53,25 -m state --state RELATED,ESTABLISHED -j ACCEPT
$protec -A INPUT -i eth0 -p tcp -m state --state RELATED,ESTABLISHED -j
ACCEPT
$protec -A INPUT -p tcp -i eth0 --dport 22 -j ACCEPT

I tried a tcpdump to see what was happening but maybe misread the output


So what did I do wrong ??

If someone can shed some light on this, thank you very much !

 
Reply With Quote
 
 
 
 
David Efflandt
Guest
Posts: n/a

 
      12-02-2003, 12:03 AM
On Mon, 01 Dec 2003 23:11:22 +0100, charly <(E-Mail Removed)> wrote:
> Greetings,
>
> I got an apache server listening on port 80
> I have as well a registered domain name which follows my dynamic ip
> My router is configured to route all requests from port 80 to my machine
> in my lan :
>
> Indx Prot Inside-address:Port Outside-address:Port oreign-address:Port
> Flgs Expir State Control
>
> 4 6 10.0.0.1:37134 90.14.157.251:11717
> 204.1.226.226:443 1
> 60 1
> 5 6 10.0.0.1:80 90.14.157.251:80 0.0.0.0:0
>
> My iptables follow
>
> # Default rule : All Output accepted
> $protec -P OUTPUT ACCEPT
>
>
> #$protec -A INPUT -i eth0 -p tcp -m state --state RELATED,ESTABLISHED
> -j ACCEPT
> $protec -A INPUT -i eth0 -p tcp --source-port 80 -j ACCEPT -> Should be
> ok no ??
> $protec -A INPUT -i eth0 -p tcp --source-port 20 -j ACCEPT
> $protec -A INPUT -i eth0 -p tcp --match multiport --sports
> 110,119,20,21,80,22,53,25 -m state --state RELATED,ESTABLISHED -j ACCEPT
> $protec -A INPUT -i eth0 -p tcp -m state --state RELATED,ESTABLISHED -j
> ACCEPT
> $protec -A INPUT -p tcp -i eth0 --dport 22 -j ACCEPT
>
> I tried a tcpdump to see what was happening but maybe misread the output
>
>
> So what did I do wrong ??


You are specifically accepting input from --source-port 80, but a web
server is reached by --destination-port 80 (or -dport 80), and source port
could be anything.

--
David Efflandt - All spam ignored http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/
 
Reply With Quote
 
charly
Guest
Posts: n/a

 
      12-02-2003, 08:56 PM
> You are specifically accepting input from --source-port 80, but a web
> server is reached by --destination-port 80 (or -dport 80), and source port
> could be anything.



Oh yes, you're right

I'm still working and corrected my iptables script to this :

$protec -A INPUT -i eth0 -p tcp -m state --state RELATED,ESTABLISHED -j
ACCEPT
$protec -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT

Should work now but seems that I have to come from outside my lan to
test it...

thank you very much for the remark : you helped me a lot (I had
forgotten the obvious )

 
Reply With Quote
 
Mattias Honrendgard
Guest
Posts: n/a

 
      12-04-2003, 02:29 AM
(E-Mail Removed) (David Efflandt) wrote in message news:<(E-Mail Removed)>...
> On Mon, 01 Dec 2003 23:11:22 +0100, charly <(E-Mail Removed)> wrote:
> > Greetings,
> >
> > I got an apache server listening on port 80

[snip]
>
> You are specifically accepting input from --source-port 80, but a web
> server is reached by --destination-port 80 (or -dport 80), and source port
> could be anything.


You may also find it easier to configure iptables using a gui.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excellent website for LINUX Certification mcsemcsa2009 Linux Networking 0 03-23-2009 06:14 PM
Linux<->Windows connection using USB host-to-host cable =?iso-8859-2?Q?Rados=B3aw?= Grzanka Linux Networking 0 04-10-2004 03:23 PM
New Linux website to hang out at! Ernie Baca Linux Networking 0 02-07-2004 04:58 AM
How do I host website with my domain? tHatDudeUK Linux Networking 11 02-01-2004 01:21 PM
Access to public host from private host through Linux router Santanu Chatterjee Linux Networking 5 11-14-2003 11:57 PM



1 2 3 4 5 6 7 8 9 10 11