Web Based File Management with PHP and Tiny File Manager
i12bretro
#PHP #ApacheHTTPD #TinyFileManager
Full steps can be found at https://i12bretro.github.io/tutorials/0046.html
In this quick video learn how to setup a web based file manager on an Apache webserver with PHP.
Disclaimer: This is a terrible idea on a publicly accessible server without thoroughly thinking through the security configuration and auditing, but can be a very handy tool for development servers or personal web servers that aren't available outside the local network.
Download and Setup Tiny File Manager
- Download Tiny File Manager https://github.com/prasathmani/tinyfilemanager/releases
- Extract the Tiny File Manager files
- Copy TinyFileManager.php to Apache install directory/htdocs/filemanager
- Rename TinyFileManager.php to index.php
- Edit index.php in a text editor
- Find $use_auth and set the value to false
- Save
- Open a web browser and navigate to https://dnsorip-/filemanager/dnsorip-
Customizing Root Location and Authentication
Optionally, Edit Apache install directory/htdocs/filemanager/index.php
Find $root_path and edit the value to limit the scope of the file manager
Save index.php
Navigate to the Apache install directory/conf in Explorer
Edit httpd.conf in a text editor
Find the authnz_ldap_module and make sure it is enabled by removing the # at the start of the line LoadModuleauthnz_ldap_modulemodules/mod_authnz_ldap.so
Find the ldap_module and make sure it is enabled by removing the # at the start of the line LoadModuleldap_modulemodules/mod_ldap.so
Create a Location block to enable LDAP authentication for the specified directory Location/filemanager- #BasicauthenticationwithLDAPagainstMSAD AuthTypeBasic AuthBasicProviderldap
#AuthLDAPURLspecifiestheLDAPserverIP,port,baseDN,scopeandfilter #usingthisformat:ldap://host:port/basedn?attribute?scope?filter AuthLDAPURL"ldap://i12bretro.local:389/DC=i12bretro,DC=local?sAMAccountName?sub?(objectClass=user)"NONE #TheLDAPbindusernameandpassword AuthLDAPBindDN"readonly_svc@i12bretro.local" AuthLDAPBindPassword"Read0nly!!" LDAPReferralsOff AuthUserFile/dev/null
AuthName"RestrictedArea[i12bretro.local]" #toauthenticateadomaingroup,specifythefullDN AuthLDAPGroupAttributeIsDNon requireldap-groupCN=WebAuthAccess,CN=Users,DC=i12bretro,DC=local /Location-
Save httpd.conf
Restart ... https://www.youtube.com/watch?v=KEX2xenQENc
18958606 Bytes