Просмотр исходного кода

Allow the user to manage the apache conf

Johannes Zellner 9 лет назад
Родитель
Сommit
b2c55bb45b
5 измененных файлов с 15 добавлено и 19 удалено
  1. 1 1
      DESCRIPTION.md
  2. 4 2
      Dockerfile
  3. 1 1
      README.md
  4. 2 12
      apache2-app.conf
  5. 7 3
      start.sh

+ 1 - 1
DESCRIPTION.md

@@ -1,6 +1,6 @@
 Empty LAMP Stack.
 
-Use `cloudron push` to copy files into `/app/data/` and `cloudron exec` to get a remote terminal.
+Use `cloudron push` to copy files into `/app/data/public/` and `cloudron exec` to get a remote terminal.
 
 See [here](https://cloudron.io/references/cli.html) for how to get the `cloudron` command line tool.
 

+ 4 - 2
Dockerfile

@@ -10,10 +10,12 @@ RUN sed -e 's,^ErrorLog.*,ErrorLog "|/bin/cat",' -i /etc/apache2/apache2.conf
 RUN sed -e "s,MaxSpareServers[^:].*,MaxSpareServers 5," -i /etc/apache2/mods-available/mpm_prefork.conf
 
 RUN a2disconf other-vhosts-access-log
-ADD apache2-app.conf /etc/apache2/sites-available/app.conf
-RUN ln -sf /etc/apache2/sites-available/app.conf /etc/apache2/sites-enabled/app.conf
 RUN echo "Listen 8000" > /etc/apache2/ports.conf
 
+ADD apache2-app.conf /app/code/apache2-app.conf
+RUN ln -sf /app/data/apache2-app.conf /etc/apache2/sites-available/app.conf
+RUN ln -sf /etc/apache2/sites-available/app.conf /etc/apache2/sites-enabled/app.conf
+
 # configure mod_php
 RUN a2enmod php5
 RUN a2enmod rewrite

+ 1 - 1
README.md

@@ -25,7 +25,7 @@ cloudron install
 
 ## Usage
 
-Use `cloudron push` to copy files into `/app/data/` and `cloudron exec` to get a remote terminal.
+Use `cloudron push` to copy files into `/app/data/public/` and `cloudron exec` to get a remote terminal.
 
 See https://cloudron.io/references/cli.html for how to get the `cloudron` command line tool.
 

+ 2 - 12
apache2-app.conf

@@ -1,10 +1,10 @@
 <VirtualHost *:8000>
-    DocumentRoot /app/data
+    DocumentRoot /app/data/public
 
     ErrorLog "|/bin/cat"
     CustomLog "|/bin/cat" combined
 
-    <Directory /app/data/>
+    <Directory /app/data/public/>
         Options +FollowSymLinks
         AllowOverride All
         Require all granted
@@ -12,15 +12,5 @@
         <IfModule mod_php5.c>
             php_value memory_limit 64m
         </IfModule>
-
-    </Directory>
-
-    # some directories must be protected for wordpress this is not good for the generic app
-   <Directory /app/data/wp-content>
-        DirectoryIndex Off
-        AllowOverride None
-        <IfModule mod_php5.c>
-            php_admin_flag engine off
-        </IfModule>
     </Directory>
 </VirtualHost>

+ 7 - 3
start.sh

@@ -2,10 +2,14 @@
 
 set -eu
 
-mkdir -p /app/data
+mkdir -p /app/data/public
 
-if [ ! -f "/app/data/index.html" ]; then
-	cp /app/code/index.html /app/data/index.html
+if [ ! -f "/app/data/public/index.html" ]; then
+    cp /app/code/index.html /app/data/public/index.html
+fi
+
+if [ ! -f "/app/data/apache2-app.conf" ]; then
+    cp /app/code/apache2-app.conf /app/data/apache2-app.conf
 fi
 
 chown -R www-data:www-data /app/data /run/app