Roksbox: restricting access to LAN
Posted by: docus (---.dhcp.stls.mo.charter.com)
Date: January 27, 2013 10:42AM

Hello folks,

I'm using Wamp on Windows 7 64-bit, and I have 2 general purposes: the first is for web development, i.e. testing php documents for my website before they go live. That's pretty standard, and Wamp works beautifully out of the box for this.

The second, less common use is to enable playback of media from my desktop computer to my Roku by way of Roksbox. Most of the tutorials for setting this up in Wamp seemed to require putting the server 'online' and making it accessible to everyone. I'd rather restrict access to just the other machines on my LAN, however.

I got Roksbox working by modifying the base www directory access as follows:


# onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from 192.168.1.9
Allow from 192.168.1.23

</Directory>

In this case, the *.9 IP corresponds to my Roku, and the *.23 corresponds to my desktop computer. I use my router to keep these IPs assigned. I leave Wamp server in 'offline' mode, but it works perfectly for my purposes.

I also modified the .conf file to listen on port 456:
Listen 192.168.1.23:456

Roksbox allows you to specify ports, so I figured I'd pick a random number and let my router continue to grab requests on port 80.

Anyway, I originally registered on these forums to ask for help, but since I figured this out I thought I'd share--in case anyone else is trying to get their roksbox working and prefers to stick with WAMP rather than the server packages they now recommend.

Options: ReplyQuote
Re: Roksbox: restricting access to LAN
Posted by: stevenmartin99 (Moderator)
Date: January 27, 2013 11:27AM

incase you have multiple LAN devices now or in the future the code would be better as
# onlineoffline tag - don't remove 
Order Deny,Allow 
Deny from all 
Allow from 127.0.0.1  192

and secondly this will now break the ability for anyone else to use the ONLINE/OFFLINE Function on the menu.

so to correctly set this up so that wamp works on LAN when offline and WAN when online..

1.turn Wamp Online ( left click wamp> put ONLINE ) *this is REALLY IMPORTANT*

2. open c:\wamp\scripts\onlineoffline.php

3. Replace
$offlineText = "#   onlineoffline tag - don't remove
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1";

with
$offlineText = "#   onlineoffline tag - don't remove
    Order Deny,Allow
    Deny from all
    Allow from localhost 127.0.0.1 192";

4. Save the file.
5. Right click wamp tray menu > REFRESH
6. Left click wamp tray menu > Put Offline


@docus Since you already made a change, you cant follow these steps because when wamp does the search replace for the code, your code will get messed up. so you should match the $offline var in the onlineoffline.php with the code you have in the httpd.conf, of course thats only if you want to use online in the future

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]



Edited 3 time(s). Last edit at 01/27/2013 11:34AM by stevenmartin99.

Options: ReplyQuote


Sorry, only registered users may post in this forum.