More than 1 webserver behind DD-WRT

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


Joined: 20 Jan 2010
Posts: 41

PostPosted: Thu Feb 04, 2010 21:56    Post subject: Reply with quote
fseka wrote:

I'll write a tutorial if someone is interested.


I'm very interested.

I have several 4mb flash routers mostly with mini builds, some with 16mb memory and some with 32mb
but have about 10-12 web servers (cams mostly) that I need to access, all via port 80 (my office blocks all but a few: only 80, 443, 21) even 23 is blocked :(

I've been tunneling till now, but would prefer redirection to appropriate web server via subdomain mapping.

Here is my current setup:
Netgear (WNR854T) router on stock firmware and ip 192.168.1.1 redirects port 443, 80 to WRT300N v1 running DD-WRT v24-sp2 mini (SVN: 13525) running as AP (192.168.1.3)

I wish to install pound on the WRT300N without other optware. I have jffs2 enabled and it shows:
Total / Free Size as 704.00 KB / 380.00 KB

Possible?
Sponsor
fseka
DD-WRT User


Joined: 02 Dec 2009
Posts: 75

PostPosted: Fri Feb 05, 2010 13:11    Post subject: Reply with quote
Hi,

the problem is that pound is only present in mega build which means 8mb flash routers :cry:

regards,
--
fSeka

_________________
E3000 running DD-WRT v24-sp2(Build 14929) mega
Netgear R7000 running DD-WRT v3.0-r27858)
redhat27
DD-WRT Novice


Joined: 20 Jan 2010
Posts: 41

PostPosted: Sat Feb 06, 2010 2:41    Post subject: GPIO solder points? Reply with quote
Sadly, yes. I started out with the Optware by hand wiki and the "uclibc-opt" itself exceeded my available space.

Any idea where to get the GPIO solder points for a specific router? Only some few routers are listed. Are WRT300N version XX solder points the same as any other Linksys routers?
unclerunkle
DD-WRT Novice


Joined: 19 Oct 2008
Posts: 26

PostPosted: Sat Feb 06, 2010 20:07    Post subject: Reply with quote
fseka wrote:
Pound is finally working by me with the mega version of dd-wrt and without optware Laughing

I'll write a tutorial if someone is interested.

cheers
--
fSeka


I am VERY interested as well. I have a Asus RT-N16 and quite simply need a walkthrough. Learning Linux for me has been quite a chore.

Any help would be appreciated, thanks.

_________________
Asus RT-N16 running DD-WRT v24-sp2 (12/18/09) big (SVN revision 13491M NEWD-2 K2.6 Eko)
fseka
DD-WRT User


Joined: 02 Dec 2009
Posts: 75

PostPosted: Sun Feb 07, 2010 18:53    Post subject: Reply with quote
Hi,

like I said before, you need to have the mega version.

Or according your signature you have the big version :(

regards
--
fSeka

_________________
E3000 running DD-WRT v24-sp2(Build 14929) mega
Netgear R7000 running DD-WRT v3.0-r27858)
splerman
DD-WRT Novice


Joined: 16 Apr 2007
Posts: 5

PostPosted: Tue Feb 23, 2010 14:00    Post subject: Pound Config on Mega Without Optware Reply with quote
Router: Linksys WRT600N v1.1
Firmware: DD-WRT v24 pre-SP2 (Beta) Build 13064 Mega

Just upgraded to the mega build so I could take advantage of pound as a reverse-proxy. I'm running multiple web servers on the same platform using different ports (e.g., webmail on 81, web access to ftp on 82, web access to home automation controller on 83 etc.).

I've read this thread and whatever I can find on pound. I am a relative noob, however, in certain areas (linux, filesystems etc.) despite 15 years as a network engineer (but not programming).

Since mega already includes pound, I know that I don't have to install optware to use pound.

I've tried to follow frater's instructions to grab his config scripts starting with:

Code:

wget -O /opt/etc/init.d/S80pound http://wd.mirmana.com/S80pound
chmod +x /opt/etc/init.d/S80pound
ln -s S80pound /opt/etc/init.d/K20pound


Following the wget, however, I get no response other than a prompt and /opt is empty. Do I need to create /opt/etc or mount a filesystem on /opt/etc or is frater's site simply not responding?

A step-by-step assuming a fresh mega build would be fantastic.

Kind thanks to all of you who contribute your expertise and time in developing dd-wrt, building such an in-depth knowledgebase about it and helping it's users.
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Tue Feb 23, 2010 18:17    Post subject: Reply with quote
Do you have USB-storage?
If so, put an ext2 formated disk in your usb and install optware using "prep_optware".
It should give you a good start running 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)
redhat27
DD-WRT Novice


Joined: 20 Jan 2010
Posts: 41

PostPosted: Fri Feb 26, 2010 0:40    Post subject: Reply with quote
Glad to see you back on this thread, frater.

I managed to get a 8MB flash WRT54GS v1.1 router and install mega generic. But like fseka experienced, after enabling jffs, there is no space to put the pound config file...

Any way to do this without optware install (no usb/mmc/cifs)

root@WRT54GSv11:~# which pound
/usr/sbin/pound


Thanks
fseka
DD-WRT User


Joined: 02 Dec 2009
Posts: 75

PostPosted: Tue Mar 09, 2010 12:43    Post subject: Reply with quote
Hi,

there is a way without optware, via custom script.

I've wrote a custom script which is launched during the startup, that creates a pound.cfg file.
After that, I start pound with this new file as config file.
I've done all with the gui: startup command, firewall and custom script.
I've also created a second file with the ssl cert used by pound to convert http->https.

regards,
--
fSeka

_________________
E3000 running DD-WRT v24-sp2(Build 14929) mega
Netgear R7000 running DD-WRT v3.0-r27858)
redhat27
DD-WRT Novice


Joined: 20 Jan 2010
Posts: 41

PostPosted: Tue Mar 09, 2010 15:59    Post subject: Reply with quote
Hello fseka...

Could you post your startup script please (you may hide parts of it that you feel is private)

Thanks
PcFixerGuy
DD-WRT Novice


Joined: 09 Mar 2010
Posts: 1

PostPosted: Tue Mar 09, 2010 21:31    Post subject: 2 servers - 1 ip address Reply with quote
Will this work for me and do I need to upgrade the firmware to do so?

I have 2 seperate domains that both point to my DSL static IP address. I have each domain running on a seperate server withing the LAN. Currently I can only access the 1 webserver because port 80 is forwarded to that IP. Will this software fix help me to access both servers, via port 80 when hitting their domain name from the internet?


i have a linksys WRT150N v1.1

Total Available 80% 13132 kB / 16384 kB
Free 20% 2588 kB / 13132 kB
fseka
DD-WRT User


Joined: 02 Dec 2009
Posts: 75

PostPosted: Fri Mar 19, 2010 15:33    Post subject: Reply with quote
Hi,

here they are:

* startup:
/tmp/custom.sh
pound -v -f /tmp/pound/pound.cfg

* firewall:
iptables -I INPUT -p tcp --dport 8443 -j ACCEPT

* custom:
#!/bin/sh
user=pound
cfg=/tmp/pound/pound.cfg
ctl=/tmp/pound/pound.ctl
crt=/tmp/pound/pound.pem

write_cert()
{
echo "-----BEGIN RSA PRIVATE KEY-----" >${crt}
...... PUT yours here .....
echo "-----END RSA PRIVATE KEY-----" >>${crt}
echo "-----BEGIN CERTIFICATE-----" >>${crt}
...... PUT yours here .....
echo "-----END CERTIFICATE-----" >>${crt}
}

write_header()
{
echo -e "User\t\t\"${user}\"" >${cfg}
echo -e "Group\t\"${user}\"" >>${cfg}
echo -e "TimeOut\t120" >>${cfg}
echo -e "Alive\t30" >>${cfg}
echo -e "Control\t\"${ctl}\"" >>${cfg}
echo -e "" >>${cfg}
}

write_http_listener()
{
echo -e "ListenHTTP" >>${cfg}
echo -e "\tAddress\t0.0.0.0" >>${cfg}
echo -e "\tPort\t$1" >>${cfg}
echo -e "\txHTTP\t4" >>${cfg}
}

write_https_listener()
{
write_cert
echo -e "ListenHTTPS" >>${cfg}
echo -e "\tAddress\t0.0.0.0" >>${cfg}
echo -e "\tPort\t$1" >>${cfg}
echo -e "\tCert\t\"${crt}\"" >>${cfg}
echo -e "\txHTTP\t4" >>${cfg}
}

write_service()
{
echo -e "\tService \"$1\"" >>${cfg}
echo -e "\t\tHeadRequire\t\"^Host:[\\\t ]*$2$\"" >>${cfg}
echo -e "\t\tBackEnd" >>${cfg}
echo -e "\t\t\tAddress\t$3" >>${cfg}
echo -e "\t\t\tPort\t$4" >>${cfg}
echo -e "\t\tEnd" >>${cfg}
echo -e "\tEnd" >>${cfg}
}

mkdir /tmp/pound
grep -q ${user} /etc/passwd || echo "${user}Mad:33:33:${user}:/tmp:" >>/etc/passwd
grep -q ${user} /etc/group || echo "${user}Mad:33:" >>/etc/group
write_header
write_https_listener "8443"
echo -e "" >>${cfg}
write_service "name_of_your_1st_web_server" "xxxx\\.no-ip\\.biz" "192.168.1.55" "80"
write_service "name_of_your_2nd_web_server" "yyyy\\.no-ip\\.biz" "192.168.1.57" "5000"
echo -e "End" >>${cfg}

exit 0

regards,
--
fSeka

_________________
E3000 running DD-WRT v24-sp2(Build 14929) mega
Netgear R7000 running DD-WRT v3.0-r27858)
redhat27
DD-WRT Novice


Joined: 20 Jan 2010
Posts: 41

PostPosted: Tue Mar 23, 2010 0:59    Post subject: Reply with quote
@fseka: Thank you very much for the scripts. I will try them out soon. Thanks again
fseka
DD-WRT User


Joined: 02 Dec 2009
Posts: 75

PostPosted: Tue Mar 23, 2010 12:43    Post subject: Reply with quote
Don't forget to forward the incomming port 443 to 8443.
_________________
E3000 running DD-WRT v24-sp2(Build 14929) mega
Netgear R7000 running DD-WRT v3.0-r27858)
redhat27
DD-WRT Novice


Joined: 20 Jan 2010
Posts: 41

PostPosted: Tue Mar 23, 2010 15:17    Post subject: Reply with quote
Since I would be doing this only over port 80 (not 443) I would not need write_cert() and write_https_listener()... Right?

And I would need to forward 80 to 8443?

This is because of 443 -> 22 has to be present for tunneling (see attached picture):

My work environment just allows connection over very few ports: 20-21, 80 and 443



ssh.JPG
 Description:
 Filesize:  12.01 KB
 Viewed:  16964 Time(s)

ssh.JPG


Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next Display posts from previous:    Page 4 of 8
Post new topic   Reply to topic    DD-WRT 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