Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
okeanos-LoD
Commits
5241e34c
Commit
5241e34c
authored
Nov 06, 2015
by
Ioannis Tsafaras
Browse files
Merge pull request #207 from makistsantekidis/apache-common-ports
Apache common ports for all services (api, ui, docs, swagger)
parents
5ba37e2b
09782e73
Changes
7
Hide whitespace changes
Inline
Side-by-side
webapp/ansible/roles/service-vm/tasks/apache-install.yml
View file @
5241e34c
...
...
@@ -34,49 +34,26 @@
-
image-configure
-
name
:
Copy Lambda sites-available backend configuration.
template
:
src=lambda-service
-backend
.conf.j2 dest=/etc/apache2/sites-available/lambda-service
-backend
.conf
template
:
src=lambda-service.conf.j2 dest=/etc/apache2/sites-available/lambda-service.conf
notify
:
-
restart_apache2
tags
:
-
image-configure
-
name
:
Copy
lambda
sites-available frontend configuration
.
template
:
src=lambda-service-frontend.conf.j2 dest=/etc/apache2/sites-available/
lambda-service
-frontend
.conf
-
name
:
Add
lambda
-service to sites-enabled
.
command
:
a2ensite
lambda-service.conf
notify
:
-
restart_apache2
tags
:
-
image-configure
-
name
:
Copy lambda sites-available mkdocs configuration.
template
:
src=lambda-service-mkdocs.conf.j2 dest=/etc/apache2/sites-available/lambda-service-mkdocs.conf
notify
:
-
restart_apache2
tags
:
-
image-configure
-
name
:
Add lambda-service-backend to sites-enabled.
command
:
a2ensite lambda-service-backend.conf
notify
:
-
restart_apache2
tags
:
-
image-configure
-
name
:
Add lambda-service-frontend to sites-enabled.
command
:
a2ensite lambda-service-frontend.conf
notify
:
-
restart_apache2
tags
:
-
image-configure
-
name
:
Add lambda-service-mkdocs to sites-enabled.
command
:
a2ensite lambda-service-mkdocs.conf
-
name
:
Disable default apache sites.
command
:
a2dissite {{ item }}
with_items
:
-
000-default.conf
-
default-ssl.conf
notify
:
-
restart_apache2
tags
:
-
image-configure
-
name
:
Remove default sites-enabled.
command
:
a2dissite 000-default.conf
-
restart_apache2
-
name
:
Configure Apache.
lineinfile
:
dest=/etc/apache2/apache2.conf line="WSGIPythonPath {{ repository_download_path }}/okeanos-LoD/webapp" state=present insertafter=EOF
...
...
webapp/ansible/roles/service-vm/templates/lambda-service-backend.conf.j2
deleted
100644 → 0
View file @
5ba37e2b
<
VirtualHost
*:80
>
RewriteEngine
On
RewriteCond
%{HTTPS} !=on
RewriteRule
^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
</
VirtualHost
>
<
VirtualHost
*:443
>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerName
{{ ansible_hostname }}.vm.okeanos.grnet.gr
#ServerAdmin webmaster@localhost
DocumentRoot
{{ repository_download_path }}/okeanos-LoD/webapp/
Alias
/static/ {{ repository_download_path }}/okeanos-LoD/webapp/static/
<
Directory
{{ repository_download_path }}/okeanos-LoD/webapp/static
>
Require
all
granted
</
Directory
>
WSGIScriptAlias / {{ repository_download_path }}/okeanos-LoD/webapp/webapp/wsgi.py
WSGIPassAuthorization
On
Header
always
set
Access-Control-Allow-Origin: "https://{{ ansible_hostname }}.vm.okeanos.grnet.gr:4201"
Header
always
set
Access-Control-Allow-Credentials: true
Header
always
set
Access-Control-Allow-Methods: "GET, POST, DELETE, OPTIONS"
Header
always
set
Access-Control-Allow-Headers "Authorization"
Header
always
add
Access-Control-Allow-Headers "Content-Type"
RewriteEngine
On
RewriteCond
%{REQUEST_METHOD}
OPTIONS
RewriteRule
^(.*)$ $1 [R=200,L]
SSLEngine
ON
SSLCertificateFile
/etc/apache2/ssl/server.crt
SSLCertificateKeyFile
/etc/apache2/ssl/server.key
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog
${APACHE_LOG_DIR}/error.log
CustomLog
${APACHE_LOG_DIR}/access.log combined
#limit request body size to 500MB
LimitRequestBody
524288000
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</
VirtualHost
>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
webapp/ansible/roles/service-vm/templates/lambda-service-frontend.conf.j2
deleted
100644 → 0
View file @
5ba37e2b
Listen 4200
Listen 4201
<VirtualHost *:4200>
ServerName {{ ansible_hostname }}.vm.okeanos.grnet.gr
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}:4201/$1 [R,L]
</VirtualHost>
<VirtualHost *:4201>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerName {{ ansible_hostname }}.vm.okeanos.grnet.gr:4200
#ServerAdmin webmaster@localhost
DocumentRoot {{ repository_download_path }}/okeanos-LoD/webapp/frontend/dist
SSLEngine ON
SSLCertificateFile /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
#limit request body size to 500MB
LimitRequestBody 524288000
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
webapp/ansible/roles/service-vm/templates/lambda-service-mkdocs.conf.j2
deleted
100644 → 0
View file @
5ba37e2b
Listen 8083
Listen 8084
<VirtualHost *:8083>
ServerName {{ ansible_hostname }}.vm.okeanos.grnet.gr
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}:8084/$1 [R,L]
</VirtualHost>
<VirtualHost *:8084>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerName {{ ansible_hostname }}.vm.okeanos.grnet.gr:8083
#ServerAdmin webmaster@localhost
DocumentRoot {{ repository_download_path }}/okeanos-LoD/webapp/api-doc/site
SSLEngine ON
SSLCertificateFile /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
#limit request body size to 500MB
LimitRequestBody 524288000
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
webapp/ansible/roles/service-vm/templates/lambda-service.conf.j2
0 → 100644
View file @
5241e34c
<
VirtualHost
*:80
>
RewriteEngine
On
RewriteCond
%{HTTPS} !=on
RewriteRule
^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
</
VirtualHost
>
<
VirtualHost
*:443
>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
# ServerName www.example.com
ServerName
{{ ansible_hostname }}.vm.okeanos.grnet.gr
RewriteEngine
On
Options
FollowSymLinks
# ServerAdmin webmaster@localhost
DocumentRoot
{{ repository_download_path }}/okeanos-LoD/webapp/
Alias
/static/ {{ repository_download_path }}/okeanos-LoD/webapp/static/
Alias
/docs {{ repository_download_path }}/okeanos-LoD/webapp/api-doc/site
<
Directory
{{ repository_download_path }}/okeanos-LoD/webapp/static
>
Require
all
granted
</
Directory
>
Alias
/api {{ repository_download_path }}/okeanos-LoD/webapp/webapp/django.wsgi/api
WSGIScriptAlias /api {{ repository_download_path }}/okeanos-LoD/webapp/webapp/django.wsgi/api
WSGIPassAuthorization
On
<
Directory
{{ repository_download_path }}/okeanos-LoD/webapp/webapp
>
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization
On
AddHandler
wsgi-script .wsgi
Options
ExecCGI
Order
allow,deny
Allow
from
all
</
Directory
>
Alias
/ {{ repository_download_path }}/okeanos-LoD/webapp/frontend/dist/
<
Directory
/var/www/okeanos-LoD/webapp/frontend/dist/
>
RewriteBase
/
RewriteRule
^index\.html$ - [L]
RewriteCond
%{REQUEST_FILENAME} !-f
RewriteCond
%{REQUEST_FILENAME} !-d
RewriteRule
. /index.html [L]
</
Directory
>
<
Directory
{{ repository_download_path }}/okeanos-LoD/webapp
>
Order
deny,allow
Allow
from
all
</
Directory
>
Header
always
set
Access-Control-Allow-Origin: "https://{{ ansible_hostname }}.vm.okeanos.grnet.gr:4201"
Header
always
set
Access-Control-Allow-Credentials: true
Header
always
set
Access-Control-Allow-Methods: "GET, POST, DELETE, OPTIONS"
Header
always
set
Access-Control-Allow-Headers "Authorization"
Header
always
add
Access-Control-Allow-Headers "Content-Type"
RewriteCond
%{REQUEST_METHOD}
OPTIONS
RewriteRule
^(.*)$ $1 [R=200,L]
SSLEngine
ON
SSLCertificateFile
/etc/apache2/ssl/server.crt
SSLCertificateKeyFile
/etc/apache2/ssl/server.key
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog
${APACHE_LOG_DIR}/error.log
CustomLog
${APACHE_LOG_DIR}/access.log combined
# limit request body size to 500MB
LimitRequestBody
524288000
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
# Include conf-available/serve-cgi-bin.conf
</
VirtualHost
>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
webapp/frontend/public/.htaccess
deleted
100644 → 0
View file @
5ba37e2b
Options
FollowSymLinks
<
IfModule
mod_rewrite.c
>
RewriteEngine
On
RewriteBase
/
RewriteRule
^index\.html$ - [L]
RewriteCond
%{REQUEST_FILENAME} !-f
RewriteCond
%{REQUEST_FILENAME} !-d
RewriteRule
. /index.html [L]
</
IfModule
>
webapp/webapp/wsgi
.py
→
webapp/webapp/
django.
wsgi
View file @
5241e34c
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment