Archive | Turnkey Linux RSS feed for this section

Allow any file upload WordPress

26 Apr

So today I built a profile management server which is basically wordpress running on the excellent turnkey appliance, to get the .mobileconfig profile payloads uploaded I needed to edit my wp-config php file.

To do this connect via webmin or ftp, browse to your config file and add the following line below 🙂

Allow All File Types

There are two ways to override this. The easy way is adding the following line into your wp-config.php

define('ALLOW_UNFILTERED_UPLOADS', true);

Allow Specific File Types

The other way is to add custom WordPress hook in your themes functions.php file

add_filter('upload_mimes', 'custom_upload_mimes');
function custom_upload_mimes ( $existing_mimes=array() ) {
 // add your extension to the array
 $existing_mimes['deb'] = 'application/x-deb';
 // add as many as you like
 // removing existing file types
 unset( $existing_mimes['exe'] );
 // add as many as you like
 // and return the new full result
 return $existing_mimes;
}

The second method is better because you can restrict only the file types you want, but if you have site where your publishers upload may types of document you can disable the restriction from wp-config.php

Remove Footer from Turnkey Linux Appliance

5 Mar

As much as I like to link back to such a great project sometimes its necessary to remove

 

1. Login to webmin using your root account.

2. Under the Servers tab go into Apache.

3. Click Default server.

4. Under Per-Directory Options click Location /

5. Click Edit Directives.

6. Delete all the stuff in that box. Save and restart apache/ click apply changes.

7. Reload your webpage, you might need to clear your cache.