I can configure IDEA to remove trailing spaces. How can I configure it to remove file headers?
Alternatively, what key binding can I use to remove the file header?
Related
I struggle to find a way to disable the trace/track option on one of my RHEL7 servers which is controlled by puppet.
I'm using apache module of puppetlabs.
I want to disable TraceEnable in the httpd.conf file on a single server and not to all servers managed by puppet.
The directive I need to add using puppet is:
TraceEnable Off
I have the YAML file for the server in the location:
/etc/puppetlabs/code/environments/test/data/node/server1.yaml
I can edit this file to apply the config on this server only but I don't know what to put in it.
How to call the HTTP module and how to right the directive in the YAML file?
The reference documentation for the puppetlabs-apache module is available from the Puppet Forge. It would tell you that the main class of that module (apache) has a parameter trace_enable, which controls exactly the httpd configuration property you want to manage:
Controls how Apache handles TRACE requests (per RFC 2616) via the
TraceEnable directive.
Default value: 'On'
Provided that your manifest set is not explicitly specifying a value for that parameter, you should be able to customize it on a per-node basis by setting the apache::trace_enable key in node-specific hiera data. For example, if the node specific data for the node you want to configure is environments/production/data/node/server1.yaml, then in that file, include the line
apache::trace_enable: 'Off'
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
Is there a way to set / replace / merge a header in nginx like its possible in apache?
regarding to this link http://nginx.org/en/docs/http/ngx_http_headers_module.html
it seems, that its only possible to add a header. This brings up some problems, if the header has already been set (e.g. through the php code) and should be replaced / changed to correct values.
For apache one can set / append / merge and add, http://httpd.apache.org/docs/2.2/mod/mod_headers.html
this is kinda basic feature, so it should be possible in nginx somehow, but i cant find out.
Take a look at HttpHeadersMoreModule.
This module allows you to add, set, or clear any output or input header that you specify.
This is an enhanced version of the standard headers module because it provides more utilities like resetting or clearing "builtin headers" like Content-Type, Content-Length, and Server.
It also allows you to specify an optional HTTP status code criteria using the -s option and an optional content type criteria using the -t option while modifying the output headers with the more_set_headers and more_clear_headers directives.
Source: http://wiki.nginx.org/HttpHeadersMoreModule
Actually the Nginx "add_header" directive will not overwrite the header but add the value to it if it exists.
It is not so clear from the docs however: http://nginx.org/en/docs/http/ngx_http_headers_module.html#add_header
But in the HttpHeadersMoreModule docs (https://github.com/openresty/headers-more-nginx-module#more_set_headers) it says:
"If you want to add headers incrementally, use the standard add_header directive instead."
I've tried some different solutions I've found on the web on my .htaccess file (placed in the root of my website), but I always end up with an "Internal Server Error"...
I need a generic rule to remove a specific folder from the URL and the extension of all the files contained in it (adding a trailing slash at the end), with a redirection to the rewrited url. So, for example:
the folder I want to work on is called "pages", so the rule should not affect any other folder, and I want that the url
http://www.example.com/subfolder/pages/
will be rewrited/redirected to
http://www.example.com/subfolder/
and
http://www.example.com/subfolder/pages/page1.php
will be rewrited/redirected to
http://www.example.com/subfolder/page1/
and
http://www.example.com/subfolder/pages/subpages/page1.php
will be rewrited/redirected to
http://www.example.com/subfolder/subpages/page1/
and so on...
How can I achieve that?
This would be more logical in 2 rules:
Remove extension: /subfolder/pages/(.*).[^.]+ -> /subfolder/pages/$1/
Remove pages from URL: /subfolder/pages/(.*) -> /subfolder/$1
Didn't test the rules but this should get you there.
I am looking to host a ".exe" file for our clients to download and i wanted to place it at "www.example.com/file". i have created a .htaccess route from "/file" to the location of the program but when you go there the browser doesnt know what file extension to use.
Is it possible to slip the file extension in there?
The simplest way would be to use .htaccess to forward the browser to the .exe file.
RewriteRule /file /file.exe [R,L]
If you really want to keep it hidden for some reason then you'd have to write a script to output a Content-disposition header:
Content-disposition: attachment; filename=file.exe
You need to set the mimetype, and then, it depends on the browser if it changes the extension or not. Some developers use an iframe with the file, with extenstion, to hide the ugly url.
There is a big change apache already sets the mimetype.
According to this site, the mimetype should be one of the following:
application/octet-stream
application/x-msdownload
application/exe
application/x-exe
application/dos-exe
vms/exe
application/x-winexe
application/msdos-windows
application/x-msdos-program