glassfish using virtual directory - glassfish

I'm triing to host some files on my glassfish server.
i found this post explaining how to do this with virtual directories:
http://www.marceble.com/2009/07/virtual-directories-in-glassfish/
but this doesn't work for me
when i surf to: localhost:8080/media/test.txt
i get: HTTP Status 404: The requested resource () is not available.
screenshot of my glassfish controlpanel:
http://i77.photobucket.com/albums/j74/bertyhell/glassfish_error.png

Better is this article.
For GlassFish 3.1.x now it is glassfish-web.xml file inside your application config. If you use something like this:
from=/media/* dir=C:/
or the same inside glassfish-web.xml file:
<property name="alternatedocroot_1" value="from=/media/* dir=C:/"/>
Be sure that you created direcotry on your computer: C:/media
"from" must match directory on your computer.
So then it will be available here:
http://{hostName}:{portNumber}/myapp/media/*

Related

Separate out configuration in apache http server

I have installed Apache Http Server 2.2. I know it is old but need to do some analysis.
I can see there is configuration file name as httpd.conf (found at location InstallDIR\Apache Software Foundation\Apache2.2\conf).
Some places i found they have maintain ssl configuration separate file name as ssl.conf and other configuration in separate file name as local.conf file.
But i can see no such files are present on my conf folder.
Can you please help me here how I can do separation ?
Note: Apache Http Server installed on Windows machine.
Thanks in Advance.

This could be caused by IIS not being setup to handle extensionless static files

The ACME server was probably unable to reach http://mydomain/.well-known/acme-challenge/LLtRq6EdfBLmxyhzlFEqL
kDXBUFLsQbaea6A5kiJxIo
Check in a browser to see if the answer file is being served correctly.
This could be caused by IIS not being setup to handle extensionless static
files. Here's how to fix that:
1. In IIS manager goto Site/Server->Handler Mappings->View Ordered List
2. Move the StaticFile mapping above the ExtensionlessUrlHandler mappings.
(like this http://i.stack.imgur.com/nkvrL.png)
3. If you need to make changes to your web.config file, update the one
at C:\applications\letsencrypt\web_config.xml
Getting this error
While creatng ssl certifcate using letsencrypt
tried
1) If you can't browse to this configcheck file in your web browser (http://{your site}/.well-known/acme-challenge/configcheck then the Lets Encrypt service can't access the files it needs either.
=> configcheck is not getting created
You can edit the web.config file in this folder to get extensionless files working, then you can re-request your certificate. A mimeMap entry for either "." or ".*" usually works depending on your operating system version.
=> Edited web.config tried both "." or ".*"
No success
Can anyone please suggest steps to follow
i am using aws sever windows 2008 R2
If you have redirected your domain name from http to https
in virtual host of apache http.conf file
This will cause this issue
please comment that redirect and try it
Got solved

How disable direct call files on web dirrectory?

My server was built on Apache and Nginx.
There are some directories with js scripts Node on root directory web site.
Via url address i can call direct file such like: domen.com/node/notific.js
How as it can be blocked?
I saw apache tutorial and found that it possible set in apache2.conf, to specify here in the Servername part param index-options, but it acts only on the prohibition directories.
And what you advice check me for more security my directories?
Thanks

Running jsp files from /srv/http using Apache HTTP server and Tomcat

I'd like run jsp files directly from /srv/http without deploying them the Tomcat-way. For example, I want to be able to create symbolic link to my webapp directory (e.g. /home/user/myapp/) in /srv/http and access some app's page through http://localhost/myapp/page.jsp.
Is this possible and how would I set this up?
NOTE: This is not for production. We have to use JSP at university and I want to be able to quickly test my pages.
Open the server.xml of your Tomcat. Assuming if your are using Tomcat 6.x+ then it would be at /tomcatDir/conf/server.xml.
Make an entry with your path
<Context path="/myapp" docBase="yourPathGoesHere" debug="0" reloadable="true" />
Restart Tomcat if already running.
What I did at the moment was creating a symlink in /var/lib/tomcatX/webapps to my project path. This is not the answer I was looking for though, but it is a way to deploy an app without much work.
(X in the above path means your Tomcat version)
If you set <Host name="localhost" appBase="/srv/http"> then all of the directories in it will be deployed as web applications.
If you want /srv/http to be the ROOT application/directory add a file: tomcat/conf/Catalina/localhost/ROOT.xml
with the Context docBase="/srv/http", rather than adding a Context definition to server.xml - this has been strongly discouraged for years.

Is it possible to alias Glassfish requests like in Apache?

I want to redirect requests to /program.fcgi? to the actual location on the filesystem which is /usr/local/.../program.fcgi?. In Apache I can add the following to the configuration file
Alias /program /usr/local/.../program
How do I do the same in Glassfish?
Glassfish lets you include a sun-web.xml in WEB-INF of your web application that allows you to provide alternate docroots
An example entry would look like :
<property name="alternatedocroot_1" value="from=*.jsp dir=path_to_directory"/>
Details here