Oracle ORDS directory browsing wouldn't work - oracle

I am using Oracle ORDS 3.0.9 and try to enable the directory browsing but keep getting HTTP 403 forbidden error. This is my jetty-http.xml configuration in /standalone/etc folder and I run this command to start 'java -jar ords.war &':
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN"
"http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Call name="setInitParameter">
<Arg>org.eclipse.jetty.servlet.Default.dirAllowed</Arg>
<Arg>true</Arg>
</Call>
</Configure>

The setting is disabled for security. If this is needed, my suggestion would be to deploy ORDS into tomcat where there's much more control over the webserver.

Related

How to deploy a FastAPI web app on IIS server?

I have a FastAPI web app that I'm trying to deploy on IIS version 10.0.* on Windows server 2019.
Right now, I can run the application locally with no issues, you can find the repository here:
https://github.com/shaybarak11/Twitter-API
What I'm doing in order to run it locally is running the application via the CMD:
python main.py
And in the main.py file, I have this line of code that start the app:
uvicorn.run("main:app", host="0.0.0.0", port=8000, log_level="info")
So now, I'm trying to deploy this app on IIS.
These are the steps I took so far:
downloaded IIS on the Windows server.
hit add website on IIS Manager page.
added the Physical path of the project directory.
connected as the Administrator.
Went to Handler Mappings and added the python interpreter.
Following the guide of configuring the web.config file for python app,
I get now HTTP error 500.19 - that indicates the problem is with my web.config file.
My web.config file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="PythonHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform processPath="C:\Users\Administrator\AppData\Local\Programs\Python\Python39\python.exe"
arguments="C:\Users\Administrator\Desktop\Twitter-API\main.py"
stdoutLogEnabled="true"
stdoutLogFile="c:\home\LogFiles\python.log"
startupTimeLimit="60"
processesPerApplication="16">
<environmentVariables>
<environmentVariable name="USERNAME" value="root" />
<environmentVariable name="PASSWORD" value="password" />
</environmentVariables>
</httpPlatform>
</system.webServer>
</configuration>
Does someone have any idea what the error is?
Many thanks,
Shay.

Publish and Deploy .NET Core SignalR on IIS

I have a working .NET Core SignalR project locally.
I published the project to a local folder.
I then copied the files to an IIS server.
I get a HTTP Error 401.3 - Unauthorized Error when browsing the service.
I checked the ACL of the folder which contains the library and have given
full access to IIS_USR
The web.config file is somewhat empty
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<directoryBrowse enabled="true" />
</system.webServer>
</configuration>
Any ideas?

Unable to write application logs using externalized Log4j2 XML configuration using Red Hat EAP 7.1.5

I have an application made of Spring Boot WAR packages that need to be migrated to Red Hat EAP 7.1.5.
In my current setup I do the following:
Each WAR has a dedicated log4j2 XML per environment.
This XML file name is defined in the web.xml
The folder containing the log4j2_xxxx.xml is added to the classpath in the JVM startup script.
The WARs are distributed across multiple run-time instances, with a possibility of one run-time hosting more than one WAR.
I would like to replicate the same using EAP. I do see the external log4j2 XML configuration being successfully loaded, however do not see any log statements being written at all.
I am using the following dependencies for packaging log4j2
org.springframework.boot.spring-boot-starter-log4j2 (version 1.5.7)
org.apache.logging.log4j.log4j-web (version 2.10.0)
I have tried the following:
Define a custom module under $JBOSS_HOME/modules/
Add the log4j2 XML in the same folder.
Refer this as global-module in standalone.xml
When I deploy a WAR I can see that the expected log file is created, which means the log4j2 XML configuration is being read successfully. However no logs get written at all in the application log file.
I have tried to get past this by defining a jboss-deployment-structure XML as follows:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<exclusions>
<module name="org.apache.log4j" />
<module name="org.jboss.log4j.logmanager" />
<module name="org.jboss.logging" />
<module name="org.jboss.logging.commons.logging" />
<module name="org.jboss.logging.jul-to-slf4j-stub" />
</exclusions>
<exclude-subsystems>
<subsystem name="logging"/>
</exclude-subsystems>
</deployment>
</jboss-deployment-structure>
This results in the application logging being removed from the default JBOSS log (server.log) altogether but it does not write the logs to the designated log as well.
I would expect all the logging being done within the application to be written into the file defined by the external log4j2 XML configuration. Any idea what I am missing?

Jetty Class-loading Issue

I have a Spring Boot Application, which I want to deploy as a war file in jetty 9.0.7.
I am getting spring jar conflict issue,
In jetty start.ini refers to a lib folder with lower version of spring jar for another project,which cant be changed.
But How I can force jetty to ignore those jar & use own WEB-INF/lib jars.
I tried to use in jetty-web.XML but it's not working.
Any other way ?
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/EmiratesIDProxy</Set>
<Set name="parentLoaderPriority">true</Set>
<Call name="prependServerClass">
<Arg>-org.springframework.org.</Arg>
</Call>
</Configure>

jetty load multiple context

We have an maven+springMVC application that uses maven jetty plugin to start the app up when we do development. We use a jetty-env.xml file to set a context and JNDI config. The application will be part of a bigger portal.
We are using maven jetty plugin
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>7.2.0.v20101020</version>
with config
<webAppConfig>
<contextPath>/ASX/mainApp</contextPath>
<jettyEnvXml>src/main/resources/jetty-env.xml</jettyEnvXml>
</webAppConfig>
and use jetty-env.xml
<Configure id='jms-webapp-wac' class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/ASX/mainApp</Set>
...
...
</Configure>
Our dir structure is:
MainApp
/forms
page1.html
page2.html
etc...
/WEB-INF
web.xml
PortalApp
/BAL_S
/css
/images
/js
etc...
Now the PortalApp only has static files and is not really a web application i.e. it doesn't have web.xml
The application is dependent on javaScripts from the portal. The location of some of the javaScript are like:
<script src="/BAL_S/js/portal-jquery-lib.js"></script>
<script src="/BAL_S/js/libs/foundation.js"></script>
etc...
As you can see that the location starts with /BAL_S which we are finding tricky to get working as it's like referring to another webapp context. When we start the application with jetty we get javaScript errors because it cannot find /BAL_S
If we deploy our app in tomcat and configure it, as below, the application works fine without any javaScript errors.
<Context path="/" docBase="PortalApp"/>
So the question is how can I do the similar configuration in Jetty so when the application starts up it detects /BAL_S context?
I guess we need to have two contexts in Jetty. How do I configure that?
What is the webConfig for maven jetty plugin to refer to this config?
Hope someone can help. Example would be useful.
Thanks in advance.
GM
OK All I had to do was add to maven jetty plugin configuration, the following:
<contextHandlers>
<contextHandler implementation="org.eclipse.jetty.webapp.WebAppContext">
<contextPath>/</contextPath>
<resourceBase>src/main/PortalApp/</resourceBase>
</contextHandler>
</contextHandlers>
So this configures context path '/' to 'src/main/PortalApp/' and now we are able to get to /BAL_S in the tag.

Resources