More than 1 webserver behind DD-WRT

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next
Author Message
graegos
DD-WRT Novice


Joined: 08 Jul 2008
Posts: 43

PostPosted: Tue Feb 03, 2009 16:14    Post subject: Reply with quote
Hi Frater, I want to thank you for all your help again.

I have the wrt54g-tm router, which has more memory than the regular wrt54g models. It has 32mb ram and 8mb flash memory. Would this still require the extra USB flash memory or is the built in memory enough?


frater wrote:
Hi Graegos....

I wanted to wait a while to see if some scripts or commands could get incorporated, but it seems the devs have this on a very low priority.

Pound is incorporated in the mega-versions and USB-support has been enhanced. Are you able to use an USB-flash with ext-partition and load this as an /opt partition?

If so, I can write a tutorial that doesn't need optware....

Maybe write to brainslayer or make a ticket in TRAC?

_________________
Router Model: Buffalo WZR-HP-AG300H
Firmware Version: Firmware: DD-WRT v3.0-r46733 std (05/21/21)
Kernel Version: Linux 3.10.108-d11 #81419 Fri May 21 12:44:07 +07 2021 mips
Sponsor
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Tue Feb 03, 2009 16:38    Post subject: Reply with quote
If you have 8 MB you can load a MEGA-version.
I have it working with this version:

http://www.dd-wrt.com/dd-wrtv2/downloads/others/eko/BrainSlayer-V24-preSP2/210109/broadcom/dd-wrt.v24_mega_generic.bin

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
graegos
DD-WRT Novice


Joined: 08 Jul 2008
Posts: 43

PostPosted: Wed Feb 04, 2009 0:20    Post subject: Reply with quote
Ok and I wont need a usb flash stick mod?

I'll load up a mega version, then try to follow which steps you have posted, I know you posted several. Or try figuring out myself ... I think I'm finally understanding how this works.

frater wrote:
If you have 8 MB you can load a MEGA-version.
I have it working with this version:

http://www.dd-wrt.com/dd-wrtv2/downloads/others/eko/BrainSlayer-V24-preSP2/210109/broadcom/dd-wrt.v24_mega_generic.bin

_________________
Router Model: Buffalo WZR-HP-AG300H
Firmware Version: Firmware: DD-WRT v3.0-r46733 std (05/21/21)
Kernel Version: Linux 3.10.108-d11 #81419 Fri May 21 12:44:07 +07 2021 mips
sternman
DD-WRT Novice


Joined: 20 Mar 2009
Posts: 6

PostPosted: Fri Mar 20, 2009 3:36    Post subject: Re: My Setup Reply with quote
frater wrote:
graegos wrote:
Here's a description of my current setup:

1 wrt54g-tm build 10328

1 Ubuntu web server with port 80 forwarded to server ip, there are a total of 3 websites hosted on this server.

I need to host one more web server appliance on the wrt54g-tm.

Ready to test this out, not sure how to begin though if anyone can help!

Are you still there...??
I took some extra effort to make it easy for you...

Hello frater

i want to give this a go.
i mounted jffs to cifs.
startup script will place cifs over jffs
i went to install optware, hung
i downloaded the script for the install, placed it inside my jffs share.
ran it, seems to have installed.

i dont see ipkg-opt to install libuclibc++.
i presume my optware did not work properly.

i would like to enable this and will work to get it done.

will this work with cifs?
sternman
DD-WRT Novice


Joined: 20 Mar 2009
Posts: 6

PostPosted: Fri Mar 20, 2009 7:37    Post subject: kinda stuck... Reply with quote
ok, i got passed the cifs bit and optware.
I was mounting my cifs to a windows machine, and the symbolic links could not be greated Embarassed

Now, my cifs is pointing to a linux nas device.
i mapped jffs to /jffs and /jffs/opt to /opt

i installed libuclibc++ and pound.
unpacked the poundcfg.tar file.
added the iptables entry (do i need to do this on each boot?)
and modified the pound.pt2 file
then started pound.

what i dont get is, you have a screen shot below, i am to configure an entry in nat that points port 80 to 8080 on the router. i presume this is to direct traffic to pound.

when i try to hit one of my sites via a host header that is in the pound.pt2 file, i get the site that was there before i started this exercise

before
80 -> xxx.yyy.100.8 : 80
after
80 -> xxx.yyy.100.1 :8080

from the outside, still likes like 100.8 and not pound. Confused
tried a few of the entries, all turning up the same (for port 80)

thoughts???
frater wrote:
First you install Optware:

if it's not enabled, enable jffs on your router and clean it, then reboot

SSH to your router...

Code:
mkdir /jffs/opt
mount -o bind /jffs/opt /opt
wget http://www.wlan-sat.com/boleo/optware/optware-install-ddwrt.sh  -O - | tr -d '\r' > /tmp/optware-install.sh
sh /tmp/optware-install.sh

If everything has gone alright, you can continue.

Now install Pound and uclibc++

Code:
/opt/bin/ipkg-opt install libuclibc++
/opt/bin/ipkg-opt install pound


For starters, copy the attached file to /tmp and execute the following code.
Code:
tar xvf /tmp/poundcfg.tar -C /


Add the following to your startup code:
Code:
mount -o bind /jffs/opt /opt
/opt/etc/init.d/S80pound start


Add this to the firewall script
Code:
iptables -I INPUT 1 -p tcp --dport 8080 -j ACCEPT

And add a port forward from port 80 to port 8080 of the LAN-IP.
Enable DNSMasq and set your LAN domain. Also enable Local DNS.

You should then manually modify the file /opt/etc/pound/pound.pt2
It's only an example script and sort of self-explanatory ;-)

You can start the reverse proxy with the command:
Code:
/opt/etc/init.d/S80pound start


The startup script writes a config file to /tmp/pound/pound.cfg
Check if this file is written and makes sense.
sternman
DD-WRT Novice


Joined: 20 Mar 2009
Posts: 6

PostPosted: Fri Mar 20, 2009 8:09    Post subject: got it Reply with quote
ok.

got it working.

the entry in the pound.pt2 file was trying to do something dynamic. i couldn't quite follow the logic (took a backup of the file) then i change the HeadRequre line to include a hard coded external domain.

whoo hoo, all works!!!

so, pound running via optware over cifs to a linux nas device. Exclamation Exclamation Exclamation

was not too hard.
the biggest issue was the optware install, the wget line worked once. i just downloaded it from another computer and loaded it onto jffs (easy when done via cifs).
ran it.
it would not work when cifs was to a windows machine. could not creat symbolic links. wouldn't let me install libuclibc++ or pound (ipkg-opt was not configured correctly).
installed libuclibc++ easily
installed pound easily
modified the firewall easily

the instructions seemed to be spot on. took a little bit of "interpretation" (meaning, i needed to re-read it, but slower) Very Happy

all in all, great job on the instructions and this works GREAT Cool

question Question Question
i have this running great for TCP based services (web servers).
will this work for udp based services?
basically, i want udp requests sent to port 80, handled by the header entry and then forwarded to the target machine (probably on a different port than 80).

i tried adding the firewall entry with udp instead of tcp (i am not good at iptables).

if i am going beyond the scope of this, let me know.

thanx anyways!!!
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Fri Mar 20, 2009 13:55    Post subject: Reply with quote
I tried to use the firmware modification toolkit to create a 4MB firmware with pound, but loading this file on my Asus bricked it and now I have a switch....

I now replaced it with a Linksys WRT54G v1.1 Crying or Very sad
It's only my WDS-bridge...


This kind of routing is not based on normal protocols. It actually reads the http-headers which are send by the browser on the other hand. The proxy will then connect to the appropriate server.....
It works like virtual hosting:
http://httpd.apache.org/docs/1.3/vhosts/name-based.html

I'm afraid you will not have much luck with other kind of services.....

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
sternman
DD-WRT Novice


Joined: 20 Mar 2009
Posts: 6

PostPosted: Fri Mar 20, 2009 18:59    Post subject: Reply with quote
I hear ya.

I will play around with it more. Maybe something can make it work. I think it appears to not be working because the source and destination ports that are expected are different.

I am trying this with SIP for VoIP. Basically, some places I go with my wifi phone block other ports but they allow 80. If i can get the phone to negotiate with the server over port 80, then I can work around this issue. My SIP server sits with a fqdn, and I use it in the phone.

I was examining the packets and I noticed that they are just expecting different ports for communications. I need to adjust the SIP server accordingly. But, now, it is possible.

Thank you for your instructions.
Btw, for anyone else following the steps, you need to add the iptables entry to your smb startup script. The entry needs to be reset each time the units power is cycled. There may be a more appropriate place for this, then as frater as this is his baby.

Cheers Arrow
sternman
DD-WRT Novice


Joined: 20 Mar 2009
Posts: 6

PostPosted: Fri Mar 20, 2009 20:44    Post subject: SSL Reply with quote
Hey frater,

can this be configured for SSL?

i guess that is the next logical step, all SIP aside...
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Fri Mar 20, 2009 22:01    Post subject: Reply with quote
You should save it as "firewall script" this way it will be applied everytime iptables is restarted....

Administration -> command -> save firewall

You should go here to learn more about pound itself:
http://www.apsis.ch/pound/index_html

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
MKruer
DD-WRT Novice


Joined: 15 Feb 2009
Posts: 18

PostPosted: Thu May 14, 2009 5:48    Post subject: Reply with quote
frater,

Will this allow pixelserv to be run on the router instead of another box?
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Thu May 14, 2009 14:37    Post subject: Reply with quote
No, not really...
It can be compared to virtual hosting where you have 1 webserver and several domains.

This is a reverse proxy which can choose different webservers depending on their domain.

If I access my WAN-IP from the outside and ask for http://xbox.frater.com I will go to my xbox. If I ask http://linux.frater.com I will go to my linux box.

This pixelserv is nothing really but a webserver which always return a pixel and doesn't care which page is asked. It's a shame that it needs perl...

No-one is stopping you to install perl, though

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
subnet
DD-WRT Novice


Joined: 10 Jul 2009
Posts: 2

PostPosted: Fri Jul 10, 2009 14:55    Post subject: Reply with quote
Hi frater,
and sorry for my english Smile
Maybe this is what I’m searching, but I have some question, I hope you can help me.
I have a Linksys router running DD-WRT, with the following specifications:
****
Router Model: Linksys WRT54G/GL/GS
Firmware Version: DD-WRT v24-sp1 ( 07/27/08 ) std - build 10011
CPU Model: Broadcom BCM5352 chip rev 0

Memory
Total Available 80%13048 kB / 16384 kB
Free 7%856 kB / 13048 kB
Used 93%12192 kB / 13048 kB
Buffers 13%1572 kB / 12192 kB
Cached 36%4448 kB / 12192 kB
Active 31%3740 kB / 12192 kB
Inactive19%2308 kB / 12192 kB
****

I have several computers in my LAN, and I have a domain with dyndns to reach my router from the Internet. No problems reaching my PCs with forwarding rules, but I’d like to assign names to machines, and maybe I can do it with your feature.
So the questions are:
1) I have to change my router firmware to use it? Is this
http://www.dd-wrt.com/dd-wrtv2/downloads/v24-sp1/Consumer/Linksys/WRT54GL_1.0/dd-wrt.v24_mega_generic.bin The correct firmware that I have to install? It will work on my router?
2) The PCs in my LAN running several service, not only webserver. Is this working only with a webserver or..?
Thanks in advance for your help Smile
Piero
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sat Jul 11, 2009 7:47    Post subject: Reply with quote
1. No, you can't run a mega-version on a WRT54g.

I'm not a dev of DD-WRT but wanted to get my solution for this problem incorporated in the firmware. Brainslayer did incorporate the binary that's needed, but didn't go further. Only an 8 MB flash has enough memory to keep this in flash.

You can install optware in /jffs and then install pound from optware.

2. It's specific to http (It reads the headers which the http-client sends). I believe it knows some more protocols, you'll have to go to pound's website to learn more about that http://www.apsis.ch/pound/

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
subnet
DD-WRT Novice


Joined: 10 Jul 2009
Posts: 2

PostPosted: Sat Jul 11, 2009 8:37    Post subject: Reply with quote
Thanks for your answer :)

frater wrote:

1. No, you can't run a mega-version on a WRT54g.


uh... yes, I've noticed.. it didn't works..

frater wrote:

I believe it knows some more protocols, you'll have to go to pound's website to learn more about that http://www.apsis.ch/pound/


I'm checking the site right now...
Thanks again, Bye Smile
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next Display posts from previous:    Page 2 of 8
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum