SHARE
TWEET

Untitled

a guest Oct 9th, 2019 218 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ============================================================== 7 - KEY ===============================================================
  2. ===========================================================================================================================================
  3. subscription-manager remove --all
  4. subscription-manager register --username elkarimareda --password treize1987  --auto-attach  --force
  5.  
  6. export LANG=en_US.UTF-8
  7.  
  8. // php devel
  9.  
  10. wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
  11. wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
  12. rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm
  13. subscription-manager repos --enable=rhel-7-server-optional-rpms
  14.  
  15. ============================================================== 1 - PHP ===============================================================
  16. ===========================================================================================================================================
  17. yum install git
  18.  
  19. yum install epel-release
  20. yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
  21. yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
  22. yum install -y yum-utils
  23. yum-config-manager --disable remi-php54
  24. yum-config-manager --enable remi-php73
  25. yum install php
  26. sudo yum install   php-xml php73-php-fpm php73-php-gd php73-php-json  php73-php-mysqlnd php73-php-xml php73-php-xmlrpc php73-php-opcache php-common php-pdo_mysql php-pdo php-mbstring php-pecl-zip php-devel
  27. sudo yum install -y perl perl-Net-SSLeay openssl perl-Encode-detect
  28. yum install php-mbstring gd gd-devel php-gd
  29. yum install php-pecl-zip
  30. sudo yum install php-common php-pdo_mysql php-pdo
  31.  
  32.  
  33. 2 - HTTPD
  34.  
  35. sudo yum install -t httpd
  36. sudo systemctl enable httpd
  37. sudo touch  -p /var/log/smartblender/error.log
  38. sudo touch  /var/log/smartblender/access.log
  39. sudo mkdir /etc/httpd/sites-available
  40. sudo mkdir /etc/httpd/sites-enabled
  41.  
  42.  
  43. 3 - MYSQL
  44.  
  45. yum remove mysql mysql-server
  46. mv /var/lib/mysql /var/lib/mysql_old_backup
  47. mv /etc/mysql /etc/mysql_old_backup
  48.  
  49. wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
  50. md5sum mysql57-community-release-el7-9.noarch.rpm
  51. sudo rpm -ivh mysql57-community-release-el7-9.noarch.rpm
  52. sudo yum install mysql-server
  53. sudo systemctl start mysqld
  54. cat /var/log/mysqld.log | grep "temporary password"
  55. mysql_secure_installation
  56. Smart%blender2019
  57.  
  58. 4 - COMPOSER
  59.  
  60. curl -sS https://getcomposer.org/installer | php
  61. sudo mv composer.phar /usr/local/bin/composer
  62. chmod +x /usr/local/bin/composer
  63.  
  64. 5 - NODEJS
  65.  
  66. sudo yum install -y gcc-c++ make
  67. sudo curl -sL https://rpm.nodesource.com/setup_12.x | sudo -E bash -
  68. sudo yum install nodejs
  69.  
  70. ============================================================== 7 - PROJECTS  ===============================================================
  71. ===========================================================================================================================================
  72. sudo git -c http.sslVerify=false pull
  73.  
  74. cd /var/www/html/
  75. sudo git -c http.sslVerify=false clone https://52.174.66.169/smartblender/smartblender-be.git
  76. sudo git -c http.sslVerify=false clone https://52.174.66.169/smartblender/smartblender-fe.git
  77. sudo git -c http.sslVerify=false clone https://52.174.66.169/ayoub/npk.git
  78. sudo git -c http.sslVerify=false clone https://52.174.66.169/agri-distribution/solver.git
  79.  
  80. sudo git clone https://github.com/edenhill/librdkafka/
  81. sudo  git clone https://github.com/arnaud-lb/php-rdkafka.git
  82. sudo  git clone https://github.com/EVODelavega/phpkafka.git
  83.  
  84. ============================================================== 8 - BACKEND  ===============================================================
  85. ===========================================================================================================================================
  86.  
  87. sudo bash -c 'echo  "<VirtualHost *:80>
  88. ServerName smartblender10.local
  89. DocumentRoot "/var/www/html/smartblender-be/smartblender/public"
  90. <Directory "/var/www/html/smartblender-be/smartblender/public">
  91. Options FollowSymLinks
  92. Order Allow,Deny
  93. Allow from All
  94. AllowOverride all
  95. Require all granted
  96. </Directory>
  97. #ErrorLog /var/log/smartblender/error.log
  98. #CustomLog /var/log/smartblender/access.log combined
  99. </VirtualHost>"  >  /etc/httpd/sites-available/smartblender.be.conf'
  100.  
  101. sudo ln -s /etc/httpd/sites-available/smartblender.be.conf /etc/httpd/sites-enabled/smartblender.be.conf
  102.  
  103. git checkout central
  104. sudo git -c http.sslVerify=false pull
  105.  
  106. ======= env
  107.  
  108. # In all environments, the following files are loaded if they exist,
  109. # the later taking precedence over the former:
  110. #
  111. #  * .env                contains default values for the environment variables needed by the app
  112. #  * .env.local          uncommitted file with local overrides
  113. #  * .env.$APP_ENV   committed environment-specific defaults
  114. #  * .env.$APP_ENV.local uncommitted environment-specific overrides
  115. #
  116. # Real environment variables win over .env files.
  117. #
  118. # DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
  119. #
  120. # Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
  121. # https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
  122.  
  123. ###> symfony/framework-bundle ###
  124. APP_ENV=dev
  125. APP_SECRET=a35c7dbc2754340c48fa7d95559505b9
  126. #TRUSTED_PROXIES=127.0.0.1,127.0.0.2
  127. #TRUSTED_HOSTS='^localhost|example\.com$'
  128. ###< symfony/framework-bundle ###
  129.  
  130. ###> doctrine/doctrine-bundle ###
  131. # Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
  132. # For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
  133. # Configure your db driver and server_version in config/packages/doctrine.yaml
  134. DATABASE_URL=mysql://root:Smart%blender2019@127.0.0.1:3306/smartblender-recette
  135. DATABASE_TEST_URL=mysql://root:test@127.0.0.1:3306/symfony_test
  136. ###< doctrine/doctrine-bundle ###
  137.  
  138. ###> symfony/swiftmailer-bundle ###
  139. # For Gmail as a transport, use: "gmail://username:password@localhost"
  140. # For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
  141. # Delivery is disabled by default via "null://localhost"
  142. #MAILER_URL=null://localhost
  143. #MAILER_URL=smtp://smtp.mailtrap.io:2525?encryption=tls&auth_mode=login&username=63c5aea63a4648&password=bb3076f3891196
  144. MAILER_URL=smtp://smtp.mailtrap.io:2525?encryption=tls&auth_mode=login&username=f38cf133fe4ff0&password=b6c8e073e9293a
  145. ###< symfony/swiftmailer-bundle ###
  146.  
  147. ###> nelmio/cors-bundle ###
  148. CORS_ALLOW_ORIGIN=^https?://smartblender10.fe.local(:[0-9]+)?$
  149. ###< nelmio/cors-bundle ###
  150.  
  151. ###> lexik/jwt-authentication-bundle ###
  152. JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
  153. JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
  154. JWT_PASSPHRASE=smartblender
  155. JWT_TOKEN_TTL=3600
  156. # JWT_PASSPHRASE=632b427493526bb62eba052165ebf297
  157. ###< lexik/jwt-authentication-bundle ###
  158.  
  159. APP_NPK_HOST=http://npk.smartblender10.local
  160. APP_COREBLENDING_HOST=http://solver.smartblender10.local/blender_api
  161.  
  162. KAFKA_BOOTSTRAP_SERVERS=PLAINTEXT://52.174.180.54:9092
  163. APP_ENVIRONMENT=STANDALONE
  164. CENTRAL_TOPIC_ID=TOPIC_CENTRAL_PROD
  165. BLENDER_ID= get from app => blenders
  166.  
  167. ne pas oubile ok
  168. =====
  169.  
  170. cd /var/www/html/smartblender-be/smartblender
  171.  
  172. export APP_ENV=dev && export APP_DEBUG=1  
  173. composer install  
  174. extension=rdkafka.so
  175.  
  176. php bin/console cache:clear
  177.  
  178. #curl .env from web
  179. php bin/console doctrine:database:create  
  180. php bin/console make:migration  
  181. php bin/console doctrine:schema:update --force
  182.  
  183. mkdir -p config/jwt  
  184. openssl genrsa -out config/jwt/private.pem -aes256 4096  
  185. openssl rsa -pubout -in config/jwt/private.pem -out config/jwt/public.pem
  186.  
  187. php bin/console doctrine:fixtures:load --group=dev --env=dev
  188.  
  189. node index.js
  190.  
  191.  
  192. - vide la table : blender_config , costumer, explotation, farmer  kafka_queries, plot ,
  193. - desactiver contraint d'integreter
  194. - customer : inserer name et id ==> get from app client
  195. - user : add costumer_id
  196. ============================================================== 8 - FRONTEND  ==============================================================
  197. ===========================================================================================================================================
  198.  
  199. sudo bash -c 'echo  "<VirtualHost *:80>
  200. ServerName smartblender10.fe.local
  201. DocumentRoot "/var/www/html/smartblender-fe/build"
  202. <Directory "/var/www/html/smartblender-fe/build">
  203. RewriteEngine on
  204. RewriteCond %{REQUEST_FILENAME} -f [OR]
  205. RewriteCond %{REQUEST_FILENAME} -d
  206. RewriteRule ^ - [L]
  207. RewriteRule ^ index.html [L]
  208. Options FollowSymLinks
  209. Order Allow,Deny
  210. Allow from All
  211. AllowOverride all
  212. Require all granted
  213. </Directory>
  214. #ErrorLog /var/log/smartblender/error.log
  215. #CustomLog /var/log/smartblender/access.log combined
  216. </VirtualHost>"  >  /etc/httpd/sites-available/smartblender.fe.conf'
  217.  
  218. sudo ln -s /etc/httpd/sites-available/smartblender.fe.conf /etc/httpd/sites-enabled/smartblender.fe.conf
  219.  
  220. ==env
  221. REACT_APP_HOST=http://smartblender9.local
  222. REACT_APP_ENV=STANDALONE
  223.  
  224.  
  225. ============================================================== 9 - SOLVER ==============================================================
  226. ===========================================================================================================================================
  227.  
  228. sudo bash -c 'echo  "
  229. <VirtualHost *:80>
  230.         ServerName solver.smartblender6.local
  231.         ProxyPass / http://127.0.0.1:8000/
  232.         ProxyPassReverse / http://127.0.0.1:8000/
  233. </VirtualHost> "   >  /etc/httpd/sites-available/solver.conf'
  234.  
  235. sudo ln -s /etc/httpd/sites-available/solver.conf /etc/httpd/sites-enabled/solver.conf
  236.  
  237. git checkout  2.0
  238. sudo git -c http.sslVerify=false pull
  239.  
  240. yum -y install python-pip
  241. pip install --upgrade pip
  242. pip install gunicorn falcon ortools numpy
  243.  
  244.  
  245. gunicorn -b 127.0.0.1:8000 blender_api:app --reload  &
  246.  
  247.  
  248.  
  249. ============================================================== 10 - NPK  ==================================================================
  250. ===========================================================================================================================================
  251.  
  252. sudo chown -R $USER:$USER /var/www/html/npk
  253.  
  254. sudo bash -c 'echo "
  255. <VirtualHost *:80>
  256. ServerName npk.smartblender10.local
  257. DocumentRoot "/var/www/html/npk/public"
  258. <Directory "/var/www/html/npk/public">
  259. Options FollowSymLinks
  260. Order Allow,Deny
  261. Allow from All
  262. AllowOverride all
  263. Require all granted
  264. </Directory>
  265. #ErrorLog /var/log/smartblender/error.log
  266. #CustomLog /var/log/smartblender/access.log combined
  267. </VirtualHost> " >  /etc/httpd/sites-available/npk.conf'
  268.  
  269. sudo ln -s /etc/httpd/sites-available/npk.conf /etc/httpd/sites-enabled/npk.conf
  270.  
  271.  ===env
  272.  
  273. # This file defines all environment variables that the application needs.
  274. # DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE.
  275. # Use ".env.local" for local overrides during development.
  276. # Use real environment variables when deploying to production.
  277. # https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
  278. ###> doctrine/doctrine-bundle ###
  279. # Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
  280. # For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
  281. # Configure your db driver and server_version in config/packages/doctrine.yaml
  282. APP_ENV=dev
  283. APP_SECRET=1fcdbf5d653d404288d068aa3f353870
  284. ##DATABASE_URL=mysql://root:password@localhost:3306/db_atmar_npk
  285. DATABASE_URL=mysql://root:Smart%blender2019@127.0.0.1:3306:3306/db_atmar_npk
  286. ##DATABASE_URL=mysql://root:@localhost:3309/db_atmar_npk
  287. ###< doctrine/doctrine-bundle ###
  288. ###> nelmio/cors-bundle ###
  289. CORS_ALLOW_ORIGIN=^https?://(localhost|smartblender10.local|smartblender10.fe.local)(:[0-9]+)?$
  290. ===
  291.  
  292. Need data base : db_atmar_npk.sql file
  293.  
  294. scp /Users/atif/Desktop/db_atmar_npk.sql smartblender@192.168.1.110:~
  295.  
  296. php bin/console doctrine:database:create
  297. php bin/console doctrine:database:import  "./src/Migrations/db_atmar_npk.sql"
  298.  
  299. php bin/console doctrine:database:import  "/home/smartblender/db_atmar_npk.sql"
  300.  
  301. ============================================================== 10 - KAFKA ==================================================================
  302. ===========================================================================================================================================
  303.  
  304. cd librdkafka
  305. sudo ./configure
  306. sudo make
  307. sudo make install
  308.  
  309. cd ..
  310. cd php-rdkafka
  311. sudo phpize
  312. sudo ./configure
  313. sudo make all -j 5
  314. sudo make install
  315.  
  316. extension=rdkafka.so  // add
  317.  
  318. cd ..
  319. cd phpkafka
  320. sudo phpize
  321. sudo ./configure --enable-kafka
  322. sudo make install
  323.  
  324.  
  325. ============================================================== 11 - OTHER  ==================================================================
  326. ===========================================================================================================================================
  327.  
  328.  
  329. 127.0.0.1   smartblender7.local
  330. 127.0.0.1   smartblender7.fe.local
  331. 127.0.0.1   solver.smartblender7.local
  332. 127.0.0.1   npk.smartblender7.local
  333.  
  334.  
  335. ============================================================== 11 - FIREWALL  ==================================================================
  336. ===========================================================================================================================================
  337.  
  338. firewall-cmd --zone=public --add-port=55555/tcp --permanent
  339. firewall-cmd --zone=public --add-port=5000/tcp --permanent
  340. firewall-cmd --zone=public --add-port=3000/tcp --permanent
  341. firewall-cmd --zone=public --add-port=80/tcp --permanent
  342. firewall-cmd --reload
  343.  
  344. npm install -g pm2 serve
  345.  
  346. pm2 start /var/www/html/smartblender-fe/node_modules/react-scripts/bin/react-scripts.js --name smartblenderFE -- start
  347.  
  348.  
  349. sudo bash -c  'echo IncludeOptional sites-enabled/*.conf >>  /etc/httpd/conf/httpd.conf'
  350.  
  351.  
  352.  
  353. ============================================================== 11 - NETWORK  ==================================================================
  354. ===========================================================================================================================================
  355.  
  356.  
  357.  
  358. /etc/sysconfig/network-scripts/
  359. sudo nano /etc/sysconfig/network-scripts/ifcfg-enp0s3
  360. BOOTPROTO=dhcp
  361. To:
  362. BOOTPROTO=static
  363.  
  364. IPADDR=192.168.1.200
  365. NETMASK=255.255.255.0
  366. GATEWAY=192.168.1.1
  367. DNS1=1.0.0.1
  368. DNS2=1.1.1.1
  369. DNS3=8.8.4.4
  370.  
  371.  
  372. sudo setenforce 0
  373. sudo setenforce Permissive
  374.  
  375. DocumentRoot "/var/www/html/smartblender-be/smartblender/public"
  376.  
  377. cat appstart.sh  > npm start
  378. chmod +x appstart.sh
  379. pm2 start appstart.sh
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top