All_installv3.4.2.sh 5.2 KB

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