Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
9c8b1e17
Commit
9c8b1e17
authored
11 years ago
by
Thomas Müller
Browse files
Options
Downloads
Patches
Plain Diff
adding proper htaccess commands for Apache 2.4
parent
4459d964
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/private/setup.php
+9
-2
9 additions, 2 deletions
lib/private/setup.php
with
9 additions
and
2 deletions
lib/private/setup.php
+
9
−
2
View file @
9c8b1e17
...
@@ -165,8 +165,15 @@ class OC_Setup {
...
@@ -165,8 +165,15 @@ class OC_Setup {
}
}
public
static
function
protectDataDirectory
()
{
public
static
function
protectDataDirectory
()
{
$content
=
"deny from all
\n
"
;
//Require all denied
$content
.
=
"IndexIgnore *"
;
$now
=
date
(
'Y-m-d H:i:s'
);
$content
=
"# Generated by ownCloud on
$now
\n
"
;
$content
.
=
"# line below if for Apache 2.4 - please uncomment if you run Apache 2.4
\n
"
;
$content
.
=
"# Require all denied
\n\n
"
;
$content
.
=
"# line below if for Apache 2.2 - please remove it once you upgrade to Apache 2.4
\n
"
;
$content
.
=
"deny from all
\n\n
"
;
$content
.
=
"# section for Apache 2.2 and 2.4
\n
"
;
$content
.
=
"IndexIgnore *
\n
"
;
file_put_contents
(
OC_Config
::
getValue
(
'datadirectory'
,
OC
::
$SERVERROOT
.
'/data'
)
.
'/.htaccess'
,
$content
);
file_put_contents
(
OC_Config
::
getValue
(
'datadirectory'
,
OC
::
$SERVERROOT
.
'/data'
)
.
'/.htaccess'
,
$content
);
file_put_contents
(
OC_Config
::
getValue
(
'datadirectory'
,
OC
::
$SERVERROOT
.
'/data'
)
.
'/index.html'
,
''
);
file_put_contents
(
OC_Config
::
getValue
(
'datadirectory'
,
OC
::
$SERVERROOT
.
'/data'
)
.
'/index.html'
,
''
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment