🌑

Hi Folks.

ARL源码安装

ARL源码安装

环境要求:

Centos7 2H4G 带宽尽量高

先安装完BT面板,在BT面板中安装好LNMP,或者NGINX即可

正式开始:

修改NGINX配置文件,/www/server/nginx/conf/nginx.conf,添加日志格式支持:

log_format		main	'$remote_addr - $remote_user [$time_local] $request '
					'"$status" $body_bytes_sent "$http_referer" '
					'"$http_user_agent" "$http_x_forwarded_for" "$gzip_ratio"';

同时创建目录以及新建日志文件:

mkdir -p /var/log/nginx

touch /var/log/nginx/arl.access.log

使用这个安装脚本,然后手动下载ARL和ARL-NPoC,放到/opt目录下,记得改名:

ARL:https://github.91chi.fun//https://github.com/TophantTechnology/ARL/archive/refs/heads/master.zip

ARL-NPoC:https://github.91chi.fun//https://github.com/1c3z/ARL-NPoC/archive/refs/heads/master.zip

手动下载ncrack

ncrack: https://raw.githubusercontent.com/1c3z/arl_files/master/ncrack

放到/usr/local/bin目录下

手动下载GeoLite2,同时创建目录,下载之后放到目录中:

mkdir -p /data/GeoLite2

https://raw.githubusercontent.com/1c3z/arl_files/master/GeoLite2-City.mmdb

https://raw.githubusercontent.com/1c3z/arl_files/master/GeoLite2-ASN.mmdb

echo "cd /opt/"

mkdir -p /opt/
cd /opt/

tee /etc/yum.repos.d/mongodb-org-4.0.repo <<"EOF"
[mongodb-org-4.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
EOF

echo "install dependencies ..."
yum install epel-release -y
yum install python36 mongodb-org-server mongodb-org-shell rabbitmq-server python36-devel gcc-c++ git \
 nginx  fontconfig wqy-microhei-fonts -y

if [ ! -f /usr/bin/python36 ]; then
  echo "link python36"
  ln -s /usr/bin/python36 /usr/bin/python3.6
fi

if [ ! -f /usr/local/bin/pip3.6 ]; then
  echo "install  pip3.6"
  python3.6 -m ensurepip --default-pip
  pip3.6 install --upgrade pip
fi

rpm -vhU https://nmap.org/dist/nmap-7.91-1.x86_64.rpm

echo "start services ..."
systemctl enable mongod
systemctl start mongod
systemctl enable rabbitmq-server
systemctl start rabbitmq-server


if [ ! -d ARL ]; then
  echo "git clone ARL proj"
fi

if [ ! -d "ARL-NPoC" ]; then
  echo "git clone ARL-NPoC proj"
fi

cd ARL-NPoC
echo "install poc requirements ..."
pip3.6 install -r requirements.txt
pip3.6 install -e .
cd ../

if [ ! -f /usr/local/bin/ncrack ]; then
  echo "Download ncrack ..."
  chmod +x /usr/local/bin/ncrack
fi

mkdir -p /usr/local/share/ncrack
if [ ! -f /usr/local/share/ncrack/ncrack-services ]; then
  echo "Download ncrack-services ..."
  wget https://github.com/1c3z/arl_files/raw/master/ncrack-services -O /usr/local/share/ncrack/ncrack-services
fi

mkdir -p /data/GeoLite2
if [ ! -f /data/GeoLite2/GeoLite2-ASN.mmdb ]; then
  echo "download GeoLite2-ASN.mmdb ..."
fi

if [ ! -f /data/GeoLite2/GeoLite2-City.mmdb ]; then
  echo "download GeoLite2-City.mmdb ..."
fi

cd ARL

if [ ! -f rabbitmq_user ]; then
  echo "add rabbitmq user"
  rabbitmqctl add_user arl arlpassword
  rabbitmqctl add_vhost arlv2host
  rabbitmqctl set_user_tags arl arltag
  rabbitmqctl set_permissions -p arlv2host arl ".*" ".*" ".*"
  echo "init arl user"
  mongo 127.0.0.1:27017/arl docker/mongo-init.js
  touch rabbitmq_user
fi

echo "install arl requirements ..."
pip3.6 install -r requirements.txt
if [ ! -f app/config.yaml ]; then
  echo "create config.yaml"
  cp app/config.yaml.example  app/config.yaml
fi

if [ ! -f /usr/bin/phantomjs ]; then
  echo "install phantomjs"
  ln -s `pwd`/app/tools/phantomjs  /usr/bin/phantomjs
fi

if [ ! -f /etc/nginx/conf.d/arl.conf ]; then
  echo "copy arl.conf"
  cp misc/arl.conf /www/server/panel/vhost/nginx
fi



if [ ! -f /etc/ssl/certs/dhparam.pem ]; then
  echo "download dhparam.pem"
  curl https://ssl-config.mozilla.org/ffdhe2048.txt > /etc/ssl/certs/dhparam.pem
fi


echo "gen cert ..."
./docker/worker/gen_crt.sh


cd /opt/ARL/


if [ ! -f /etc/systemd/system/arl-web.service ]; then
  echo  "copy arl-web.service"
  cp misc/arl-web.service /etc/systemd/system/
fi

if [ ! -f /etc/systemd/system/arl-worker.service ]; then
  echo  "copy arl-worker.service"
  cp misc/arl-worker.service /etc/systemd/system/
fi

if [ ! -f /etc/systemd/system/arl-scheduler.service ]; then
  echo  "copy arl-scheduler.service"
  cp misc/arl-scheduler.service /etc/systemd/system/
fi

echo "start arl services ..."
systemctl enable arl-web
systemctl start arl-web
systemctl enable arl-worker
systemctl start arl-worker
systemctl enable arl-scheduler
systemctl start arl-scheduler
systemctl enable nginx
systemctl start nginx

systemctl status arl-web
systemctl status arl-worker
systemctl status arl-scheduler

echo "install done"

执行脚本,等待运行结束即可。

欢迎各位大佬批评指正,交流。博客主页有微信二维码。

  • Written in 2022.03.30(7th floor, Information Technology Building)

— Nov 9, 2022

Search

    Made with ❤ and Hexo.js at Earth.