Putting RB behind Apache

new BookmarkLockedFalling
billw
Guest

Guest Avatar

Post by billw on Sept 12, 2007 16:27:21 GMT -5

Okay, so I want to hide RB behind Apache on Windows XP. Many hours of Googling and hacking httpd.conf, and no luck. I think it involves reverse proxies, but I'm not sure.

What I'd like to do is make it so any queries going to billw.shacknet.nu/rb/ are routed to billw.shacknet.nu:8008/seaside/go/runbasicpersonal . I'm using Apache 2.2.4 (ack - need to upgrade to 2.2.6) - the Windows binary from the Apache website - and RB beta 3. Any pointers in the right direction are much appreciated!
Jerry Muelver
Administrator
*****

Jerry Muelver Avatar

Posts: 521

Post by Jerry Muelver on Sept 12, 2007 20:17:29 GMT -5

How about the Redirect directive in .htaccess?


Redirect /rb billw.shacknet.nu:8008/seaside/go/runbasicpersonal

should redirect any call containing the /rb path to your chosen destination. Maybe RedirectMatch with reg exp would give you more flexibility. You might also examine RedirectPermanent, since Redirect by itself tells the client the redirection is temporary.
davec
New Member
*

davec Avatar

Posts: 4

Post by davec on Sept 17, 2007 16:04:35 GMT -5

Hi Bill,

This is untested. In your httpd.conf try this;

ProxyPass /rb/ billw.shacknet.nu:8008/seaside/go/runbasicpersonal
ProxyPassReverse /rb/ billw.shacknet.nu:8008/seaside/go/runbasicpersonal

I think this technique is well used, but I've never personally tried it. (But I will soon ;))

Hope this helps (and works!)

Kind Regards,
Dave.
Last Edit: Sept 17, 2007 16:05:24 GMT -5 by davec
davidcoker
New Member
*

davidcoker Avatar

Posts: 12

carlgundel
Administrator
*****
Creator of Run BASIC

carlgundel Avatar

Posts: 975

davidcoker
New Member
*

davidcoker Avatar

Posts: 12

carlgundel
Administrator
*****
Creator of Run BASIC

carlgundel Avatar

Posts: 975

Post by carlgundel on Jan 18, 2008 10:53:22 GMT -5

davidcoker said:
Thanks Carl.

Figured I'd actually ask some of these questions *before* I start heading down the path. ::) Which if any of the instructions above were the correct steps?

Here's what I did in httpd.conf:

1) I specified (actually just uncommented) the following module lines:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule rewrite_module modules/mod_rewrite.so

2) Set the server name
ServerName www.runbasic.com:80

3) Set the document root to be your public folder:
DocumentRoot "C:/rbp/public"

4) Add these lines to the end of the file to configure URL rewriting and proxying:
RewriteEngine On
ProxyVia Block
ProxyPreserveHost On
RewriteCond C:/rbp/public/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ http://localhost:8008/seaside/go/runbasic/1ドル [P,L]

That should do it for you. :)

-Carl
davidcoker
New Member
*

davidcoker Avatar

Posts: 12

tnorvell
New Member
*

tnorvell Avatar

Posts: 19

votan
Senior Member
****

votan Avatar

Posts: 304

Post by votan on Sept 10, 2008 6:06:30 GMT -5

In case some of you are having problems doing it with Carl's description, like I had... (login came up, but images etc failed loading) ... here is the complete and correct virtual host entry. (including error logs)


<VirtualHost *:80>

ServerAdmin webmaster@test.com
DocumentRoot C:/rbp/public
ServerName www.test.com
ErrorLog logs/test.com-error_log
CustomLog logs/test.com-access_log common

<IfModule mod_rewrite.c>
RewriteEngine on
ProxyVia Block
ProxyPreserveHost On
RewriteCond C:/rbp/public/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ http://localhost:8008/seaside/go/runbasic/1ドル [P,L]
</IfModule>

</VirtualHost>


Now you can access RB either through "localhost" (if the server is running on your current machine), by IP (if the server is in your local net) or by a domain name (if you have set up a domain name / DNS). Replace all "test.com" with your actual domain name or IP... optional, you can limit listening to an IP by changing <VirtualHost *:80> into something like <VirtualHost 192.168.0.66:80> or whatever...

EDIT: I removed the bbcode (code)(/code) from my post, as it caused adding more bbcode to the server-name, what would cause a forbidden message when used that way.... so now it is correct.
Last Edit: Sept 10, 2008 13:07:13 GMT -5 by votan
Psycho
Full Member
***

Psycho Avatar

Posts: 196

Post by Psycho on Jan 1, 2009 20:33:24 GMT -5

Votan,

Thanks for the information you posted on this.

Having never hosted a site before, I finally registered a free domain with DynDNS.com and initially used the RBP server alone to get a webpage hosted under port 80. After only a couple of days, I wanted to try something that would offer more overall flexibility and file handling beyond the active programming part of RunBASIC. After downloading Apache and running under Windows everything went well until I started the RB server and only saw the generic index.html page that Apache was serving. After going through the posts, this one got everything working perfectly for me. For an average home user, it's the best of both worlds. I can cheat and create quick pages with Word or Publisher (despite all the extra garbage they create), yet still have my applications in RB available to all ;D

For someone who had never hosted or knew anything about web servers (and really still doesn't), the posts on this board really helped me getting everything to work.

A second thanks to everyone that offers help and information here. It is truly invaluable.

John "Psycho" Siejkowski
rich357
Senior Member
****

rich357 Avatar

Posts: 353

Post by rich357 on Feb 5, 2009 10:09:36 GMT -5

For me, I need to install RB on an actual site that is hosted by a company. I don't have the luxury of being able to run a home based system and really don't see the need.
Installing RB on the PC is a snap. What is the procedure for installing onto a server that is already online? Has anyone actually done this?
StefanPendl
Global Moderator
*****

StefanPendl Avatar

Run for BASIC ...
Posts: 945

Post by StefanPendl on Feb 5, 2009 12:39:34 GMT -5

rich357 Avatar
For me, I need to install RB on an actual site that is hosted by a company.
---snip
What is the procedure for installing onto a server that is already online? Has anyone actually done this?

This highly depends on the servers O/S, is it a Linux host or a Windows based system ???
The service provider usually offers documentation on how to do things.
[b]Stefan[/b] - [a href=http://stefanpendl.runbasichosting.com/]Homepage[/a][br][br][b]Please give credit if you use code I post, no need to ask for permission.[/b][br][br]Run BASIC 1.01, Fire-/Waterfox (IE11, Edge), Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM
mackrackit
Full Member
***

mackrackit Avatar

Posts: 231

Post by mackrackit on Apr 11, 2009 16:18:01 GMT -5

I have apache2 running on port 8035 on a linux box and RB on port 8008.

Running on a local network using this address
192.168.2.39:8035/seaside/go/runbasicpersonal
the browser returns Not Found.

What do I have wrong?

RewriteEngine On
ProxyVia Block
ProxyPreserveHost On
RewriteCond %{SERVER_PORT} !^8035$
RewriteCond /home/rb/rb101/public/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ http://localhost:8008/seaside/go/runbasic:8008/1ドル [R,L]

Dave[br][br][url]http://www.mackrackit.com:8888[/url][br]
votan
Senior Member
****

votan Avatar

Posts: 304

Post by votan on Apr 11, 2009 18:31:47 GMT -5

make sure your virtual host is listening on the correct port.... then you also do not need to define the port in the condition.

<VirtualHost *:8035>

ServerAdmin webmaster@yourwebsiteaddress.com
DocumentRoot /home/rb/rb101/public
ServerName www.yourwebsiteaddress.com
ErrorLog logs/yourwebsiteaddress.com.com-error_log

<IfModule mod_rewrite.c>
RewriteEngine on
ProxyVia Block
ProxyPreserveHost On
RewriteCond /home/rb/rb101/public/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ http://localhost:8008/seaside/go/runbasic/1ドル [P,L]
</IfModule>

</VirtualHost>


Put all this into the vhosts section of the httpd.conf and make sure all needed modules are loaded....
Anyway, I do not have a linux system here to test it.. but should work.
Last Edit: Apr 11, 2009 18:37:10 GMT -5 by votan