Browse Source

add vhost example

hchs 8 năm trước cách đây
mục cha
commit
37ed904f1a

+ 2 - 0
apache2/Dockerfile

@@ -12,6 +12,8 @@ EXPOSE 80 443
 
 WORKDIR /var/www/public
 
+ADD vhost.conf /etc/apache2/sites-enabled/vhost.conf
+
 ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"]
 
 CMD ["supervisord"]

+ 3 - 0
apache2/sites/.gitignore

@@ -0,0 +1,3 @@
+*.conf
+!default.conf
+!default.apache.conf

+ 16 - 0
apache2/sites/default.apache.conf

@@ -0,0 +1,16 @@
+<VirtualHost *:80>
+  ServerName laradock.dev
+  DocumentRoot /var/www/html/
+  Options Indexes FollowSymLinks
+
+  <Directory "/var/www/html/">
+    AllowOverride All
+    <IfVersion < 2.4>
+      Allow from all
+    </IfVersion>
+    <IfVersion >= 2.4>
+      Require all granted
+    </IfVersion>
+  </Directory>
+
+</VirtualHost>

+ 16 - 0
apache2/sites/sample.conf.example

@@ -0,0 +1,16 @@
+<VirtualHost *:80>
+  ServerName sample.dev
+  DocumentRoot /var/www/sample/public/
+  Options Indexes FollowSymLinks
+
+  <Directory "/var/www/sample/public/">
+    AllowOverride All
+    <IfVersion < 2.4>
+      Allow from all
+    </IfVersion>
+    <IfVersion >= 2.4>
+      Require all granted
+    </IfVersion>
+  </Directory>
+
+</VirtualHost>

+ 1 - 0
apache2/vhost.conf

@@ -0,0 +1 @@
+Include /etc/apache2/sites-available/*.conf

+ 1 - 0
docker-compose.yml

@@ -104,6 +104,7 @@ services:
             - applications
         volumes:
             - ./logs/apache2:/var/log/apache2
+            - ./apache2/sites:/etc/apache2/sites-available
         ports:
             - "80:80"
             - "443:443"