The post introduces how to make file sharing available using apache http server.
File sharing is the practice of distributing or providing access to digital media, such as computer programs, multimedia(audio, images, and video), documents or others.
File sharing may be achieved in a number of ways, such as FTP, NFS, SAMBA, etc. But web-based file sharing is a more convenient and user-friendly way to do so.
Apache is a web server that can do some very complicated things in conjunction with lots of other software but it can also be used on almost any computer to share files with other computers.
Following is the steps of file sharing with apache http server version 2.4.x
1) install apache http server.
# sudo yum install httpd (for centos/fedora)
# sudo pacman -S apache (for archlinux)
2) modify apache http server's httpd.conf file and enable alias_module:
# enable alias_module
LoadModule alias_module modules/mod_alias.so
LoadModule autoindex_module modules/mod_autoindex.so
3) add alias folder to share (within httpd.conf):
for example:
# share folder
Alias /tmp C:/temp
<Directory C:/temp>
IndexOptions FancyIndexing FoldersFirst Charset=UTF-8 NameWidth=*
Options MultiViews Indexes
AllowOverride None
#Deny from 192.168.1.130
#Deny from 10.0.0.0/8
Order allow,deny
Allow from all
#== Controls who can get stuff from this server
Require all granted
</Directory>
# or as this:
<IfModule alias_module>
Alias /BaiduDownload "E:/BaiduYunDownload/"
<Directory "E:/BaiduYunDownload/">
Options Indexes MultiViews
IndexOptions FoldersFirst Charset=UTF-8
AllowOverride None
Require all granted
</Directory>
</IfModule>
# or in file "conf\extra\httpd-autoindex.conf"
#for Aapche 2.4.xx 版本:
Restart the httpd service , and you can access shared files and folder from your web browser.
That is all!