summaryrefslogtreecommitdiffstats
path: root/Services/apache
diff options
context:
space:
mode:
authorstartxfr <clarue@startx.fr>2015-11-28 15:15:52 +0100
committerstartxfr <clarue@startx.fr>2015-11-28 15:15:52 +0100
commit4bb17b8c05c6e430293217797eef694671ec1e1b (patch)
tree2aec4634843d5ed54a8e71049e4e564f8d33973d /Services/apache
parent151b31b6f47fb3d96afdd66138ff40d92cac6202 (diff)
downloadphpmyadmin-4bb17b8c05c6e430293217797eef694671ec1e1b.tar.gz
phpmyadmin-4bb17b8c05c6e430293217797eef694671ec1e1b.tar.bz2
phpmyadmin-4bb17b8c05c6e430293217797eef694671ec1e1b.tar.xz
phpmyadmin-4bb17b8c05c6e430293217797eef694671ec1e1b.zip
final change in script lib for OS. Change in apache and php services
Diffstat (limited to 'Services/apache')
-rw-r--r--Services/apache/Dockerfile7
-rw-r--r--Services/apache/httpd.conf2
-rw-r--r--Services/apache/run.sh50
-rw-r--r--Services/apache/sx-httpd.sh48
4 files changed, 58 insertions, 49 deletions
diff --git a/Services/apache/Dockerfile b/Services/apache/Dockerfile
index 8db1b4f..72a8ee8 100644
--- a/Services/apache/Dockerfile
+++ b/Services/apache/Dockerfile
@@ -5,8 +5,8 @@ USER root
RUN dnf -y install httpd && \
dnf clean all
COPY httpd.conf /etc/httpd/conf.d/app.conf
-COPY run.sh /bin/
-RUN chmod 775 /bin/run.sh && \
+COPY *.sh /bin/
+RUN chmod 775 /bin/run.sh /bin/sx-httpd.sh && \
chmod ug+r /etc/httpd/conf.d/app.conf && \
rm -f /etc/httpd/conf.d/autoindex.conf && \
rm -f /etc/httpd/conf.d/welcome.conf && \
@@ -14,7 +14,8 @@ RUN chmod 775 /bin/run.sh && \
mkdir /data/www && \
mkdir /data/logs
COPY ./ /data/www
-RUN rm -f /data/www/Dockerfile /data/www/httpd.conf /data/www/run.sh
+RUN rm -f /data/www/Dockerfile /data/www/httpd.conf /data/www/run.sh /data/www/sx-httpd.sh && \
+ chown -R apache:apache /data/www /data/logs
EXPOSE 80
EXPOSE 443
diff --git a/Services/apache/httpd.conf b/Services/apache/httpd.conf
index ef55e71..f612424 100644
--- a/Services/apache/httpd.conf
+++ b/Services/apache/httpd.conf
@@ -1,5 +1,5 @@
#
-# This file will be copied into /etc/httpd/conf.d/sx.conf and loaded when httpd start
+# This file will be copied into /etc/httpd/conf.d/app.conf and loaded when httpd start
#
ServerAdmin cl@startx.fr
ErrorLog "/data/logs/httpd_error.log"
diff --git a/Services/apache/run.sh b/Services/apache/run.sh
index 7e2fb8e..8cb8010 100644
--- a/Services/apache/run.sh
+++ b/Services/apache/run.sh
@@ -1,55 +1,15 @@
#!/bin/bash
-source /bin/sx-lib.sh
export HTTPDCONF=/etc/httpd/conf.d/app.conf
-# Begin configuration before starting daemonized process
-# and start generating host keys
-function begin_config {
- echo "=> BEGIN APACHE CONFIGURATION"
- mkdir -p /var/run/httpd
- if [ -v DOCROOT ]; then
- echo "=> Changing document root to $DOCROOT"
- ${DOCROOT=/data/www}
- echo "DocumentRoot \"$DOCROOT\"" >> $HTTPDCONF
- fi
-}
-
-# End configuration process just before starting daemon
-function end_config {
- stop_server
- echo "=> END APACHE 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 2
-}
-
-# Stop the httpd server running in background.
-function stop_server {
- echo "=> Stopping httpd server ..."
- killall httpd
- rm -rf /run/httpd/*
- sleep 2
-}
-
-# 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 -D FOREGROUND
-}
-
-
+source /bin/sx-lib.sh
+source /bin/sx-httpd.sh
-if [[ "$0" == *"httpd.sh" && ! $1 = "" ]];then
+if [[ "$0" == *"run.sh" && ! $1 = "" ]];then
eval "$@";
fi
-
+check_environment
+check_httpd_environment
display_container_header
begin_config
end_config
diff --git a/Services/apache/sx-httpd.sh b/Services/apache/sx-httpd.sh
new file mode 100644
index 0000000..ad7b995
--- /dev/null
+++ b/Services/apache/sx-httpd.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+function check_httpd_environment {
+ if [ ! -v SERVER_NAME ]; then
+ export SERVER_NAME=$CONTAINER_NAME
+ fi
+}
+
+# Begin configuration before starting daemonized process
+# and start generating host keys
+function begin_config {
+ echo "=> BEGIN APACHE CONFIGURATION"
+ mkdir -p /var/run/httpd
+ if [ -v DOCROOT ]; then
+ echo "=> Changing document root to $DOCROOT"
+ ${DOCROOT=/data/www}
+ echo "DocumentRoot \"$DOCROOT\"" >> $HTTPDCONF
+ fi
+}
+
+# End configuration process just before starting daemon
+function end_config {
+ stop_server
+ echo "=> END APACHE 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 2
+}
+
+# Stop the httpd server running in background.
+function stop_server {
+ echo "=> Stopping httpd server ..."
+ killall httpd
+ rm -rf /run/httpd/*
+ sleep 2
+}
+
+# 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 -D FOREGROUND
+}