Skip to content

Commit 37ed904

Browse files
author
hchs
committed
add vhost example
1 parent 94c6240 commit 37ed904

6 files changed

Lines changed: 39 additions & 0 deletions

File tree

apache2/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ EXPOSE 80 443
1212

1313
WORKDIR /var/www/public
1414

15+
ADD vhost.conf /etc/apache2/sites-enabled/vhost.conf
16+
1517
ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"]
1618

1719
CMD ["supervisord"]

apache2/sites/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.conf
2+
!default.conf
3+
!default.apache.conf

apache2/sites/default.apache.conf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<VirtualHost *:80>
2+
ServerName laradock.dev
3+
DocumentRoot /var/www/html/
4+
Options Indexes FollowSymLinks
5+
6+
<Directory "/var/www/html/">
7+
AllowOverride All
8+
<IfVersion < 2.4>
9+
Allow from all
10+
</IfVersion>
11+
<IfVersion >= 2.4>
12+
Require all granted
13+
</IfVersion>
14+
</Directory>
15+
16+
</VirtualHost>

apache2/sites/sample.conf.example

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<VirtualHost *:80>
2+
ServerName sample.dev
3+
DocumentRoot /var/www/sample/public/
4+
Options Indexes FollowSymLinks
5+
6+
<Directory "/var/www/sample/public/">
7+
AllowOverride All
8+
<IfVersion < 2.4>
9+
Allow from all
10+
</IfVersion>
11+
<IfVersion >= 2.4>
12+
Require all granted
13+
</IfVersion>
14+
</Directory>
15+
16+
</VirtualHost>

apache2/vhost.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Include /etc/apache2/sites-available/*.conf

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ services:
104104
- applications
105105
volumes:
106106
- ./logs/apache2:/var/log/apache2
107+
- ./apache2/sites:/etc/apache2/sites-available
107108
ports:
108109
- "80:80"
109110
- "443:443"

0 commit comments

Comments
 (0)