Avoid font downloading in Glassfish - apache

We currently have a Glassfish Server 4.0 hosting our webpage, with Apache 2.2 as our Digital Certificate Holder in Ubuntu Server. One of our clients did a Vulnerability testing and discovered that a font (specifically, the glyphicons-halflings-regular.ttf) could be downloaded by using the URL:
http://<URL>/<War>/faces/resources/fonts/glyphicons-halflings-regular.ttf
Is there any way that we can avoid that download and instead redirect that Link to a error page when people try to access any link of that type?
Thanks in advance

Well, the solution I found was this
I opened the Glassfish Console, went to Configurations –> server-config -> virtual servers -> server and then I clicked on the Add Property button
the name was: Redirect1
The code was:
from=/<war>/faces/resources/fonts/glyphicons-halflings-regular.ttf url-prefix=https://<URL>/<war>/
I did it with all of the Cluster and configuration instances of Glassfish Cluster
After a Glassfish and Cluster restart everything was working fine.
Regards!

Related

moodle not working properly after installation

I have installed moodle many times. But this time when i install moodle all steps are completed uptil update profile. (localhost/moodle/user/editadvanced.php id=2) when i enter admin details and update file nothing is displayed. when i try to access moodle module through localhost chrome displays message "web page has a redirect loop".
localhost/moodle/admin/index.php page is not redirected. i have reinstalled Xampp.
in Apache error log i found following
RSA certificate configured for www.example.com:443 does NOT include an
ID which matches the server name
.
i found solution some where to comment include conf/extra/httpd-ssl.conf but it another error is activated in error log
"Sessioncache is not configured"
. Also i have changed port 443 but it didn't work
Find the moodledata folder.
Inside the moodledata
there are many folders
Delete all from Cache
2.Delete all from Session
Restart your browser.
It worked for me.
Hope that works for you.
Thanks for reply. I have found another solution.
While i was accessing a service provided by Linux server i got message that service has been blocked by security settings. I searched and while searching for that problem i found the solution of both.
https://productforums.google.com/forum/#!topic/chrome/DYk8tSV8qM4
go to control panel, programs, click on java, security.
set security to medium.
Java security was set to high which was blocking moodle application.
Delete the cache and the sesson folder data's in the moodle data folder. It will prevent you from redirecting the loop.
It is worked for me.But deleting the whole moodledata folder is not recommended
Just a guess... but if you are using a certificate, have you tried using https in your config.php?
$CFG->wwwroot = 'https://...'

Change docBase for apache tomcat in Netbeans

I have tried changing the docBase (with the help of several tutorials for serving static images from outside WebApp)of the Apache Tomcat installed by Netbeans, but till now no luck for me and getting 404 error.
<Context path="/WebApp/images" docBase="C:\\Users\Digvijay\Pictures\SAB" />
I am using windows.
I am not sure if there is some other way to configure Apache Tomcat installed by netbeans.
By the way below are the links for the solutions I tried
Simplest way to serve static data from outside the application server in a Java web application
Mapping a directory outside the web-app to URL in TOMCAT
Following steps works for me (NetBeans 7.3) ...
Select "Services" tab in NetBeans (top-lefthand box)
Right-click "Servers :: Apache Tomcat " and select "Edit server.xml" item
Put content as described in links and save file
Right-click "Servers :: Apache Tomcat " and select "Restart"

Deploying Saiku UI on Glassfish

When I try to deploy saiku-ui-2.4.war to Glassfish I get
"There is no installed container capable of handling this application
ROOT. Please see server.log for more details."
The server.log shows:
[#|2013-08-16T17:50:36.595-0400|SEVERE|oracle-glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=24;_ThreadName=Thread-2;|There
is no installed container capable of handling this application ROOT|#]
[#|2013-08-16T17:50:36.610-0400|INFO|oracle-glassfish3.1.2|org.glassfish.admingui|_ThreadID=23;_ThreadName=Thread-2;|Exception Occurred :Error occurred during deployment: There is no installed container capable of handling this application ROOT. Please see server.log for more details.|#]
Any idea how to get around this? I searched Saiku's own forum with no luck. I even have a post on there.
Saiku has a prepared package that comes with Tomcat. Saiku UI is deployed as Tomcat ROOT application. This package works fine but I want to try to deploy it on Glassfish.
What's interesting is Saiku has a download saiku-ui-master. This is a separate UI package that needs node.js installed. I've gotten this to work but I want to run it on Glassfish.
Solved it! Added WEB-INF and web.xml then it deployed with no issue!
Actually you need to unpack content of the saiku-ui.war in docroot of your domain as there is static content only.

Netbeans project 404 + apache localhost XAMPP

I've created a web project in Netbeans. When I run it, it starts a glassfish server, and everything works fine (I don't understand why or how, but it works).
I also have XAMPP installed on my mac. I copied my netbeans project folder to my user sites folder, and ran my apache server with XAMPP.
I can access the sites index, but whenever I try to use a servlet, I get a 404, object not found.
Does this have something to do with glassfish web xml file? Servlet Mapping? Is there a new apache web xml file that I must create for it to work on apache server?
I can paste code if you need it.
Thanks!!!
Apache Server is for php based application and for running java based web project you have to install apache tomcat or glassfish as you have done previously where the servlet container is available.

deploying Axis2.war in tomcat 5.5 gets internal server error

I have downloaded the axis2.war file from the apache website.
I put it in the tomcat/webapps folder and it automatically creates a axis2 folder.
I open my web browser and navigate to http://127.0.0.0:8080/axis2/ and get the page that has services, validate and administration.
The problem is that if I click on any of the links a page with the apache logo is shown saying internal server error.
I have tried extracting the axis2.war my self and the file list is the same. the official apache website says that the axis2.war may not have unpacked correctly or it could be missing files. i have tries 1.6 and 1.5 of axis2 and still get the same error.
Can anyone explain what is causing this error and how to fix it ?
Please copy jstl-1.2.jar file in the %CATALINA_HOME%\lib folder. It will definitely solve the problem.
did you check weather tomcat is running.http://127.0.0.0:8080/.
please go through the following link to setup and test axis properly.
http://axis.apache.org/axis2/java/core/docs/userguide-installingtesting.html
turns out that it was the security settings blocking AXIS2
copy jstl-1.2.jar file in the Tomcat-Home\lib Folder, then your Problem Will Solve.
I had the same problem although i was not able to login on the axis2 administration on the localhost (http://localhost:8080/axis2/axis2-admin/) where i also got the "internal server error". After removing the old axis2 (axis2.1.7.5) and deploying an older version (axis2.1.7.0) it was possible for me to login with the default username and password (admin, axis2). It could be that the newer axis2 file was corrupted but i have not reinstalled the newer version yet.