Apache2 make file not downloadable
If the authentication was fine, the user can access the files provided in the directory. The only thing that is VITAL is that the htpasswd file is not accessible to the general public (usually it is not). Step 2: Allowing Indexes. The next step is to tell the Apache web server that Indexing should be allowed for a certain directory. 1. AddType AddType application/octet-stream {file type} Just change the “file type” to the extension of your file excluding the dot. For example if you want to bltadwin.ru files bltadwin.russ will be as followed. Shell. AddType AddType application/octet-stream {txt} 1.
Make the file executable by. chmod +x /var/cgi-bin/bltadwin.ru and run it on the command line: # /var/cgi-bin/bltadwin.ru It should print: Content-type: text/plain hi. This is your first CGI-script in Perl. Now we need to configure the Apache web server to server it properly. Now, it's time to enable it. Apache includes some tools, among which a2ensite can be used to enable our subdomain. To do so, use the following command: a2ensite bltadwin.ru It's time to make Apache reload its configuration files, which now include our new one. Run this command: sudo service apache2 restart. bltadwin.ru: This is the main configuration file for the server. Almost all configuration can be done from within this file, although it is recommended to use separate, designated files for simplicity. This file will configure defaults and be the central point of access for the server to read configuration details.
Probably Apache does not know what to do with the related files .php i assume) and offers them for download instead of display. You can check if the following line exists in your site configuration file: DirectoryIndex bltadwin.ru bltadwin.ru Usually site configurations are stored at /etc/apache2/sites-available and the enabled configurations (those who actually served by the server) are stored at /etc/apache2/sites-enabled. I tried to download the videos with my RealPlayer but I failed and the message returned is "This video clip is not downloadable". I tend to download videos with RealPlayer as it is very intuitive to do so with its pop-up blue-coloured button appear at the top right hand corner of the video. This creates a file in /tmp. When I run this command in interactive php ($ php -a), the file is successfully created. When I start PHP's built-in web-server ($ php -S), and visit a page with the command, the file is also successfully created. Now the problem: in my production setup I have Apache running with the PHP module.
0コメント