This is version . It is not the current version, and thus it cannot be edited.
[Back to current version]   [Restore this version]

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>proxies</key><!-- ProxyPass/ProxyPassReverse directives are activated when webapp is started -->
	<dict>
		<key>/mywebapp</key><!-- Sets up a reverse proxy -->
		<dict>
			<key>keysAndValues</key>
			<string></string>
			<key>path</key>
			<string>/crush</string>
			<key>urls</key><!-- URLs comprise a proxy_balancer group -->
			<array>
				<string>http://127.0.0.1:9090</string>
			</array>
		</dict>
	</dict>
	<key>sslPolicy</key><!-- Determines webapp SSL behavior -->
	<integer>0</integer><!-- 0:default, UseSSLWhenEnabled, 1:UseSSLAlways, 2:UseSSLOnlyWhenCertificateIsTrustable, 3:UseSSLNever, 4:UseSSLAndNonSSL -->
</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.


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 particular version was published on 09-Oct-2016 18:14 by Ben Spink.
G’day (anonymous guest)

OLD WIKI!!!#

New: CrushFTPv9#

OLD WIKI!!!#


CrushFTP8 | What's New

Referenced by
HTTP(S)
Reverse Proxy

JSPWiki