Changing docroots to have the same defaults
Caddy, NGINX and Apache2 should have the same default application paths. The `public/` path suffix is now added in the dotenv file to be able to use Laradock for non-laravel projects as well. Also, updated the documentation.
This commit is contained in:
parent
24d70ad1e3
commit
690137a349
@ -77,14 +77,19 @@ Your folder structure should look like this:
|
|||||||
|
|
||||||
2 - Edit your web server sites configuration.
|
2 - Edit your web server sites configuration.
|
||||||
|
|
||||||
**In case of NGINX:** open `nginx/sites/default.conf` and change the `root` from `/var/www/public` to `/var/www/{my-project-folder-name}/public`.
|
We'll need to do step 1 of the [Usage](#Usage) section now to make this happen.
|
||||||
|
|
||||||
*Or you can keep `default.conf` as it is, and create a separate config `my-site.conf` file for it.*
|
```
|
||||||
|
cp env-example .env
|
||||||
|
```
|
||||||
|
|
||||||
**In case of Apache:** :P
|
At the top, change the `APPLICATION` variable to your project path.
|
||||||
|
|
||||||
<br>
|
```
|
||||||
|
APPLICATION=../project-z/public/
|
||||||
|
```
|
||||||
|
|
||||||
|
Make sure to replace `project-z` with your project folder name.
|
||||||
|
|
||||||
> **Now jump to the [Usage](#Usage) section.**
|
> **Now jump to the [Usage](#Usage) section.**
|
||||||
|
|
||||||
@ -146,7 +151,7 @@ If you are using **Docker Toolbox** (VM), do one of the following:
|
|||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
1 - Enter the laradock folder and rename `env-example` to `.env`
|
1 - Enter the laradock folder and copy `env-example` to `.env`
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
cp env-example .env
|
cp env-example .env
|
||||||
|
@ -165,14 +165,14 @@ Remove 0.0.0.0:80
|
|||||||
|
|
||||||
```
|
```
|
||||||
0.0.0.0:80
|
0.0.0.0:80
|
||||||
root /var/www/public
|
root /var/www
|
||||||
```
|
```
|
||||||
|
|
||||||
and replace with your https://yourdomain.com
|
and replace with your https://yourdomain.com
|
||||||
|
|
||||||
```
|
```
|
||||||
https://yourdomain.com
|
https://yourdomain.com
|
||||||
root /var/www/public
|
root /var/www
|
||||||
```
|
```
|
||||||
|
|
||||||
uncomment tls
|
uncomment tls
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<VirtualHost *:80>
|
<VirtualHost *:80>
|
||||||
ServerName sample.dev
|
ServerName sample.dev
|
||||||
DocumentRoot /var/www/sample/public/
|
DocumentRoot /var/www/sample/
|
||||||
Options Indexes FollowSymLinks
|
Options Indexes FollowSymLinks
|
||||||
|
|
||||||
<Directory "/var/www/sample/public/">
|
<Directory "/var/www/sample/">
|
||||||
AllowOverride All
|
AllowOverride All
|
||||||
<IfVersion < 2.4>
|
<IfVersion < 2.4>
|
||||||
Allow from all
|
Allow from all
|
||||||
|
@ -14,4 +14,4 @@ RUN apt-get remove --purge -y curl && \
|
|||||||
|
|
||||||
EXPOSE 2080
|
EXPOSE 2080
|
||||||
|
|
||||||
CMD bash -c 'BEANSTALK_SERVERS=$BEANSTALKD_PORT_11300_TCP_ADDR:11300 php -S 0.0.0.0:2080 -t /source/public'
|
CMD bash -c 'BEANSTALK_SERVERS=$BEANSTALKD_PORT_11300_TCP_ADDR:11300 php -S 0.0.0.0:2080 -t /source'
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Docs: https://caddyserver.com/docs/caddyfile
|
# Docs: https://caddyserver.com/docs/caddyfile
|
||||||
0.0.0.0:80
|
0.0.0.0:80
|
||||||
root /var/www/public
|
root /var/www
|
||||||
fastcgi / php-fpm:9000 php {
|
fastcgi / php-fpm:9000 php {
|
||||||
index index.php
|
index index.php
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,6 @@ RUN curl --silent --show-error --fail --location \
|
|||||||
|
|
||||||
EXPOSE 80 443 2015
|
EXPOSE 80 443 2015
|
||||||
|
|
||||||
WORKDIR /var/www/public
|
WORKDIR /var/www
|
||||||
|
|
||||||
CMD ["/usr/bin/caddy", "-conf", "/etc/Caddyfile"]
|
CMD ["/usr/bin/caddy", "-conf", "/etc/Caddyfile"]
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
### Application Path
|
### Application Path
|
||||||
# Point to your application code, will be available at `/var/www`.
|
# Point to your application code, will be available at `/var/www`.
|
||||||
|
|
||||||
APPLICATION=../
|
APPLICATION=../public/
|
||||||
|
|
||||||
### Data Path:
|
### Data Path:
|
||||||
# For all storage systems.
|
# For all storage systems.
|
||||||
|
@ -12,7 +12,7 @@ hhvm.log.level = Error
|
|||||||
hhvm.log.header = true
|
hhvm.log.header = true
|
||||||
hhvm.log.access[default][file] = /var/log/hhvm/access.log
|
hhvm.log.access[default][file] = /var/log/hhvm/access.log
|
||||||
hhvm.log.access[default][format] = "%h %l %u %t \"%r\" %>s %b"
|
hhvm.log.access[default][format] = "%h %l %u %t \"%r\" %>s %b"
|
||||||
hhvm.server.source_root=/var/www/public
|
hhvm.server.source_root=/var/www
|
||||||
hhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc
|
hhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc
|
||||||
|
|
||||||
; Uncomment to log to files instead of STDOUT
|
; Uncomment to log to files instead of STDOUT
|
||||||
|
@ -4,7 +4,7 @@ server {
|
|||||||
listen [::]:80 default_server ipv6only=on;
|
listen [::]:80 default_server ipv6only=on;
|
||||||
|
|
||||||
server_name localhost;
|
server_name localhost;
|
||||||
root /var/www/public;
|
root /var/www;
|
||||||
index index.php index.html index.htm;
|
index index.php index.html index.htm;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
@ -15,7 +15,7 @@ server {
|
|||||||
try_files $uri /index.php =404;
|
try_files $uri /index.php =404;
|
||||||
fastcgi_pass php-upstream;
|
fastcgi_pass php-upstream;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
fastcgi_buffers 16 16k;
|
fastcgi_buffers 16 16k;
|
||||||
fastcgi_buffer_size 32k;
|
fastcgi_buffer_size 32k;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
@ -24,7 +24,7 @@ server {
|
|||||||
location ~ /\.ht {
|
location ~ /\.ht {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /.well-known/acme-challenge/ {
|
location /.well-known/acme-challenge/ {
|
||||||
root /var/www/letsencrypt/;
|
root /var/www/letsencrypt/;
|
||||||
log_not_found off;
|
log_not_found off;
|
||||||
|
@ -4,7 +4,7 @@ server {
|
|||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
|
|
||||||
server_name project-1.dev;
|
server_name project-1.dev;
|
||||||
root /var/www/project-1/public;
|
root /var/www/project-1;
|
||||||
index index.php index.html index.htm;
|
index index.php index.html index.htm;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
@ -15,7 +15,7 @@ server {
|
|||||||
try_files $uri /index.php =404;
|
try_files $uri /index.php =404;
|
||||||
fastcgi_pass php-upstream;
|
fastcgi_pass php-upstream;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
fastcgi_buffers 16 16k;
|
fastcgi_buffers 16 16k;
|
||||||
fastcgi_buffer_size 32k;
|
fastcgi_buffer_size 32k;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
@ -24,7 +24,7 @@ server {
|
|||||||
location ~ /\.ht {
|
location ~ /\.ht {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /.well-known/acme-challenge/ {
|
location /.well-known/acme-challenge/ {
|
||||||
root /var/www/letsencrypt/;
|
root /var/www/letsencrypt/;
|
||||||
log_not_found off;
|
log_not_found off;
|
||||||
|
@ -4,7 +4,7 @@ server {
|
|||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
|
|
||||||
server_name project-2.dev;
|
server_name project-2.dev;
|
||||||
root /var/www/project-2/public;
|
root /var/www/project-2;
|
||||||
index index.php index.html index.htm;
|
index index.php index.html index.htm;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
@ -15,7 +15,7 @@ server {
|
|||||||
try_files $uri /index.php =404;
|
try_files $uri /index.php =404;
|
||||||
fastcgi_pass php-upstream;
|
fastcgi_pass php-upstream;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
fastcgi_buffers 16 16k;
|
fastcgi_buffers 16 16k;
|
||||||
fastcgi_buffer_size 32k;
|
fastcgi_buffer_size 32k;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
@ -24,7 +24,7 @@ server {
|
|||||||
location ~ /\.ht {
|
location ~ /\.ht {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /.well-known/acme-challenge/ {
|
location /.well-known/acme-challenge/ {
|
||||||
root /var/www/letsencrypt/;
|
root /var/www/letsencrypt/;
|
||||||
log_not_found off;
|
log_not_found off;
|
||||||
|
Loading…
Reference in New Issue
Block a user