Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] JettyMavenHelloWarApp not found when deployed as .war (obscured by FastCGI)

You haven't specified a contextPath on your webapp, so its using the filename.

See this ...

INFO:oejsh.ContextHandler:Scanner-0: Started o.e.j.w.WebAppContext@782f68f1{/hello-world-0.1-SNAPSHOT,file:///tmp/jetty-127.0.0.1-8080-hello-world-0.1-SNAPSHOT.war-_hello-world-0.1-SNAPSHOT-any-5435869185806793118.dir/webapp/,AVAILABLE}{/hello-world-0.1-SNAPSHOT.war}

That tells you the contextPath it chose is "/hello-world-0.1-SNAPSHOT"

So using http://slova.dehttp://slova.de/hello-world-0.1-SNAPSHOT would work.


Joakim Erdfelt / joakim@xxxxxxxxxxx

On Wed, Jun 29, 2016 at 12:03 PM, Alexander Farber <alexander.farber@xxxxxxxxx> wrote:
Good evening,

with the help of this mailing list (thank you) I have followed https://www.eclipse.org/jetty/documentation/9.3.x/configuring-fastcgi.html and successfully deployed several virtual hosts with Wordpress:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">
<Configure class="org.eclipse.jetty.servlet.ServletContextHandler">

    <New id="root" class="java.lang.String">
        <Arg>/var/www/html/slova.de</Arg>
    </New>

    <Set name="contextPath">/</Set>
    <Set name="virtualHosts">
            <Array type="java.lang.String">
                    <Item>slova.de</Item>
                    <Item>www.slova.de</Item>
            </Array>
    </Set>
    <Set name="resourceBase"><Ref refid="root" /></Set>
    <Set name="welcomeFiles">
        <Array type="string">
                <Item>index.html</Item>
                <Item>index.php</Item>
        </Array>
    </Set>

    <Call name="addFilter">
        <Arg>org.eclipse.jetty.fcgi.server.proxy.TryFilesFilter</Arg>
        <Arg>/*</Arg>
        <Arg>
            <Call name="of" class="java.util.EnumSet">
                <Arg><Get name="REQUEST" class="javax.servlet.DispatcherType" /></Arg>
            </Call>
        </Arg>
        <Call name="setInitParameter">
            <Arg>files</Arg>
            <Arg>$path /index.php?p=$path</Arg>
        </Call>
    </Call>
    <Call name="addServlet">
        <Arg>
            <New class="org.eclipse.jetty.servlet.ServletHolder">
                <Arg>default</Arg>
                <Arg>
                    <Call name="forName" class="java.lang.Class">
                        <Arg>org.eclipse.jetty.servlet.DefaultServlet</Arg>
                    </Call>
                </Arg>
                <Call name="setInitParameter">
                    <Arg>dirAllowed</Arg>
                    <Arg>false</Arg>
                </Call>
            </New>
        </Arg>
        <Arg>/</Arg>
    </Call>

    <Call name="addServlet">
        <Arg>org.eclipse.jetty.fcgi.server.proxy.FastCGIProxyServlet</Arg>
        <Arg>*.php</Arg>
        <Call name="setInitParameter">
            <Arg>proxyTo</Arg>
            <Arg>http://localhost:9000</Arg>
        </Call>
        <Call name="setInitParameter">
            <Arg>prefix</Arg>
            <Arg>/</Arg>
        </Call>
        <Call name="setInitParameter">
            <Arg>scriptRoot</Arg>
            <Arg><Ref refid="root" /></Arg>
        </Call>
        <Call name="setInitParameter">
            <Arg>scriptPattern</Arg>
            <Arg>(.+?\\.php)</Arg>
        </Call>
    </Call>

</Configure>

As next step I would like to develop a custom WebSocketServlet with context "/ws" and deploy as a WAR-file at the same Jetty server.

In preparation for that step I have followed https://www.eclipse.org/jetty/documentation/current/maven-and-jetty.html and created JettyMavenHelloWarApp Maven project, which has successfully produced the WAR-file hello-world-0.1-SNAPSHOT.war

When I run it with "mvn jetty:run" on my Macbook it works well and I can browse to http://127.0.0.1:8080/hello

But when I copy the WAR-file into $JETTY_BASE/webapps/ dir on my Linux server I see successful deployment in the Jetty log:

INFO:oejs.Server:main: Started @371ms
INFO:oejw.StandardDescriptorProcessor:Scanner-0: NO JSP Support for /hello-world-0.1-SNAPSHOT, did not find org.eclipse.jetty.jsp.JettyJspServlet
INFO:oejsh.ContextHandler:Scanner-0: Started o.e.j.w.WebAppContext@782f68f1{/hello-world-0.1-SNAPSHOT,file:///tmp/jetty-127.0.0.1-8080-hello-world-0.1-SNAPSHOT.war-_hello-world-0.1-SNAPSHOT-any-5435869185806793118.dir/webapp/,AVAILABLE}{/hello-world-0.1-SNAPSHOT.war}

but when I browse to http://slova.de/hello - it seems to be obscured by the FastCGIProxyServlet and I see a "404 page" of Wordpress.

How could I please change the priority here, so that "/hello" context resolves to the WAR-file?

Thank you
Alex





_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users


Back to the top