Skip to content

Commit

Permalink
fix Apache rules (#2483)
Browse files Browse the repository at this point in the history
  • Loading branch information
enoch85 authored May 2, 2023
1 parent 6772a66 commit 34272bd
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 22 deletions.
22 changes: 17 additions & 5 deletions lets-encrypt/activate-tls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,19 +171,31 @@ then
<Directory $NCPATH>
Options Indexes FollowSymLinks
AllowOverride None
### include all .htaccess
Include $NCPATH/.htaccess
Include $NCPATH/config/.htaccess
Include $NCDATA/.htaccess
###
Require all granted
Satisfy Any
# This is to include all the Nextcloud rules due to that we use PHP-FPM and .htaccess aren't read
Include $NCPATH/.htaccess
</Directory>
# Deny access to your data directory
<Directory $NCDATA>
Require all denied
</Directory>
# Deny access to the Nextcloud config folder
<Directory "$NCPATH"/config/>
Require all denied
</Directory>
<IfModule mod_dav.c>
Dav off
</IfModule>
# The following lines prevent .htaccess and .htpasswd files from being viewed by Web clients.
<Files ".ht*">
Require all denied
</Files>
SetEnv HOME $NCPATH
SetEnv HTTP_HOME $NCPATH
Expand Down
42 changes: 25 additions & 17 deletions nextcloud_install_production.sh
Original file line number Diff line number Diff line change
Expand Up @@ -755,26 +755,27 @@ then
<Directory $NCPATH>
Options Indexes FollowSymLinks
AllowOverride None
### include all .htaccess
Include $NCPATH/.htaccess
Include $NCPATH/config/.htaccess
Include $NCDATA/.htaccess
###
Require all granted
Satisfy Any
# This is to include all the Nextcloud rules due to that we use PHP-FPM and .htaccess aren't read
Include $NCPATH/.htaccess
</Directory>
<IfModule mod_dav.c>
Dav off
</IfModule>
# Deny access to your data directory
<Directory $NCDATA>
Require all denied
</Directory>
<Directory "$NCDATA">
# just in case if .htaccess gets disabled
# Deny access to the Nextcloud config folder
<Directory "$NCPATH"/config/>
Require all denied
</Directory>
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
<IfModule mod_dav.c>
Dav off
</IfModule>
# The following lines prevent .htaccess and .htpasswd files from being viewed by Web clients.
<Files ".ht*">
Require all denied
</Files>
Expand Down Expand Up @@ -848,13 +849,20 @@ then
<Directory $NCPATH>
Options Indexes FollowSymLinks
AllowOverride None
### include all .htaccess
Include $NCPATH/.htaccess
Include $NCPATH/config/.htaccess
Include $NCDATA/.htaccess
###
Require all granted
Satisfy Any
# This is to include all the Nextcloud rules due to that we use PHP-FPM and .htaccess aren't read
Include $NCPATH/.htaccess
</Directory>
# Deny access to your data directory
<Directory $NCDATA>
Require all denied
</Directory>
# Deny access to the Nextcloud config folder
<Directory "$NCPATH"/config/>
Require all denied
</Directory>
<IfModule mod_dav.c>
Expand Down

0 comments on commit 34272bd

Please sign in to comment.