Last active
January 9, 2020 04:28
-
-
Save androidovshchik/56fc89224815ccabaad909778d31ba44 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
ps aux | grep proexpert | awk '{print $2}' | xargs /bin/kill |
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
#!/bin/bash | |
nohup java -jar /home/proexpert.jar & |
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
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: proexpert | |
# Required-Start: $all | |
# Required-Stop: | |
# Default-Start: 2 3 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: PROEXPERT | |
### END INIT INFO | |
case $1 in | |
start) | |
/bin/bash /home/proexpert-start.sh | |
;; | |
stop) | |
/bin/bash /home/proexpert-stop.sh | |
;; | |
restart) | |
/bin/bash /home/proexpert-stop.sh | |
/bin/bash /home/proexpert-start.sh | |
;; | |
esac | |
exit 0 |
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
apt-get update | |
apt-get install apache2 -y | |
apt-get install mysql-server -y | |
apt-get install php libapache2-mod-php php-mysql -y | |
apt-get install phpmyadmin php-mbstring php-gettext -y | |
apt-get install openjdk-8-jdk -y | |
reboot | |
chmod 755 /etc/init.d/proexpert | |
update-rc.d proexpert defaults | |
systemctl daemon-reload | |
systemctl start proexpert | |
mysql -u root | |
CREATE USER 'remote'@'%' IDENTIFIED BY 'mypass'; | |
CREATE USER 'proexpert'@'localhost' IDENTIFIED BY 'mypass'; | |
GRANT ALL ON *.* TO 'remote'@'%'; | |
GRANT ALL ON *.* TO 'proexpert'@'localhost'; | |
flush privileges; | |
exit; | |
# bind-address = 0.0.0.0 | |
crontab -e | |
*/5 * * * * sh /home/proexpert-restart.sh |
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
#!/bin/bash | |
if ! pgrep -x "proexpert" > /dev/null; then | |
sh /home/proexpert-start.sh | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment