contrib/wok.conf.apache | 34 ++++++++++++++++++++++++++++++++++ contrib/wokd.service.systemd | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 contrib/wok.conf.apache
Provide an apache2 virtual host configuration in contrib. With this,
the user can choose to use either nginx or apache as a proxy.
The reason why the configuration has been added to contrib rather
than src/apache2 to mimic the nginx config, is that there is no distro
with the same apache2 config layout than others.
Also add Wants and After for apache2 in the systemd unit file.
Signed-off-by: Cédric Bosdonnat <cbosdonnat@suse.com>
---
contrib/wok.conf.apache | 34 ++++++++++++++++++++++++++++++++++
contrib/wokd.service.systemd | 2 ++
2 files changed, 36 insertions(+)
create mode 100644 contrib/wok.conf.apache
diff --git a/contrib/wok.conf.apache b/contrib/wok.conf.apache
new file mode 100644
index 00000000..c7e650ee
--- /dev/null
+++ b/contrib/wok.conf.apache
@@ -0,0 +1,34 @@
+Listen 8001
+Listen 8000
+
+<VirtualHost *:8001>
+ ErrorLog /var/log/apache2/error_log
+ TransferLog /var/log/apache2/access_log
+
+ Timeout 600
+ LimitRequestBody 4294967296
+
+ SSLEngine on
+ SSLCertificateFile /etc/wok/wok-cert.pem
+ SSLCertificateKeyFile /etc/wok/wok-key.pem
+ SSLOpenSSLConfCmd DHParameters /etc/wok/dhparams.pem
+ SSLSessionCacheTimeout 600
+
+ RewriteEngine On
+ RewriteCond %{HTTP:Upgrade} =websocket [NC]
+ RewriteRule /(.*) ws://localhost:64667/$1 [P,L]
+
+ ProxyPass /websockify http://127.0.0.1:64667/websockify
+ ProxyPassReverse /websockify http://127.0.0.1:64667/websockify
+
+ ProxyPass / http://127.0.0.1:8010/
+ ProxyPassReverse / http://127.0.0.1:8010/
+</VirtualHost>
+
+<VirtualHost *:8000>
+ ErrorLog /var/log/apache2/error_log
+ TransferLog /var/log/apache2/access_log
+
+ RewriteEngine On
+ RewriteRule ^/(.*)$ https://localhost:8001/$1 [R]
+</VirtualHost>
diff --git a/contrib/wokd.service.systemd b/contrib/wokd.service.systemd
index 621be601..eba80a9d 100644
--- a/contrib/wokd.service.systemd
+++ b/contrib/wokd.service.systemd
@@ -3,6 +3,8 @@ Description=Wok - Webserver Originated from Kimchi
Documentation=https://github.com/kimchi-project/wok/wiki
Wants=nginx.service
After=nginx.service
+Wants=apache2.service
+After=apache2.service
[Service]
Type=simple
--
2.12.0
_______________________________________________
Kimchi-devel mailing list
Kimchi-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/kimchi-devel
Ping? any news for this patch? -- Cedric On Wed, 2017-03-22 at 09:17 +0100, Cédric Bosdonnat wrote: > Provide an apache2 virtual host configuration in contrib. With this, > the user can choose to use either nginx or apache as a proxy. > > The reason why the configuration has been added to contrib rather > than src/apache2 to mimic the nginx config, is that there is no distro > with the same apache2 config layout than others. > > Also add Wants and After for apache2 in the systemd unit file. > > Signed-off-by: C?dric Bosdonnat <cbosdonnat at suse.com> > --- > contrib/wok.conf.apache | 34 ++++++++++++++++++++++++++++++++++ > contrib/wokd.service.systemd | 2 ++ > 2 files changed, 36 insertions(+) > create mode 100644 contrib/wok.conf.apache > > diff --git a/contrib/wok.conf.apache b/contrib/wok.conf.apache > new file mode 100644 > index 00000000..c7e650ee > --- /dev/null > +++ b/contrib/wok.conf.apache > @@ -0,0 +1,34 @@ > +Listen 8001 > +Listen 8000 > + > +<VirtualHost *:8001> > + ErrorLog /var/log/apache2/error_log > + TransferLog /var/log/apache2/access_log > + > + Timeout 600 > + LimitRequestBody 4294967296 > + > + SSLEngine on > + SSLCertificateFile /etc/wok/wok-cert.pem > + SSLCertificateKeyFile /etc/wok/wok-key.pem > + SSLOpenSSLConfCmd DHParameters /etc/wok/dhparams.pem > + SSLSessionCacheTimeout 600 > + > + RewriteEngine On > + RewriteCond %{HTTP:Upgrade} =websocket [NC] > + RewriteRule /(.*) ws://localhost:64667/$1 [P,L] > + > + ProxyPass /websockify http://127.0.0.1:64667/websockify > + ProxyPassReverse /websockify http://127.0.0.1:64667/websockify > + > + ProxyPass / http://127.0.0.1:8010/ > + ProxyPassReverse / http://127.0.0.1:8010/ > +</VirtualHost> > + > +<VirtualHost *:8000> > + ErrorLog /var/log/apache2/error_log > + TransferLog /var/log/apache2/access_log > + > + RewriteEngine On > + RewriteRule ^/(.*)$ https://localhost:8001/$1 [R] > +</VirtualHost> > diff --git a/contrib/wokd.service.systemd b/contrib/wokd.service.systemd > index 621be601..eba80a9d 100644 > --- a/contrib/wokd.service.systemd > +++ b/contrib/wokd.service.systemd > @@ -3,6 +3,8 @@ Description=Wok - Webserver Originated from Kimchi > Documentation=https://github.com/kimchi-project/wok/wiki > Wants=nginx.service > After=nginx.service > +Wants=apache2.service > +After=apache2.service > > [Service] > Type=simple _______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel
Hi Cedric, I was focused on 2.4 releases. I will need some time to test it in different distros. I will turn back to you soon. A minor comment below: On 03/31/2017 04:31 AM, Cedric Bosdonnat wrote: > Ping? any news for this patch? > > -- > Cedric > > On Wed, 2017-03-22 at 09:17 +0100, Cédric Bosdonnat wrote: >> Provide an apache2 virtual host configuration in contrib. With this, >> the user can choose to use either nginx or apache as a proxy. >> >> The reason why the configuration has been added to contrib rather >> than src/apache2 to mimic the nginx config, is that there is no distro >> with the same apache2 config layout than others. >> >> Also add Wants and After for apache2 in the systemd unit file. >> >> Signed-off-by: C?dric Bosdonnat <cbosdonnat at suse.com> >> --- >> contrib/wok.conf.apache | 34 ++++++++++++++++++++++++++++++++++ >> contrib/wokd.service.systemd | 2 ++ >> 2 files changed, 36 insertions(+) >> create mode 100644 contrib/wok.conf.apache >> >> diff --git a/contrib/wok.conf.apache b/contrib/wok.conf.apache >> new file mode 100644 >> index 00000000..c7e650ee >> --- /dev/null >> +++ b/contrib/wok.conf.apache >> @@ -0,0 +1,34 @@ >> +Listen 8001 >> +Listen 8000 >> + >> +<VirtualHost *:8001> >> + ErrorLog /var/log/apache2/error_log >> + TransferLog /var/log/apache2/access_log >> + Shouldn't it be better to keep using Wok log location? Just to make debug easier if needed. >> + Timeout 600 >> + LimitRequestBody 4294967296 >> + >> + SSLEngine on >> + SSLCertificateFile /etc/wok/wok-cert.pem >> + SSLCertificateKeyFile /etc/wok/wok-key.pem >> + SSLOpenSSLConfCmd DHParameters /etc/wok/dhparams.pem >> + SSLSessionCacheTimeout 600 >> + >> + RewriteEngine On >> + RewriteCond %{HTTP:Upgrade} =websocket [NC] >> + RewriteRule /(.*) ws://localhost:64667/$1 [P,L] >> + >> + ProxyPass /websockify http://127.0.0.1:64667/websockify >> + ProxyPassReverse /websockify http://127.0.0.1:64667/websockify >> + >> + ProxyPass / http://127.0.0.1:8010/ >> + ProxyPassReverse / http://127.0.0.1:8010/ >> +</VirtualHost> >> + >> +<VirtualHost *:8000> >> + ErrorLog /var/log/apache2/error_log >> + TransferLog /var/log/apache2/access_log >> + >> + RewriteEngine On >> + RewriteRule ^/(.*)$ https://localhost:8001/$1 [R] >> +</VirtualHost> >> diff --git a/contrib/wokd.service.systemd b/contrib/wokd.service.systemd >> index 621be601..eba80a9d 100644 >> --- a/contrib/wokd.service.systemd >> +++ b/contrib/wokd.service.systemd >> @@ -3,6 +3,8 @@ Description=Wok - Webserver Originated from Kimchi >> Documentation=https://github.com/kimchi-project/wok/wiki >> Wants=nginx.service >> After=nginx.service >> +Wants=apache2.service >> +After=apache2.service What happens if apache is not installed on system? Maybe we should not change this file and guide user to do that if he/she is using apache. My intention is also to remove nginx and make any reverse proxy optional. >> >> [Service] >> Type=simple > _______________________________________________ > Kimchi-devel mailing list > Kimchi-devel@ovirt.org > http://lists.ovirt.org/mailman/listinfo/kimchi-devel _______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel
© 2016 - 2024 Red Hat, Inc.