Zip file to download on Apache server - apache

Can I configure apache server to render text file as zip file?
If I get file by direct URL I get not compressed file. (.../file.log)
If I get file by URL with parameter I get compressed file.(.../file.log?zip)

Related

Can't upload PDF file with file size of 1MB or higher in odoo-12

Hi I'm having this problem when I am trying to upload a PDF Template, my localhost give me a message "Trying to reconnect" and then quickly followed by "You are back online" after uploading a PDF file, but the file is not uploaded my PDF file size is 1 MB
If you are using Nginx.
Then it can be solved by adding a new line in your nginx.conf file and then restart Nginx.
Set it in HTTP block which affects all server blocks (virtual hosts).
In Ubuntu nginx.conf file can be found here /etc/nginx/nginx.conf
http {
...
client_max_body_size 100M;
}
My issue has been solved in this way.

Make the server ignoring the underscore in file names when requested by URL

Do you think that there is a trick in htaccess to to make the browser download the file my_file_21.pdf if the user access this one with the path http://example.com/files/myfile21.pdf?
And bonus point if the both paths below :
http://example.com/files/myfile21.pdf
http://example.com/files/my_file_21.pdf
works for the file on the server : my_file_21.pdf

How to configure address of WSDL URL in Apache Axis2?

I am using Axis2 and Tomcat8.5. My WSDL URL is : http://localhost:8080/axis2/services/Myapp.
But i want it to configure like this: http://localhost:8080/phase/axis2/services/Myapp.
You just have to rename your WAR file or XML context file. E.g. if your WAR file is named axis2.war change it to phase#axis2.war. If you use XML file axis2.xml, rename accordingly to phase#axis2.xml.
https://tomcat.apache.org/tomcat-8.5-doc/config/context.html#Naming

PDF not opening correctly on web browser for files on remote folder

I'm using a Debian EC2 instance running a Apache2 server (from the open semantic search package).
When I try to open a pdf file in the web browser (inline?), it opens a modified version of it when the file is located on a remote folder but not when the file is located locally.
I saw recommendation (http://www.devside.net/wamp-server/forcing-a-pdf-or-doc-to-open-in-browser-rather-than-downloading) to modify the Apache configuration file to include:
<LocationMatch "\.(?i:pdf)$">
ForceType application/pdf
Header set Content-Disposition inline
</LocationMatch>
I tried adding it to /etc/apache2/apache2.conf
But when I restart the apache server, I get the following error message:
apachectl[16425]: AH00526: Syntax error on line 207 of /etc/apache2/apache2.conf:
apachectl[16425]: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration
My questions are:
Which Apache configuration file should I modify?
Is this modification going to open the pdf file in the web browser inline without downloading / modifying the pdf file when coming from a remote folder?
Thanks!
Yoann
I suspect that it isn't the PDF that is getting corrupted, but the images inside of it.
Some time ago, some server admins were having problems with images getting corrupted by apache2. See for example serverfault and drupalQuestion.
The proposed solution is to change a couple of settings in the apache2 config file. I suspect memory mapping is the issue, which can be turned off by adding the following command to apache2.conf:
EnableMMAP Off
I hope this helps!

Why can't I upload .htaccess file using terminal?

I have a Amazon EC2 server running Apache, I'm trying to enable SSI using .htaccess file, I created the .htaccess file and saved it to my website files folder (not my server), and tried to upload it using scp -i /Users/jeffArries/Desktop/jeffarries.pem /Users/jeffArries/Desktop/Website_Testing_Folder/.htaccess ec2-user#ec2-54-213-219-247.us-west-2.compute.amazonaws.com:/var/www/html in Terminal, and got this error message:
"/Users/jeffArries/Desktop/Website_Testing_Folder/.htaccess: No such file or directory"
How can I upload my .htaccess file to my Apache server using Terminal?
Thanks!
Update:
Update 2:
As can be seen in the output of ls -Abl, the filename is actually .htaccess.txt.
Side note:
Enabling SSI for every .html file is a bad idea performance-wise. THe typical way is to use a special extension (like .shtml), or execute bits on the file (via XBitHack).
On Apache 2.4, the current way is to enable the INCLUDES filter instead of using AddHandler:
AddType text/html .html
AddOutputFilter INCLUDES .html
…
AddHandler server-parsed is still supported for backward compatibility.