summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstartxfr <clarue@startx.fr>2014-12-06 00:27:16 +0100
committerstartxfr <clarue@startx.fr>2014-12-06 00:27:16 +0100
commit49452089e4d3b26d1da96f46b90974f4732d220b (patch)
treeefd33b57091350fbf40659270d3ae1cea19ade3b
parent28d5ddd7f63e587d48a985ca3efa29fbac409947 (diff)
downloadphpmyadmin-49452089e4d3b26d1da96f46b90974f4732d220b.tar.gz
phpmyadmin-49452089e4d3b26d1da96f46b90974f4732d220b.tar.bz2
phpmyadmin-49452089e4d3b26d1da96f46b90974f4732d220b.tar.xz
phpmyadmin-49452089e4d3b26d1da96f46b90974f4732d220b.zip
adding httpd config file when building apache image.
-rw-r--r--Services/apache/Dockerfile7
-rw-r--r--Services/apache/README.md3
-rw-r--r--Services/apache/html/index.html2
-rw-r--r--Services/apache/httpd.conf8
-rw-r--r--Services/apache/sx/httpd.sh3
5 files changed, 18 insertions, 5 deletions
diff --git a/Services/apache/Dockerfile b/Services/apache/Dockerfile
index 316834c..10a6e1f 100644
--- a/Services/apache/Dockerfile
+++ b/Services/apache/Dockerfile
@@ -1,6 +1,7 @@
FROM startx/fedora
MAINTAINER Christophe LARUE <dev@startx.fr>
+USER root
# Install packages and set up httpd
RUN yum -y install httpd \
&& yum clean all \
@@ -8,12 +9,14 @@ RUN yum -y install httpd \
&& mkdir -p /var/log/httpd
# Copy startx toolkit
COPY sx/* /sx/
+COPY httpd.conf /etc/httpd/conf.d/sx.conf
# 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/*
+ && chmod ug+r /var/www/html/* \
+ && chown -R apache:apache /var/www/html /var/log/httpd
EXPOSE 80
EXPOSE 443
+VOLUME ["/var/www/html", "/var/log/httpd"]
CMD ["/sx/httpd_run.sh"] \ No newline at end of file
diff --git a/Services/apache/README.md b/Services/apache/README.md
index 3638549..ae07abb 100644
--- a/Services/apache/README.md
+++ b/Services/apache/README.md
@@ -13,11 +13,12 @@ Copy sources in your docker host
cd startx-docker-images;
git clone https://github.com/startxfr/docker-images.git .
+Change configuration and personalize your base image. you can change file httpd.conf if you want to add some config into http server
+
Build the container
docker build -t sv-apache Services/apache/
-
### Running local image
docker run -d -p 80:80 --name="apache" sv-apache
diff --git a/Services/apache/html/index.html b/Services/apache/html/index.html
index 5025e94..9c72bb2 100644
--- a/Services/apache/html/index.html
+++ b/Services/apache/html/index.html
@@ -49,7 +49,7 @@
<body id="answer">
<header>
<h1><span>STARTX</span> Webserver</h1>
- <h3>Actif</h3>
+ <h3>Online</h3>
</header>
<article>
<header>
diff --git a/Services/apache/httpd.conf b/Services/apache/httpd.conf
new file mode 100644
index 0000000..8eab200
--- /dev/null
+++ b/Services/apache/httpd.conf
@@ -0,0 +1,8 @@
+#
+# This file will be copied into /etc/httpd/conf.d/sx.conf and loaded when httpd start
+#
+ServerAdmin cl@startx.fr
+<Directory "/var/www/html">
+ AllowOverride All
+ DirectoryIndex index.html home.html
+</Directory>
diff --git a/Services/apache/sx/httpd.sh b/Services/apache/sx/httpd.sh
index a632dff..04f08b4 100644
--- a/Services/apache/sx/httpd.sh
+++ b/Services/apache/sx/httpd.sh
@@ -11,6 +11,7 @@ function begin_config {
# End configuration process just before starting daemon
function end_config {
+ stop_server
echo "=> End httpd configuration ..."
}
@@ -34,7 +35,7 @@ function stop_server {
# the running shell
function start_daemon {
echo "=> Starting httpd daemon ..."
- exec /usr/sbin/apachectl
+ exec /usr/sbin/apachectl -D FOREGROUND
}