From 28d5ddd7f63e587d48a985ca3efa29fbac409947 Mon Sep 17 00:00:00 2001
From: startxfr
Date: Fri, 5 Dec 2014 22:33:01 +0100
Subject: modification sur le serveur apache
---
Services/apache/Dockerfile | 17 ++++++-----
Services/apache/README.md | 2 +-
Services/apache/apache_run.sh | 3 --
Services/apache/html/index.html | 68 +++++++++++++++++++++++++++++++++++++++++
Services/apache/sx/httpd.sh | 43 ++++++++++++++++++++++++++
Services/apache/sx/httpd_run.sh | 7 +++++
Services/apache/welcome.html | 11 -------
Services/ssh/README.md | 2 +-
Services/ssh/sx/sshd.sh | 1 -
9 files changed, 130 insertions(+), 24 deletions(-)
delete mode 100644 Services/apache/apache_run.sh
create mode 100644 Services/apache/html/index.html
create mode 100644 Services/apache/sx/httpd.sh
create mode 100644 Services/apache/sx/httpd_run.sh
delete mode 100644 Services/apache/welcome.html
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
-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 @@
+
+
+
+ STARTX Webserver container
+
+
+
+
+
+ STARTX Webserver
+ Actif
+
+
+
+
+ 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.
+
+
+
+
+
\ 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 @@
-
-
-
- STARTX : Fedora + Apache Webserver
-
-
-
-
-
-
-
diff --git a/Services/ssh/README.md b/Services/ssh/README.md
index 4735bec..03d326b 100644
--- a/Services/ssh/README.md
+++ b/Services/ssh/README.md
@@ -28,7 +28,7 @@ access to the running server
access to the container itself
- docker exec -it ssh bash
+ docker exec -it ssh /bin/bash
## Related Resources
* [Sources files](https://github.com/startxfr/docker-images/tree/master/Services/ssh)
diff --git a/Services/ssh/sx/sshd.sh b/Services/ssh/sx/sshd.sh
index 795fff5..937ef1a 100644
--- a/Services/ssh/sx/sshd.sh
+++ b/Services/ssh/sx/sshd.sh
@@ -1,7 +1,6 @@
#!/bin/bash
export TERM=dumb
-export logfile="/var/log/sshd.log"
# Begin configuration before starting daemonized process
# and start generating host keys
--
cgit v1.2.3