Skip to content

Commit

Permalink
added README. added log4j2. added cleaner code version
Browse files Browse the repository at this point in the history
  • Loading branch information
puddingspudding committed Feb 19, 2017
1 parent 0e330f8 commit f36a0c1
Show file tree
Hide file tree
Showing 20 changed files with 704 additions and 456 deletions.
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 1,58 @@
# nginx Java = nginj

FastCGI implemention in Java with at runtime .java file compilation.


## Dependencies
- openjdk-8-jdk

## Configuration
### NGINX
```
location ~ \.java$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9500;
}
```
---

### NGINJ

```
#
# rootDirectory: directory to look for .java files
#
rootDirectory=/var/www
#
# tmpDir: temporary directory for .class files
#
tmpDirectory=/tmp/nginj
#
# host: address to listen
#
host=127.0.0.1
#
# port: port to listen
#
port=9500
#
# treads: number of threads accepting and handing requests
#
threads=10
```

## Build .deb
```
mvn clean package \
&& mv target/nginj-jar-with-dependencies.jar src/main/deb/usr/lib/nginj/nginj.jar \
&& cd src/main/deb \
&& tar -czf data.tar.gz usr/ var/ etc/ \
&& tar -czf control.tar.gz prerm postinst postrm control conffiles \
&& ar r nginj.deb debian-binary control.tar.gz data.tar.gz \
&& rm data.tar.gz control.tar.gz \
&& cd -
```
43 changes: 40 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 14,53 @@
</properties>
<version>1.0-SNAPSHOT</version>

<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.8</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.8</version>
</dependency>
</dependencies>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>log4j2.xml</include>
</includes>
</resource>
</resources>
<finalName>nginj</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.5</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
<manifest>
<mainClass>io.github.puddingspudding.nginj.Main</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down
25 changes: 17 additions & 8 deletions src/main/java/io/github/puddingspudding/fcgi/package-info.java
Original file line number Diff line number Diff line change
@@ -1,10 1,19 @@
/*
* Copyright 2017 Philip Strecker
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Created by pudding on 26.03.16.
* asd
* asd
* a
* sda
* das
* d
* Classes for FCGI.
*/
package io.github.puddingspudding.fcgi;
package io.github.puddingspudding.fcgi;
251 changes: 0 additions & 251 deletions src/main/java/io/github/puddingspudding/fcgi/server/DefaultServer.java

This file was deleted.

Loading

0 comments on commit f36a0c1

Please sign in to comment.