I tried to set a FarmOS server on a Linux machine, I can access the site locally with 172.23.0.3, but I don’t know how to put it “online” (I’m currently using that machine to run www.geodatafarm.com). I probably have missed the documentation where this is described, can someone give me a hint?
Regards
Axel
1 Like
Welcome to the forum @Geodatafarm !
Hosting a farmOS instance is the same as hosting a website. There are many ways to do it, but the basic principle is you need to install it on a public-facing server, point a domain name at it, and configure it to accept requests on that domain.
Are you using the farmOS Docker image? Or are you installing it manually using Apache and the packaged tarball from drupal.org/project/farm?
It sounds like you already have a website hosted on the server, so that’s good! It’ll just be a matter of reconfiguring the server to also host farmOS. ![:slight_smile: :slight_smile:](https://emoji.discourse-cdn.com/twitter/slight_smile.png?v=9)
I’m sure you found the “Installing farmOS” docs, which cover basic requirements: Installing - farmOS.org
Beyond that, the specifics will depend on how you need it to co-exist with www.geodatafarm.com. Are you using Apache? Nginx? Something else?
Hi,
Thanks for your reply, Yes I got the FarmOS Docker image to work. I’m running the GeoDatafarm. com as Django project on an Apache2 server.
I tried to add the farmOS to the site-enabled sites.conf like this:
<VirtualHost *:80>
ServerName MyServerName.se
ProxyPreserveHost On
ProxyPass / http://172.24.0.3
ProxyPassReverse / http://172.24.0.1
DocumentRoot /var/dev/farmOS/www/
Than I can access the site, but it looks like this:
Access denied
You are not authorized to access this page.
[Login to farmOS]
And When I try to login I get “Proxy Error”
Is there any guide what to include in the VirtualHost?
1 Like
@Geodatafarm I wonder if you might consider wrapping your Django app in a Docker container itself?
The farmOS Docker image runs its own Apache server, with a simple default virtual host configured to listen on port 80 (probably similar to what you have for Django).
If you had both farmOS and Django in their own separate containers, then it would be fairly easy to set up a third container to serve as a reverse proxy for both. I use Nginx for this purpose, personally, so that’s what I’m familiar with. The other benefit is that Nginx can be responsible for listening on both port 80 and 443, and terminate SSL/HTTPS requests before passing them to the appropriate backend via reverse proxy. The same can be achieved with Apache too.
This guide covers some of the basics for setting up farmOS behind a reverse proxy: Configuring a Local Https Reverse Proxy - farmOS.org - it’s focused on “local” development deployments, but the principles are the same.
Bah, I found the problem.
I had forgot a “/” after the ProxyPass adresses.
It should have been:
ProxyPass / http://172.24.0.3/
ProxyPassReverse / http://172.24.0.3/
Now it works as expected!
3 Likes
Ah glad you figured it out! ![:slight_smile: :slight_smile:](https://emoji.discourse-cdn.com/twitter/slight_smile.png?v=9)