diff options
author | startxfr <clarue@startx.fr> | 2014-12-05 22:33:01 +0100 |
---|---|---|
committer | startxfr <clarue@startx.fr> | 2014-12-05 22:33:01 +0100 |
commit | 28d5ddd7f63e587d48a985ca3efa29fbac409947 (patch) | |
tree | 32f27f09ed0048f5a8c960409968638c3bcfe7ad /Services/apache | |
parent | 0c46aa05e68dda40eb7f5b6f25b32a0fe32841a9 (diff) | |
download | phpmyadmin-28d5ddd7f63e587d48a985ca3efa29fbac409947.tar.gz phpmyadmin-28d5ddd7f63e587d48a985ca3efa29fbac409947.tar.bz2 phpmyadmin-28d5ddd7f63e587d48a985ca3efa29fbac409947.tar.xz phpmyadmin-28d5ddd7f63e587d48a985ca3efa29fbac409947.zip |
modification sur le serveur apache
Diffstat (limited to 'Services/apache')
-rw-r--r-- | Services/apache/Dockerfile | 17 | ||||
-rw-r--r-- | Services/apache/README.md | 2 | ||||
-rw-r--r-- | Services/apache/apache_run.sh | 3 | ||||
-rw-r--r-- | Services/apache/html/index.html | 68 | ||||
-rw-r--r-- | Services/apache/sx/httpd.sh | 43 | ||||
-rw-r--r-- | Services/apache/sx/httpd_run.sh | 7 | ||||
-rw-r--r-- | Services/apache/welcome.html | 11 |
7 files changed, 129 insertions, 22 deletions
diff --git a/Services/apache/Dockerfile b/Services/apache/Dockerfile index 69c12ad..316834c 100644 --- a/Services/apache/Dockerfile +++ b/Services/apache/Dockerfile @@ -1,16 +1,19 @@ FROM startx/fedora MAINTAINER Christophe LARUE <dev@startx.fr> -COPY apache_run.sh /bin/ +# Install packages and set up httpd RUN yum -y install httpd \ && yum clean all \ && mkdir -p /var/www/html \ - && mkdir -p /var/log/httpd \ - && chmod ug+rx /bin/apache_* -COPY welcome.html /var/www/html/index.html + && mkdir -p /var/log/httpd +# Copy startx toolkit +COPY sx/* /sx/ +# Copy html content +COPY html/* /var/www/html/ +RUN chmod ug+rx /sx/httpd* \ + && chmod ug+r /var/www/html/*\ + && chmod ug+r /var/www/html/* EXPOSE 80 EXPOSE 443 - -CMD ["/bin/apache_run.sh"] -ONBUILD CMD ["/bin/apache_run.sh"]
\ No newline at end of file +CMD ["/sx/httpd_run.sh"]
\ No newline at end of file diff --git a/Services/apache/README.md b/Services/apache/README.md index e15f71e..3638549 100644 --- a/Services/apache/README.md +++ b/Services/apache/README.md @@ -29,7 +29,7 @@ access to the running webserver access to the container itself - docker exec -it apache bash + docker exec -it apache /bin/bash ## Related Resources * [Sources files](https://github.com/startxfr/docker-images/tree/master/Services/apache) diff --git a/Services/apache/apache_run.sh b/Services/apache/apache_run.sh deleted file mode 100644 index 0f876ec..0000000 --- a/Services/apache/apache_run.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -rm -rf /run/httpd/* -exec /usr/sbin/apachectl -D FOREGROUND
\ No newline at end of file diff --git a/Services/apache/html/index.html b/Services/apache/html/index.html new file mode 100644 index 0000000..5025e94 --- /dev/null +++ b/Services/apache/html/index.html @@ -0,0 +1,68 @@ +<!DOCTYPE html> +<html> + <head> + <title>STARTX Webserver container</title> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <style> + body {font-family: Helvetica, Arial, sans-serif;font-size: 14px;color: #333;padding: 0;margin: 0;} + body > header { width: 900px; padding: 1em; margin: 0 auto 1em auto } + body > article {box-shadow: 5px 5px 10px rgba(0,0,0,0.8); padding: 0 0 .5em 0; border-radius: 5px; width: 900px; margin: 2em auto 0 auto } + body > footer { width: 900px; padding: 0em 0 1em 1em; margin: 1.1em auto 1em auto; color: white; font-size: .75em } + h1 { margin: 0; font-size: 3em; line-height: .8em } + h2 { text-shadow: 1px 1px 1px rgba(0,0,0,0.25); font-size: 2.2em;margin: .2em; } + h3 { text-shadow: 1px 1px 0px rgba(255,255,255,1); font-size: 1.5em;margin: .2em; } + h4 { font-size: 1.2em; margin: .2em; } + p { font-size: 1em; margin: .5em .2em; } + ul { + padding-bottom: 1em; + padding-left: 2em; + } + a { + color: white; + text-decoration: none; + } + body > header h1 { color: #000e44; text-shadow: 0 0 3px rgb(255,255,255), 0 0 10px rgba(255,255,255,1), 0 0 20px rgba(255,255,255,0.6); float: left } + body > header h1 span { color: #0c6f5e } + body > header h2 { color: white; font-size: .7em; font-weight: normal; margin: 2.2em 0 0 1em; float: left } + body > header h3 { color: #0c6f5e; margin: 0; font-size: 2em; float: right } + article header { margin: 0;padding: .3em; box-shadow: 0 0 5px rgba(0,0,0,0.9); border-radius: 5px 5px 0 0; width: 892px; } + article h3 { display: inline; } + article > details { margin: 1em; } + + + body#error { background-color : #533;} + #error article { color : darkred; background-color : rgba(255,255,255,0.9); clear: both } + #error article h2 { color : white; text-shadow: 0 0 2px white, 0 0 15px #600, 3px 3px 8px rgba(50,0,0,0.9); } + #error article header { background-color : rgba(85,51,51,0.6); } + #error h3, #error article a { color : #744; } + #error article a:hover { color : #533; } + #error pre.xdebug-var-dump {font-size:0.8em} + + body#answer { background-color : #353 } + #answer article { color : #575;background-color : rgba(255,255,255,0.9); clear: both } + #answer article h2 { color : white; text-shadow: 0 0 2px rgba(11,45,11,0.9), 0 0 10px rgba(11,45,11,0.8); } + #answer article header { background-color : rgba(51,85,51,0.6); } + #answer h3, #answer article a { color : #686; } + #answer article a:hover { color : #353; } + </style> + </head> + <body id="answer"> + <header> + <h1><span>STARTX</span> Webserver</h1> + <h3>Actif</h3> + </header> + <article> + <header> + <h2>Congratulation !!!</h2> + </header> + <p> + You are actually running an apache webserver running under the latest fedora release. For more information about this container and how to add your content instead of this message, please read the following links. + <ul> + <li><a href="https://github.com/startxfr/docker-images/tree/master/Services/apache" target="_blank">See this container Dockerfile</a></li> + <li><a href="https://github.com/startxfr/docker-images" target="_blank">STARTX github docker images repository</a></li> + <li><a href="https://registry.hub.docker.com/u/startx/" target="_blank">STARTX Dockerhub profile</a></li> + </ul> + </p> + </article> + <footer><p>© 2015 - <a href="https://github.com/startxfr" target="_blank">STARTX</a> - <a href="https://www.startx.fr" target="_blank">STARTX Dev Team</a></p></footer> +</body></html>
\ No newline at end of file diff --git a/Services/apache/sx/httpd.sh b/Services/apache/sx/httpd.sh new file mode 100644 index 0000000..a632dff --- /dev/null +++ b/Services/apache/sx/httpd.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +export TERM=dumb + +# Begin configuration before starting daemonized process +# and start generating host keys +function begin_config { + echo "=> Begin httpd configuration for host $HOSTNAME" + mkdir -p /var/run/httpd +} + +# End configuration process just before starting daemon +function end_config { + echo "=> End httpd configuration ..." +} + +# Start the httpd server in background. Used to perform config +# against the database structure such as user creation +function start_server { + echo "===> Starting httpd server ..." + /usr/sbin/apachectl & + sleep 8 +} + +# Stop the httpd server running in background. +function stop_server { + echo "===> Stopping httpd server ..." + killall httpd + rm -rf /run/httpd/* + sleep 8 +} + +# Start the httpd server as a deamon and execute it inside +# the running shell +function start_daemon { + echo "=> Starting httpd daemon ..." + exec /usr/sbin/apachectl +} + + +if [[ "$0" == *"httpd.sh" && ! $1 = "" ]];then + eval "$@"; +fi
\ No newline at end of file diff --git a/Services/apache/sx/httpd_run.sh b/Services/apache/sx/httpd_run.sh new file mode 100644 index 0000000..ef073a3 --- /dev/null +++ b/Services/apache/sx/httpd_run.sh @@ -0,0 +1,7 @@ +#!/bin/bash +source /sx/httpd.sh + +begin_config +end_config + +start_daemon
\ No newline at end of file diff --git a/Services/apache/welcome.html b/Services/apache/welcome.html deleted file mode 100644 index 7009644..0000000 --- a/Services/apache/welcome.html +++ /dev/null @@ -1,11 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <title>STARTX : Fedora + Apache Webserver</title> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - </head> - <body> - <div>See <a href="https://registry.hub.docker.com/u/startx/" target="_blank">STARTX Docker registry</a></div> - </body> -</html> |