I am new to apache and linux ( 3 months ) and started a home server, I would like to serve my documents in .pdf and .mp4 video of my own solved maths/physics solution via apache 2 residing on the external HDD to anybody.
Everything went okay but by clicking the download link of the website page, Apache just try to play that file and then if one tries to save the file with right click then only 250 bytes are downloaded with complete filename.
The 2 Qs are:
1: I want that the left click will enable the downloading instead of playing.
2: I want to enable the complete download instead of just 250 bits.
I have Ubuntu 14.04 and apache2. The main config. file is apache2.conf in /etc/apache2 folder.
If I put the pdf or mp4 file in the folder /var/www/html/ then the complete file is downloaded without problem but the ubuntu 14.04 installation HDD is just 100 GB and I want to use a esata 2TB external HDD for the serving files. The external HDD is mounted on startup.
The website is one of the few websites I am running as virtual host.
about 250 bytes when opened with gedit shows this message
!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> html> title>404 Not Found /head> h1>Not Found p>The requested URL XYZ(where XYZ is the path of the file on external HDD) was not found on this server.
it is strange as when right click and save from the browser, it shows the complete path of the file and it indeed download the filename and the 250 bytes contains the message as above.
Can someone help me out please? or even point me to the right direction.
The few websites are running from the dir var/www/html without any problem. I just want to enable downloads or you can say uploads. The permission of the external HDD is www-data and the permission of var/www/html/xyz-website.com is also www-data.
Any help is appreciated and if its off topic then plz point me to the right topic.
About the mount point of the external HDD PLZ see my comment below. So how would i mount the external HDD to the subfolder of the var/www/html ? or how would i make the virtual document root? any link is very appreciated. THX
www-data
access the files mounted there?<Directory>
directive, or else mount your external drive directly somewhere into/var/www
and (2) probably define some kind of<Alias>
directive to link certain URLs to this directory (except if you mount your external HDD to a subfolder of/var/www
anyway, that would probably be the easiest solution)