Content
Does Apache2 Configuration Affect Existing Virtual Hosts?
Added by Robert Ferry about 5 years ago
Hello,
I have installed and would like to configure OpenProject on a server that already hosts a robust set of websites and web applications. We have 6 domains and subdomains operating from within this Ubuntu 18.04 Apache2 environment, running multiple Wordpress sites (MySQL) and one Python-based Django web application (PostgreSQL).
When I got to the configuration wizard I got scared. I'm not familiar enough with what it will be doing behind the scenes when I accept the automatic options for setting up the database and the Apache2 web server. I'd love to just click through the portgres autoinstall and the apache autoinstall options, but I'm afraid of what it might do to my existing set up and I really don't want to break all of my websites.
I have already set up a new subdomain, established A records, and a virtual host file. A "hello world" index.html is up and running (actually just a meta tag redirect for now), and the subdomain is SSL certified with LetsEncrypt.
So my question to the forum is simply should I go ahead and click through the configuration or am I right to be concerned?
If it's the latter, and it is best to hit "skip" on the Apache2 autoinstall, what steps can I take to manually set that up? I follow the path in the instructions for "installing with an existing Apache2," which leads to this github repository: https://github.com/pkgr/addon-apache2/tree/master/conf but I'm not sure what to do with that information and it's all 4 years old, which also give me pause.
Thanks for any assistance!
Replies (7)
Can anyone offer a yes or no answer to the question of whether the auto-configuration wizard will cause an issue with existing Apache2 configurations on the same server? Thanks!
I installed my first OpenProject instance last year, think it was v.8. I don't remember if there was, and I used, an autoinstall wizard. I think I didn't, knowing myself. I cannot tell you if this wizard will cause any issue with the existing confs, but my present configuration runs on Debian 8 + Apache2 and I think you can easily bypass the auto-wizard. Just install a .conf file for your new subdomain. Here's mine:
Remember check your document root path, mine could be different than yours.
Best.
Hi guys,
the packaged installations lacks a mode where it detects an existing apache and will output a configuration that you can enable on your own terms / in your own virtualhost.
Currently you either skip apache setup and do it entirely yourself, or you need to let the wizard configure it for you. It should co-exist with other virtualhosts if you're not letting it run under the main domain but a subdomain e.g. in any case
Best,
Oliver
Thank you Stefano.
I completed the configuration, successfully connected to a unique postgresql database and user. I still haven't figured out how to get OpenProject to run on my subdomain. I'm on Ubuntu 18 so my virtual host file is slightly different. The version below is what I have now. It resolves to a standard index.html sitting in the public web folder of the domain.
It looks based on your example that I need to add a listener on port 443?
Thank you Oliver.
What you are saying is that I could have allowed the wizard to set up Apache2 and it would not have conflicted with any of my other virtual hosts because I'm running it on a subdomain? I thought there was a chance this was the case, but it was too risky to try! Now that I've completed the configuration with everything but the hosting, I'm hoping I can get feedback from the forum community on exactly how my new virtual host file should look. Getting it wrong will cause Apache2 restart to fail and bring down all of our websites.
Thanks again!
You need to configure the ProxyPass directive in your apache conf file, without it the Apache server is simply sending you the index.html file in the DocumentRoot folder.
When the OpenProject server is running, it listens on localhost on port 6000 (unless you change the standard configuration). So you need to tell Apache to "pass" all the requests received for that virtual host to the correct address:port, and this is made by using the ProxyPass directive. So you need to add to your conf file this directives (assuming your OpenProject server is running on the standard localhost:6000):
Note that ProxyRequests is off by default, but there's no harm in setting it off again (better sure than sorry :)
As for the HTTPS question, it depends on what level of security you need. As I'm controlling the server where OpenProject runs, I don't feel the need to use SSL between Apache and OpenProject, so I leave the ProxyPass on http.
On the other hand, all my websites are accessible through HTTPS only, so I redirect all the incoming traffic on port 80 to port 443 (see rewrite rule in the <VirtualHost *:80> ) and then handle the traffic to the OpenProject server in the <VirtualHost *:443> with the ProxyPass directive.
Something like this:
Thanks Stefano!
ProxyPass was exactly what I was looking for! It's working.