.do extension in web pages? - execution

I want to know what is .do extension in web pages. Is it a standard extension, or, if it's not, can we change the extension (like client-login.php to client-login.do and still run as PHP)?
Thanks.

.do comes from the Struts framework. See this question:
Why do Java webapps use .do extension? Where did it come from?
Also you can change what your urls look like using mod_rewrite (on Apache).

".do" is the "standard" extension mapped to for Struts Java platform. See http://struts.apache.org/ .

It is whatever it is configured to be on that particular web server. A web server could be configured to run .pl files with the php module and .aspx files with perl, although that would be silly. There are no scripts involved with most web servers, instead you'd have to look in your apache configuration files (or equivalent, if using different server software). If you have permission to edit the server config file, then you could make files ending in .do run as php, if that's what you're after.

Using apache's rewrite_module can change your script extensions. Give this thread a good read.

Related

Looking for a webserver runnable without compilation on solaris for purely statical content?

I don't know how to turn the question so that it can have a single response. Basically I own a static internet website (pure rest/json/javascript) that I need to be served, and I am looking for an http server where I could just put the files and have it up and working.
I am running on solaris with no administration rights, so I'd rather if it was easy to install with no compilation, so basically I think an http server written in java would perfectly fit.
I think Apache would have been a perfect choice, and it is already installed on solaris, but I don't have the administration privileges I would need to activate it.
Thanks you
Quick and dirty:
Wrap the static website in a WAR archive (I just unpackaged and repackaged the sample.war they provide as a demo for tomcat)
Download a version of tomcat appropriated for the installed version of java and deploy the war into it.
Not very elegant nor performant, but does the job. I am staying with this for the time being.

Minify resource files with IIS, when using Java and .JSP

I was recommended that I move this question from StackOverflow to here.
I am running a web site on a server with Tomcat and IIS. I use .JSP and Java in the back end.
I don't know how to configure IIS to automatically minify resource files (CSS, JavaScript, images) when using .JSP. I have found a few suggested solutions online, but they all apply to IIS and .ASP.
I added the "compression" tag to this post because there is no "minification" tag available, but I am not referring to gzip compression, but removing white spaces, merging resources for faster download etc.
Could anyone help me figure out how to configure IIS to minify resource files with .JSP? Thank you!
Minification a process which combines multiple CSS or JS files to a single file and perform process of compression(whitespace removal) and obfuscation(JS) is an ideal build time solution, rather than a run time solution. While using Tomcat with IIS, it will be good to have some thing like this:
Use WRO4J as a maven build time plugin. Create an attribute like
devmode=true or false. In JSP's have if else condition to define
groups to add multiple CSS/JS or Single based on the devmode value.
While deploying use devmode = false. This with maven configuration will compile JSP with single CSS/JS files.
In IIS, configure a separate VD and map your static resources of war to it. Write a rewrite rule to instruct IIS to serve the static resources. Enable static compression.
The above said configuration will take less load on the CPU.
Some links of interest could be:
https://code.google.com/p/wro4j/wiki/MavenPlugin
Unobtrusive way to combine and compress javascript/css for java/spring/maven applications?

Are absolute paths in a CGI script secure?

I'm creating a new design for a website, and there is an old CGI script, which sends an email to our server.
I can't post the code here because of privacy issues, but the problem will be clear in a second.
This CGI script takes some templates, and then redirects to a "thanks.htm" page. But while doing this, it is using absolute paths.
Now the question: Is it secure to use absolute paths? I mean, is it possible to read out the CGI scripts to get information about the server architecture?
Thanks in advance,
Greetings Thunderhook
You didn't mention which platform or webserver, but regardless, A properly configured web server shouldn't be able to serve readable cgi scripts. I would think that in a secured environment, the cgi-bin directory should live outside of accessible webspace.
IMHO, the problem with using absolute paths isn't a security issue as much as an extensibility issue. If it were my app, I would set an OS environment variable to the document root, then build the absolute path using that variable. Does that provide some added security? Maybe - as your concerns about file structure recon are somewhat mitigated. But it certainly makes it easier to reconfigure the app, or port it to a new server/location.

Import .htaccess rules in IIS using command line

Is it possible to import/convert a mod_rewrite .htaccess file to web.config using the command line (NOT using GUI as described here) and how ?
If it is not directly possible is there any workaround for this ?
It isn't possible to do this from the command line. The importer code is part of the UrlRewrite extension code and only surfaced via the IIS manager UI.
That said, if you have .NET Reflector (or a similar tool - ILSpy) you can inspect the code that performs the mod_rewrite translation.
From my own investigations, the UrlRewrite extension lives inside the following assemblies:
Microsoft.Web.Management.Rewrite
Microsoft.Web.Management.Rewrite.Client
These reside in the GAC and can be opened quite easily for inspection by .NET Reflector.
The classes and methods of interest are:
Microsoft.Web.Management.Iis.Rewrite.Translation.ImportRulesPage.Translate()
which calls:
Microsoft.Web.Management.Iis.Rewrite.Translation.Translator.Translate()
From this information it may be possible to reverse engineer your own command line implementation.

Mod_rewrite-like feature in IIS ( 5/6/7 )?

I'm working on (surprise) a web framework that entirely is dependent on mod_rewrite, however I'd like for it to be compatible with IIS ( if possible ). There's a slight slight chance one of the sites being built will have to be stored on an IIS box, I'm wondering if there's any rewrite module in the most popular versions of IIS I could rely on.
IIS7 is easy--use the URL rewrite module as Garethm points out.
IIS<7 is a bit trickier--no integrated pipeline to latch on to. Presuming you can require that persons hosting on IIS have dedicated hosting, or can at least get an ISAPI module installed, check out iconic's Isapi Rewrite Filter. It is free, open source and pretty much mimic's mod-rewrite.
For IIS7, there is the IIS URL Rewrite Module. If I remember correctly, you can install it with the Web Platform Installer.
There also appears to be a company that has rewritten a rewriting module for IIS that is compatible with Apache's mod_rewrite configuration format. You can find out about it on the Micronovea website. I have no experience with this one though.
I've used HeliconTech's ISAPI_Rewite with great success. It's not free or open source but it's reasonably cheap and well supported, also super-easy to install and get running.
Helicon also have a 'lite' version that is free.

Resources