All_installv3.4.1.sh 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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 /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 /passwd/
  51. mv /mosquitto/mosquitto.conf /etc/mosquitto/
  52. mv /passwd/passwd /etc/mosquitto/
  53. rm -rf /mosquitto/
  54. rm -rf /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 /procwdtdconf/
  66. # get watchdog file proc-wdtd
  67. git clone -b procwdtd --single-branch http://60.250.156.230:3000/fatwolf/proc.git /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 /rclocal/
  72. mv /procwdtdconf/proc-wdtd.conf /etc/
  73. mv /procwdtd/proc-wdtd /usr/sbin/
  74. mv /rclocal/rc.local /etc/
  75. rm -rf /procwdtdconf/
  76. rm -rf /procwdtd/
  77. rm -rf /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. cd Sixth/
  107. mv Sixth-Backend.tar.gz /etc/Sixth
  108. rm -rf Sixth/
  109. cd /etc/Sixth
  110. tar -zxvf Sixth-BBend.tar.gz
  111. #------------------------install use user--------------------------
  112. #Item8 ROS ubuntu 18.04 melodic
  113. #ROS It should be install in user not install in root
  114. #install
  115. sudo apt-get install -y chrony ntpdate
  116. sudo ntpdate -q ntp.ubuntu.com
  117. sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
  118. sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
  119. sudo apt-get update && sudo apt-get upgrade -y
  120. sudo apt install ros-melodic-desktop-full -y
  121. sudo apt-get install ros-melodic-rqt* -y
  122. sudo apt-get install python-rosdep -y
  123. sudo rosdep init
  124. rosdep update
  125. sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential -y
  126. #setup
  127. source /opt/ros/melodic/setup.bash
  128. echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
  129. source ~/.bashrc
  130. #Create Ros Workspace
  131. mkdir -p ~/catkin_ws/src
  132. cd ~/catkin_ws/
  133. catkin_make
  134. #Setup
  135. source ~/catkin_ws/devel/setup.bash
  136. echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
  137. source ~/.bashrc
  138. # need user name
  139. echo $ROS_PACKAGE_PATH /home/nanotf/sh/catkin_ws/src:/opt/ros/melodic/share
  140. source ~/.bashrc
  141. printenv | grep ROS
  142. #sudo reboot