-
Notifications
You must be signed in to change notification settings - Fork 2
Configuring files upload and securing their viewing
Yannouk edited this page Jul 5, 2012
·
1 revision
This document describes how to set up the file uploads on Seizam MediaWiki, and how to manage their viewing
Edit php.ini file and ensure that file uploads is on
file_uploads = On
If running in safe mode, please refer to PHP documentation to check if their is any restriction on file uploads
If the document root is /var/www , create a new folder inside the folder /var , with a name unguessable (prevent easy finding if the server security is compromised)
mkdir /var/ciz3g26g54qn3
Make it read/writeable for the web server:
chgrp <your_web_server_group> /var/ciz3g26g54qn3
chmod 770 /var/ciz3g26g54qn3
echo 'php_admin_flag engine off' > .htaccess
Make it read only:
chmod 444 .htaccess
- to check permissions for viewing uploaded files,
- to use the newly created folder for storing uploaded files,
- to enable file uploads,
- to allow img_auth.php to access images while the wiki is private.
$wgUploadPath = "$wgScriptPath/img_auth.php";
$wgUploadDirectory = '/var/ciz3g26g54qn3';
$wgEnableUploads = true;
$wgImgAuthPublicTest = false;
$dotPos = strpos( $path, '.' );by
$dotPos = strrpos( $path, '.' );(around line 50)