#!/bin/sh
path=$(
cd "$(dirname "$0")"
pwd
)
systemctl stop firewalld
echo "install nginx"
yum install nginx gnutls gnutls-devel libev libev-devel -y
echo "start nginx"
if [ -f /run/nginx.pid ]; then
/usr/sbin/nginx -s stop
sleep 2
fi
/usr/sbin/nginx -c /etc/nginx/nginx.conf
echo "install nginx benchmark"
if [ ! -f /usr/bin/httpress ]; then
rm -rf httpress
git clone https://github.com/yarosla/httpress.git
cd httpress && make
cp bin/Release/httpress /usr/bin
fi
echo "update the nginx client"
sed -i "s#sh .*/nginx_benchmark.sh#sh $path/nginx_benchmark.sh#g" $path/nginx_client.yaml
sed -i "s#sh .*/nginx_benchmark.sh#sh $path/nginx_benchmark.sh#g" $path/nginx_http_long_client.yaml