Skip to content

Commit 51910d3

Browse files
author
Till Brehm
committed
FS#3490 - Change permissions of folder protection files for nfs
- Changed vhost.conf.master as php-fpm was not working after commit "5a6670bd3c1083f3c6f6652202e7c776745b5eff".
1 parent a4becf1 commit 51910d3

File tree

2 files changed

+26
-12
lines changed

2 files changed

+26
-12
lines changed

server/conf/vhost.conf.master

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,16 @@
225225
# php as cgi enabled
226226
ScriptAlias /php5-cgi <tmpl_var name='cgi_starter_path'><tmpl_var name='cgi_starter_script'>
227227
Action php5-cgi /php5-cgi
228-
<FilesMatch "\.php[345]?$">
229-
SetHandler php5-cgi
230-
</FilesMatch>
228+
<Directory {tmpl_var name='web_document_root_www'}>
229+
<FilesMatch "\.php[345]?$">
230+
SetHandler php5-cgi
231+
</FilesMatch>
232+
</Directory>
233+
<Directory {tmpl_var name='web_document_root'}>
234+
<FilesMatch "\.php[345]?$">
235+
SetHandler php5-cgi
236+
</FilesMatch>
237+
</Directory>
231238
<Directory {tmpl_var name='cgi_starter_path'}>
232239
<tmpl_if name='apache_version' op='>' value='2.2' format='version'>
233240
Require all granted
@@ -308,9 +315,16 @@
308315
Allow from all
309316
</tmpl_if>
310317
</Directory>
311-
<FilesMatch "\.php[345]?$">
312-
SetHandler php5-fcgi
313-
</FilesMatch>
318+
<Directory {tmpl_var name='web_document_root_www'}>
319+
<FilesMatch "\.php[345]?$">
320+
SetHandler php5-fcgi
321+
</FilesMatch>
322+
</Directory>
323+
<Directory {tmpl_var name='web_document_root'}>
324+
<FilesMatch "\.php[345]?$">
325+
SetHandler php5-fcgi
326+
</FilesMatch>
327+
</Directory>
314328
Action php5-fcgi /php5-fcgi
315329
Alias /php5-fcgi {tmpl_var name='document_root'}/cgi-bin/php5-fcgi-{tmpl_var name='ip_address'}-{tmpl_var name='port'}-{tmpl_var name='domain'}
316330
<tmpl_if name='use_tcp'>

server/plugins-available/apache2_plugin.inc.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,7 +1472,7 @@ function update($event_name, $data) {
14721472
if(!is_dir($data['new']['document_root'].'/' . $web_folder . '/stats')) $app->system->mkdir($data['new']['document_root'].'/' . $web_folder . '/stats');
14731473
$ht_file = "AuthType Basic\nAuthName \"Members Only\"\nAuthUserFile ".$data['new']['document_root']."/web/stats/.htpasswd_stats\nrequire valid-user";
14741474
$app->system->file_put_contents($data['new']['document_root'].'/' . $web_folder . '/stats/.htaccess', $ht_file);
1475-
$app->system->chmod($data['new']['document_root'].'/' . $web_folder . '/stats/.htaccess', 0755);
1475+
$app->system->chmod($data['new']['document_root'].'/' . $web_folder . '/stats/.htaccess', 0751);
14761476
unset($ht_file);
14771477
//}
14781478

@@ -1482,7 +1482,7 @@ function update($event_name, $data) {
14821482
$app->system->web_folder_protection($data['new']['document_root'], false);
14831483
$app->system->file_put_contents($data['new']['document_root'].'/web/stats/.htpasswd_stats', $htp_file);
14841484
$app->system->web_folder_protection($data['new']['document_root'], true);
1485-
$app->system->chmod($data['new']['document_root'].'/web/stats/.htpasswd_stats', 0755);
1485+
$app->system->chmod($data['new']['document_root'].'/web/stats/.htpasswd_stats', 0751);
14861486
unset($htp_file);
14871487
}
14881488
}
@@ -2009,7 +2009,7 @@ function web_folder_user($event_name, $data) {
20092009
//* Create empty .htpasswd file, if it does not exist
20102010
if(!is_file($folder_path.'.htpasswd')) {
20112011
$app->system->touch($folder_path.'.htpasswd');
2012-
$app->system->chmod($folder_path.'.htpasswd', 0750);
2012+
$app->system->chmod($folder_path.'.htpasswd', 0751);
20132013
$app->system->chown($folder_path.'.htpasswd', $website['system_user']);
20142014
$app->system->chgrp($folder_path.'.htpasswd', $website['system_group']);
20152015
$app->log('Created file '.$folder_path.'.htpasswd', LOGLEVEL_DEBUG);
@@ -2063,7 +2063,7 @@ function web_folder_user($event_name, $data) {
20632063
unset($old_content);
20642064

20652065
$app->system->file_put_contents($folder_path.'.htaccess', $ht_file);
2066-
$app->system->chmod($folder_path.'.htaccess', 0750);
2066+
$app->system->chmod($folder_path.'.htaccess', 0751);
20672067
$app->system->chown($folder_path.'.htaccess', $website['system_user']);
20682068
$app->system->chgrp($folder_path.'.htaccess', $website['system_group']);
20692069
$app->log('Created/modified file '.$folder_path.'.htaccess', LOGLEVEL_DEBUG);
@@ -2225,15 +2225,15 @@ function web_folder_update($event_name, $data) {
22252225
}
22262226

22272227
$app->system->file_put_contents($new_folder_path.'.htaccess', $ht_file);
2228-
$app->system->chmod($new_folder_path.'.htaccess', 0750);
2228+
$app->system->chmod($new_folder_path.'.htaccess', 0751);
22292229
$app->system->chown($new_folder_path.'.htaccess', $website['system_user']);
22302230
$app->system->chgrp($new_folder_path.'.htaccess', $website['system_group']);
22312231
$app->log('Created/modified file '.$new_folder_path.'.htaccess', LOGLEVEL_DEBUG);
22322232

22332233
//* Create empty .htpasswd file, if it does not exist
22342234
if(!is_file($folder_path.'.htpasswd')) {
22352235
$app->system->touch($new_folder_path.'.htpasswd');
2236-
$app->system->chmod($new_folder_path.'.htpasswd', 0750);
2236+
$app->system->chmod($new_folder_path.'.htpasswd', 0751);
22372237
$app->system->chown($new_folder_path.'.htpasswd', $website['system_user']);
22382238
$app->system->chgrp($new_folder_path.'.htpasswd', $website['system_group']);
22392239
$app->log('Created file '.$new_folder_path.'.htpasswd', LOGLEVEL_DEBUG);

0 commit comments

Comments
 (0)