Added fcgi-distribution module to simplify deployment of FastCGI
functionalities in a Jetty "base" directory.
This commit is contained in:
parent
bba639b371
commit
5a38290750
|
@ -0,0 +1,70 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>fcgi-parent</artifactId>
|
||||
<groupId>org.eclipse.jetty.fcgi</groupId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>fcgi-distribution</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>Jetty :: FastCGI :: Distribution</name>
|
||||
|
||||
<properties>
|
||||
<distribution-directory>${project.build.directory}/distribution</distribution-directory>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-jars</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<includeGroupIds>org.eclipse.jetty.fcgi</includeGroupIds>
|
||||
<excludeArtifactIds>fcgi-server</excludeArtifactIds>
|
||||
<includeTypes>jar</includeTypes>
|
||||
<outputDirectory>${distribution-directory}/lib/fcgi</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>assemble</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>assembly</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<finalName>jetty-fcgi-${project.version}</finalName>
|
||||
<descriptors>
|
||||
<descriptor>src/main/assembly/distribution.xml</descriptor>
|
||||
</descriptors>
|
||||
<tarLongFileMode>gnu</tarLongFileMode>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.fcgi</groupId>
|
||||
<artifactId>fcgi-proxy</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,31 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
|
||||
|
||||
<id>distribution</id>
|
||||
|
||||
<formats>
|
||||
<format>tar.gz</format>
|
||||
</formats>
|
||||
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}/src/main/config/modules</directory>
|
||||
<outputDirectory>/modules</outputDirectory>
|
||||
<includes>
|
||||
<include>*.mod</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${distribution-directory}</directory>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<includes>
|
||||
<include>lib/**</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
|
||||
</assembly>
|
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
# FastCGI Module
|
||||
#
|
||||
|
||||
[depend]
|
||||
servlet
|
||||
client
|
||||
|
||||
[lib]
|
||||
lib/jetty-security-${jetty.version}.jar
|
||||
lib/jetty-proxy-${jetty.version}.jar
|
||||
lib/fcgi/*.jar
|
||||
|
||||
[ini-template]
|
||||
## For configuration of FastCGI contexts, see
|
||||
## TODO: documentation url here
|
|
@ -0,0 +1,68 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
|
||||
<Configure class="org.eclipse.jetty.servlet.ServletContextHandler">
|
||||
|
||||
<New id="root" class="java.lang.String">
|
||||
<Arg>/var/www/wordpress-3.7.1</Arg>
|
||||
</New>
|
||||
|
||||
<Set name="contextPath">/wp</Set>
|
||||
<Set name="resourceBase"><Ref refid="root" /></Set>
|
||||
<Set name="welcomeFiles">
|
||||
<Array type="String"><Item>index.php</Item></Array>
|
||||
</Set>
|
||||
|
||||
<Call name="addFilter">
|
||||
<Arg>org.eclipse.jetty.fcgi.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.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>
|
Loading…
Reference in New Issue