All_installv3.4.3.sh 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. #!/bin/bash
  2. #Item1 In Common Use
  3. sudo apt install python3.6 -y
  4. sudo apt-get install python3-pip -y
  5. sudo apt-get install git -y
  6. sudo apt-get install wget -y
  7. #Item2 LAMP
  8. echo 'start install LAMP'
  9. sudo apt install tasksel -y
  10. sudo tasksel install lamp-server
  11. echo 'install phpmyadmin'
  12. cd /tmp/
  13. pwd
  14. wget https://files.phpmyadmin.net/phpMyAdmin/5.1.0/phpMyAdmin-5.1.0-all-languages.tar.gz
  15. tar -zxvf phpMyAdmin-5.1.0-all-languages.tar.gz
  16. rm phpMyAdmin-5.1.0-all-languages.tar.gz
  17. mv phpMyAdmin-5.1.0-all-languages /var/www/html/phpmyadmin
  18. cd /var/www/html/phpmyadmin/
  19. mkdir tmp
  20. #install php7
  21. sudo apt install openssl php-common php-curl php-json php-mbstring php-mysql php-xml php-zip -y
  22. sudo apt install php7.2-mbstring -y
  23. sudo apt install php7.2-xml -y
  24. sudo apt install php7.2-mysql -y
  25. sudo apt install php7.2-common -y
  26. sudo apt install php7.2-curl -y
  27. sudo apt install php7.2-json -y
  28. sudo apt install php7.2-zip -y
  29. echo 'start apache2 '
  30. sudo service apache2 start
  31. echo 'setting mysql pass'
  32. sudo mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Gold@53743001';"
  33. #Item3 MQTT
  34. # install&setting mqtt server
  35. sudo pip3 install paho-mqtt
  36. sudo apt-get install mosquitto -y
  37. sudo systemctl start mosquitto
  38. sudo systemctl enable mosquitto
  39. cd /home/nanotf/sh/
  40. # get mqtt server file mosquitto.conf
  41. git clone -b mosquitto --single-branch http://60.250.156.230:3000/fatwolf/mqtt_server_setting.git /home/nanotf/sh/mosquitto/
  42. # get mqtt server file passwd.conf
  43. git clone -b passwd --single-branch http://60.250.156.230:3000/fatwolf/mqtt_server_setting.git /home/nanotf/sh/passwd/
  44. mv /home/nanotf/sh/mosquitto/mosquitto.conf /etc/mosquitto/
  45. mv /home/nanotf/sh/passwd/passwd /etc/mosquitto/
  46. rm -rf /home/nanotf/sh/mosquitto/
  47. rm -rf /home/nanotf/sh/passwd/
  48. sudo systemctl stop mosquitto
  49. sudo systemctl start mosquitto
  50. #Item4 Watchdog
  51. # get watchdog file proc-wdtd.conf
  52. git clone -b procwdtdconf --single-branch http://60.250.156.230:3000/fatwolf/proc.git /home/nanotf/sh/procwdtdconf/
  53. # get watchdog file proc-wdtd
  54. git clone -b procwdtd --single-branch http://60.250.156.230:3000/fatwolf/proc.git /home/nanotf/sh/procwdtd/
  55. # get watchdog file rc.local
  56. git clone -b rclocal --single-branch http://60.250.156.230:3000/fatwolf/proc.git /home/nanotf/sh/rclocal/
  57. mv /home/nanotf/sh/procwdtdconf/proc-wdtd.conf /etc/
  58. mv /home/nanotf/sh/procwdtd/proc-wdtd /usr/sbin/
  59. mv /home/nanotf/sh/rclocal/rc.local /etc/
  60. rm -rf /home/nanotf/sh/procwdtdconf/
  61. rm -rf /home/nanotf/sh/procwdtd/
  62. rm -rf /home/nanotf/sh/rclocal/
  63. sudo chmod 777 /usr/sbin/proc-wdtd
  64. sudo systemctl restart rc-local.service
  65. #Item5 Git Server
  66. sudo apt-get install golang -y
  67. cd /home/nanotf/sh/
  68. git clone http://60.250.156.230:3000/fatwolf/gogsfile.git /home/nanotf/sh/gogs
  69. mv gogs/gogs_0.12.3_linux_amd64.tar.gz /home/nanotf/sh/
  70. rm -rf gogs/
  71. tar -C /home/nanotf/sh/ -zxvf gogs_0.12.3_linux_amd64.tar.gz
  72. #Item6 Gitweb
  73. sudo apt-get install gitweb -y
  74. sudo a2enmod cgi
  75. sudo service apache2 restart
  76. #Item7 Python packegs Library
  77. sudo pip3 install flask
  78. sudo pip3 install Flask-SQLAlchemy
  79. sudo pip3 install pymysql
  80. sudo pip3 install flask_mqtt
  81. sudo pip3 install flask_migrate
  82. sudo pip3 install flask-jwt-extended
  83. sudo pip3 install numpy
  84. sudo pip3 install pandas
  85. sudo pip3 install opencv-python==4.3.0.38
  86. sudo pip3 install BeautifulSoup4
  87. sudo pip3 install selenium
  88. sudo pip3 install geocoder
  89. #Item8 AP(WebPage)
  90. cd /home/nanotf/sh/
  91. git clone http://60.250.156.230:3000/benson/SixthProject.git /home/nanotf/sh/Sixth/
  92. mkdir /etc/Sixth/
  93. cd Sixth/
  94. mv Sixth-Backend.tar.gz /etc/Sixth
  95. cd ..
  96. rm -rf Sixth/
  97. cd /etc/Sixth
  98. tar -zxvf Sixth-Backend.tar.gz
  99. #Item9 ROS ubuntu 18.04 melodic
  100. sudo apt-get install -y chrony ntpdate
  101. sudo ntpdate -q ntp.ubuntu.com
  102. sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
  103. sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
  104. sudo apt-get update && sudo apt-get upgrade -y
  105. sudo apt install ros-melodic-desktop-full -y
  106. sudo apt-get install ros-melodic-rqt* -y
  107. sudo apt-get install python-rosdep -y
  108. sudo rosdep init
  109. rosdep update
  110. sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential -y
  111. #setup
  112. source /opt/ros/melodic/setup.bash
  113. echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
  114. source ~/.bashrc
  115. #Create Ros Workspace
  116. mkdir -p ~/catkin_ws/src
  117. cd ~/catkin_ws/
  118. catkin_make
  119. #Setup
  120. source ~/catkin_ws/devel/setup.bash
  121. echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
  122. source ~/.bashrc
  123. echo $ROS_PACKAGE_PATH /home/nanotf/sh/catkin_ws/src:/opt/ros/melodic/share
  124. source ~/.bashrc
  125. printenv | grep ROS
  126. #sudo reboot