diff --git a/arm工控机配置文件/README.md b/arm工控机配置文件/README.md new file mode 100644 index 000000000..64ed23a9f --- /dev/null +++ b/arm工控机配置文件/README.md @@ -0,0 +1,29 @@ + +### Nginx配置 +> 端口检查sudo netstat -ap | grep 80 +#### 相关路径 + +安装路径:`/usr/loca/nginx` +配置文件路径: `/usr/local/nginx/conf/nginx.conf` + +### Java配置 +>版本查看 java -version +#### 相关路径 +> jdk1.8 + +安装路径: `/usr/local/java` + +### Redis配置 +> 使用默认配置 +> 端口检查sudo netstat -ap | grep 80 + +### 相关路径 +安装位置:`/usr/local/redis` +启动:systemctl restart redis_6379.service + + +### Mysql配置 +> 数据库密码统一为ylcx888888db* + +#### arm下安装配置教程 +[mysql5.7教程链接](https://www.cnblogs.com/springsnow/p/12206227.html) diff --git a/arm工控机配置文件/nginx/nginx.conf b/arm工控机配置文件/nginx/nginx.conf new file mode 100644 index 000000000..e94993423 --- /dev/null +++ b/arm工控机配置文件/nginx/nginx.conf @@ -0,0 +1,56 @@ + +#user nobody; +worker_processes 1; + +#error_log logs/error.log; +#error_log logs/error.log notice; +#error_log logs/error.log info; + +#pid logs/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include mime.types; + default_type application/octet-stream; + + sendfile on; + #tcp_nopush on; + + #keepalive_timeout 0; + keepalive_timeout 65; + + #gzip on; + + server { + listen 8080; + server_name 192.168.1.102; + + location / { + root /home/jetson/polaris/sip/static; + index index.html index.htm; + } + location /record_proxy/{ + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header REMOTE-HOST $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_pass http://192.168.1.102:18081/; + } + location /api/ { + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header REMOTE-HOST $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_pass http://192.168.1.102:18978; + } + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root html; + } + } +} diff --git a/arm工控机配置文件/nginx/nginx.service b/arm工控机配置文件/nginx/nginx.service new file mode 100644 index 000000000..78993a863 --- /dev/null +++ b/arm工控机配置文件/nginx/nginx.service @@ -0,0 +1,15 @@ +[Unit] +Description=nginx web service +Documentation=http://nginx.org/en/docs/ +After=network.target + +[Service] +Type=forking +ExecStartPre=/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf +ExecStart=/usr/local/nginx/sbin/nginx +ExecReload=/usr/local/nginx/sbin/nginx -s reload +ExecStop=/usr/local/nginx/sbin/nginx -s stop +PrivateTmp=true + +[Install] +WantedBy=default.targe \ No newline at end of file diff --git a/arm工控机配置文件/rc.local b/arm工控机配置文件/rc.local new file mode 100644 index 000000000..7c2540605 --- /dev/null +++ b/arm工控机配置文件/rc.local @@ -0,0 +1,7 @@ +#!/bin/sh -e + +/bin/bash /home/jetson/polaris/sip/sip.sh start +/bin/bash /home/jetson/polaris/sip/zlm.sh start + +exit 0 +~ \ No newline at end of file diff --git a/arm工控机配置文件/sip/sip.sh b/arm工控机配置文件/sip/sip.sh new file mode 100644 index 000000000..67b0a280d --- /dev/null +++ b/arm工控机配置文件/sip/sip.sh @@ -0,0 +1,96 @@ +#!/bin/bash + +###################################################### +# Copyright 2019 Pham Ngoc Hoai +# +# 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. +# +# Repo: https://github.com/tyrion9/spring-boot-startup-script +# +######### PARAM ###################################### + +JAVA_OPT=-Xmx1024m +JARFILE=`cd /home/jetson/polaris/sip/ && ls -1r *.jar 2>/dev/null | head -n 1` +PID_FILE=/home/jetson/polaris/sip/pid.file +RUNNING=N +PWD=`pwd` + +######### DO NOT MODIFY ######## + +if [ -f $PID_FILE ]; then + PID=`cat $PID_FILE` + if [ ! -z "$PID" ] && kill -0 $PID 2>/dev/null; then + RUNNING=Y + fi +fi + +start() +{ + if [ $RUNNING == "Y" ]; then + echo "Application already started" + else + cd /home/jetson/polaris/sip/ + + if [ -z "$JARFILE" ] + then + echo "ERROR: jar file not found" + else + nohup /usr/local/java/jdk1.8.0_411/bin/java $JAVA_OPT -Djava.security.egd=file:/dev/./urandom -jar /home/jetson/polaris/sip/$JARFILE > nohup.out 2>&1 & + echo $! > $PID_FILE + echo "Application $JARFILE starting..." + fi + fi +} + +stop() +{ + cd /home/jetson/polaris/sip/ + + if [ $RUNNING == "Y" ]; then + kill -9 $PID + rm -f $PID_FILE + echo "Application stopped" + else + echo "Application not running" + fi +} + +restart() +{ + stop + start +} + +case "$1" in + + 'start') + start + ;; + + 'stop') + stop + ;; + + 'restart') + restart + ;; + + *) + echo "Usage: $0 { start | stop | restart }" + exit 1 + ;; +esac +exit 0 + + + diff --git a/arm工控机配置文件/sip/zlm.sh b/arm工控机配置文件/sip/zlm.sh new file mode 100644 index 000000000..c5065ae30 --- /dev/null +++ b/arm工控机配置文件/sip/zlm.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +function start() +{ + echo "Start ZLMediaKit ..." + nohup /root/ZLMediaKit/release/linux/Debug/MediaServer -d & + sleep 3 + exit + +} + +function stop() +{ + echo "Stop ZLMediaKit ..." + killall -2 MediaServer +} + +case $1 in + start) + start;; + stop) + stop;; + *) + +esac