This document describes how to forward all calls to an apache server, through the apache 'proxy_module' module, to the CrushFTP server environment.

( *** For IIS, you need a third party module. A recommended one is Helicon Ape : http://www.helicontech.com/ape/ *** )

One should note that CrushFTP operates in its own server environment and Apache in another: this will create a 'bridge' between the two.

If you are running an http CrushFTP server on port 80, this won't work, as CrushFTP will take all http calls before apache will. Instead, go to your CrushFTP preferences, and change your http server to listen on another port, say, 8080 which is the default (this will be used in the example below). Leave that window open as we will come back to it later.


Leopard

Use BBEdit or TextWrangler to edit the /etc/apache2/http.conf file as follows:

Through BBedit/TextWrangler, simply open the file (shift-command-g in the Finder and type '/etc/apache2' to access the apache2 directory where the http.conf file lies). Scroll down to '#LoadModule proxy_module libexec/httpd/libproxy.so' and remove the '#'. Make sure there is no 'addmodule' directive for the 'proxy_module' as well (there shouldn't be for Leopard); if there is, un-comment it as well.

Now add the following lines after the section about 'Document Root':

ProxyPass /crushftp/ http://127.0.0.1:8080/

ProxyPassReverse /crushftp/ http://127.0.0.1:8080/

What the above means is that the Apache server will forward all calls to 'www.mydomain.com/crushftp/' to the CrushFTP server, and map all answers back through the same URL. Ideally you may want to forward / to the http://127.0.0.1:8080/ URL, and forward a sub directory to another server.

Save the file. Then restart Apache (System Preferences/Sharing - un-click and click "web sharing" in the panel to the left.


Leopard Server:

This is less intuative, as Leopard Server's 'Server Admin' wants to control everything and treats proxies in a slightly different way.

Choose the 'Web' service in Server Admin, and select the website (under 'sites') whose port 80 (or whatever) url you want to forward to CrushFTP. If you have to create a new site, do so, but just keep in mind that the home folder location isn't important for proxying, as it is ignored by the 'proxy server' you are creating.

Go to the "proxy" tab for your selected site, click "enable reverse proxy", then enter the proxy path you want the server to answer to in the field below (for example's sake, here we will use '/crushftp/'). Now you have to add a 'load balancer' server: this function is usually for spreading web traffic seamlessly between several 'worker' servers, but here our second server (CrushFTP) is internal. To add the CrushFTP server, click the '+' button below the window below, and enter 'http://127.0.0.1:8080/' (if you have a CrushFTP server answering at port 8080) in the 'Server URL' field. Enter any four-digit number in the 'route' field (this is just an identifying number for the 'sub-server') and enter '100' in the 'Load Factor' window below it (this will ensure that Apache sends all network traffic to your CrushFTP server). Click ok, then click Save in the main Server Admin window to save changes and re-start Apache.

attachments


Lion Server 10.7 / MT Lion 10.8
10.7 1.) place this 'com.crushftp.plist' attachments(info) file in /etc/apache2/webapps/
10.8 1.) place this 'com.crushftp.plist' attachments(info) file in /Library/Server/Web/Config/apache2/webapps/
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict> 
	<key>name</key>
	<string>com.crushftp</string>
        <key>displayName</key>
        <string>CrushFTP</string>
        <key>installationIndicatorFilePath</key>
        <string>/Applications/CrushFTP8_OSX/CrushFTP8.app/Contents/Resources/Java/apache.conf</string> 
	<key>proxies</key>
	<dict/>
	<key>includeFiles</key>
	<array>
		<string>/Applications/CrushFTP8_OSX/CrushFTP8.app/Contents/Resources/Java/apache.conf</string>
	</array>
	<key>sslPolicy</key>
	<integer>0</integer>
</dict>
</plist>
2.)Issue: sudo webappctl start com.crushftp
3.)Setup a CrushFTP HTTP port 9090, with a reverse proxy path of /crush/
attachments
4.)Use a browser and go to: http://127.0.0.1/crush/

That sub path will now be CrushFTP while everything else on your Lion server remains the same.


Alternate Lion Server 10.7 / MT Lion 10.8
Another way is to edit the conf file in OSX Server for one of your Apache ports / sites.

cd /Library/Server/Web/Config/apache2/sites/

sudo pico 0000_any_443_.conf

Find this line:

        ErrorLog "/var/log/apache2/error_log"
and add after it these lines:
        ProxyPass / http://localhost:9090/
        ProxyPassReverse / http://localhost:9090/
        ProxyPreserveHost On
        ProxyRequests Off

This also needs you to set the prefs for CrushFTP's port 9090 proxy path to be "!/". The ! means opposite protocol, so https to http needs that, and / is just meaning no sub directory.


CrushFTP Preferences:

Now you have to add the proxy information to CrushFTP. Return to your CrushFTP preferences and click the 'advanced' tab to the right of your selected http site: in the 'reverse proxy path' input, enter the name you used above (with both leading and trailing slashes, eg '/crushfp/'), or blank if you chose just a slash above. Click save, and you should be all set. If you go to your browser and type 'http://www.mydomain.com/crushftp/' you should see the CrushFTP login page.

  • Note : '/crushftp/' doesn't have to be an existing folder, it is just a 'key' that will activate the proxy forwarding when it is requested. '/crushftp/' can be any name, even just '/', but it has to be the same in both the Apache http.conf and CrushFTP http site information panel. This name will appear in the webinterface URL, so perhaps choose something suitable for your website, or use just a slash. Since CrushFTP is dealing with so many different actions with uploads, downloads, referring URL's etc., its recommended to use a slash, and put your PHP code at the alternate path.

Add new attachment

Only authorized users are allowed to upload new attachments.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
plist
com.crushftp.plist 0.5 kB 3 09-Oct-2016 18:14 Ben Spink
png
reverse_proxy_9090.png 51.8 kB 1 09-Oct-2016 18:14 Ben Spink
png
serveradmin_proxy.png 60.5 kB 2 09-Oct-2016 18:14 Ben Spink
« This page (revision-14) was last changed on 30-Jan-2017 03:18 by Ben Spink
G’day (anonymous guest)

OLD WIKI!!!#

New: CrushFTPv9#

OLD WIKI!!!#


CrushFTP8 | What's New

Referenced by
HTTP(S)
Reverse Proxy

JSPWiki v2.8.2