Skip to content

Commit

Permalink
admin adds
Browse files Browse the repository at this point in the history
  • Loading branch information
justb4 committed May 27, 2016
1 parent f7ac079 commit 5827caf
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docker/apache2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,23 @@ RUN export LANGUAGE=en_US.UTF-8 && \
apt-get -y upgrade && \
apt-get install -y openssh-server apache2 supervisor libapache2-mod-wsgi python-flask python-psycopg2 phppgadmin

# DB admin
COPY phppgadmin/phppgadmin.conf /etc/apache2/conf-available
COPY phppgadmin/config.inc.php /etc/phppgadmin

RUN mkdir -p /var/lock/apache2 /var/run/apache2 /var/run/sshd /var/log/supervisor

RUN a2enconf phppgadmin
RUN a2enmod headers
RUN a2enmod wsgi
RUN a2enmod proxy
RUN a2enmod proxy_ajp
RUN a2enmod proxy_http
RUN a2enmod cgi


COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY htpasswd /etc/apache2/.htpasswd

EXPOSE 22 80

Expand Down
10 changes: 10 additions & 0 deletions docker/apache2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ https://github.com/jacksoncage/phppgadmin-docker/blob/master/Dockerfile (PHP and

Docker image runs both Apache2 and SSH daemons.

## Configuring

To use admin features a file "htpasswd" should be created in this directory.
Create by using the command:

htpasswd -c htpasswd <username>

It will ask for a password twice. Obviously the file "htpasswd" should not be in GitHub
but created locally.

## Building

sudo docker build -t geonovum/apache2 .
Expand Down
Empty file.
31 changes: 31 additions & 0 deletions docker/apache2/phppgadmin/phppgadmin.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Alias /adm/phppgadmin /usr/share/phppgadmin

<Directory /usr/share/phppgadmin>

DirectoryIndex index.php
AllowOverride None

order deny,allow
deny from all
# allow from 127.0.0.0/255.0.0.0 ::1/128
allow from all

<IfModule mod_php5.c>
php_flag magic_quotes_gpc Off
php_flag track_vars On
#php_value include_path .
</IfModule>
<IfModule !mod_php5.c>
<IfModule mod_actions.c>
<IfModule mod_cgi.c>
AddType application/x-httpd-php .php
Action application/x-httpd-php /cgi-bin/php
</IfModule>
<IfModule mod_cgid.c>
AddType application/x-httpd-php .php
Action application/x-httpd-php /cgi-bin/php
</IfModule>
</IfModule>
</IfModule>

</Directory>
20 changes: 20 additions & 0 deletions services/web/config/sites-enabled/000-default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,26 @@
# Require all granted
# </LocationMatch>

# <Location /geoserver/web/>
# AuthType Basic
# AuthName "Smartem Admin"
# AuthUserFile /etc/apache2/.htpasswd
# Require valid-user
#
# Order allow,deny
# Allow from all
# </Location>

<Location "/adm">
AuthType Basic
AuthName "Smartem Admin"
AuthUserFile "/etc/apache2/.htpasswd"
Require valid-user

Order allow,deny
Allow from all
</Location>

# %D voor timing in microsecs
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" %D" mpcombined
CustomLog /var/log/apache2/data.smartem-access.log mpcombined
Expand Down
62 changes: 62 additions & 0 deletions services/web/site/adm/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta, title, CSS, favicons, etc. -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description"
content="Bootstrap, a sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.">
<meta name="keywords"
content="HTML, CSS, JS, JavaScript, framework, bootstrap, front-end, frontend, web development">
<meta name="author"
content="Just van den Broecke - Geonovum original: Mark Otto, Jacob Thornton, and Bootstrap contributors">
<link rel="shortcut icon" href="favicon.ico">

<title>Smart Emission - Administration</title>


<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">

<!-- Documentation extras
<link href="css/bootstrap-docs.min.css" rel="stylesheet"> -->

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->

<!-- Favicons
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="shortcut icon" href="../assets/ico/favicon.ico"> -->


</head>
<body>
<div class="container">
<h1>Smart Emission - Administration</h1>
<p> Below links to admin functions.
</p>
<h2>Database</h2>
<ul>
<li><a href="phppgadmin">administer the database</a></li>
</ul>
<h2>Services</h2>
<ul>
<li><a href="/geoserver/web">GeoServer</a></li>
</ul>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>

<!-- Latest compiled and minified JavaScript -->
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<!-- <script src="js/bootstrap-docs.min.js"></script> -->


</body>
</html>

0 comments on commit 5827caf

Please sign in to comment.