forked from AlticeLabsProjects/nginx-log-zmq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
716eb57
commit 6606abb
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
VERSIONS=(1.14.2 1.16.1 1.18.0 1.19.6) | ||
|
||
for VERSION in "${VERSIONS[@]}" | ||
do | ||
|
||
cd utils/ | ||
URL=https://nginx.org/download/nginx-${VERSION}.tar.gz | ||
|
||
whereis wget > /dev/null 2>&1 | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Missing wget" | ||
exit 1 | ||
fi | ||
|
||
wget $URL | ||
rm -rf ../vendor | ||
mkdir -p ../vendor | ||
mv nginx-$VERSION.tar.gz ../vendor/ | ||
cd ../vendor/ | ||
tar -xvzf nginx-$VERSION.tar.gz | ||
cd nginx-$VERSION | ||
./configure --add-module=../.. --prefix=/usr/local/nginx | ||
make && sudo make install | ||
cd ../../ | ||
sudo cp nginx.conf /usr/local/nginx/conf/nginx.conf | ||
|
||
sudo /usr/local/nginx/sbin/nginx -t | ||
|
||
if [ $? -ne 0 ]; then | ||
echo "Problems with version $VERSION" | ||
exit 1 | ||
fi | ||
|
||
sudo rm -rf /usr/local/nginx | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import zmq | ||
|
||
context = zmq.Context() | ||
socket = context.socket(zmq.SUB) | ||
socket.bind("tcp://*:5556") | ||
|
||
socket.subscribe("/topic") | ||
|
||
i = 0 | ||
|
||
while True: | ||
message = socket.recv() | ||
print i, message | ||
i = i + 1 |