Advertisement
Guest User

Untitled

a guest
Oct 20th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.11 KB | None | 0 0
  1. firewall-cmd --permanent --add-port=10050/tcp
  2.  
  3. firewall-cmd --permanent --add-port=10051/tcp
  4.  
  5. firewall-cmd --permanent --add-port=80/tcp
  6.  
  7. firewall-cmd --permanent --add-port=3000/tcp
  8.  
  9. firewall-cmd --reload
  10. service firewalld restart
  11.  
  12. yum install wget yum-utils
  13.  
  14. nano /etc/yum.repos.d/grafana.repo
  15.  
  16. [grafana]
  17. name=grafana
  18. baseurl=https://packagecloud.io/grafana/stable/el/6/$basearch
  19. repo_gpgcheck=1
  20. enabled=1
  21. gpgcheck=1
  22. gpgkey=https://packagecloud.io/gpg.key https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana
  23. sslverify=1
  24. sslcacert=/etc/pki/tls/certs/ca-bundle.crt
  25.  
  26. wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
  27. wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
  28.  
  29. rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm
  30.  
  31. rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
  32.  
  33. rpm -ivh https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
  34.  
  35. yum update
  36.  
  37. yum install postgresql96-server zabbix-server-pgsql zabbix-web-pgsql
  38.  
  39. /usr/pgsql-9.6/bin/postgresql96-setup initdb
  40. systemctl start postgresql-9.6.service
  41.  
  42. su - postgres
  43.  
  44. createuser -d -S -R -P zabbix
  45.  
  46. createdb -O zabbix zabbix
  47.  
  48. createuser -d -S -R -P grafana
  49.  
  50. createdb -O grafana grafana
  51.  
  52. exit
  53.  
  54. nano /var/lib/pgsql/9.6/data/pg_hba.conf
  55.  
  56. # TYPE DATABASE USER ADDRESS METHOD
  57.  
  58. # "local" is for Unix domain socket connections only
  59. local all all md5
  60. # IPv4 local connections:
  61. host all all 127.0.0.1/32 md5
  62. # IPv6 local connections:
  63. host all all ::1/128 md5
  64. # Allow replication connections from localhost, by a user with the
  65. # replication privilege.
  66. #local replication postgres peer
  67. #host replication postgres 127.0.0.1/32 ident
  68. #host replication postgres ::1/128 ident
  69.  
  70. systemctl restart postgresql-9.6.service
  71.  
  72. su - postgres
  73.  
  74. zcat /usr/share/doc/zabbix-server-pgsql-3.2.1/create.sql.gz | psql -U zabbix zabbix
  75.  
  76. exit
  77.  
  78. setsebool -P zabbix_can_network 1
  79. setsebool -P httpd_can_network_connect 1
  80. setsebool -P httpd_can_connect_zabbix 1
  81.  
  82. service httpd stop
  83.  
  84. systemctl disable httpd
  85.  
  86. yum-config-manager --enable remi-php70
  87. yum install nginx php-fpm
  88.  
  89.  
  90. nano /etc/php-fpm.d/www.conf
  91.  
  92. ; RPM: apache Choosed to be able to access some dir as httpd
  93. user = nginx
  94. ; RPM: Keep a group allowed to write in log dir.
  95. group = nginx
  96.  
  97. ; The address on which to accept FastCGI requests.
  98. ; Valid syntaxes are:
  99. ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
  100. ; a specific port;
  101. ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
  102. ; a specific port;
  103. ; 'port' - to listen on a TCP socket to all addresses
  104. ; (IPv6 and IPv4-mapped) on a specific port;
  105. ; '/path/to/unix/socket' - to listen on a unix socket.
  106. ; Note: This value is mandatory.
  107. listen = /var/run/php-fpm/php.socket
  108.  
  109.  
  110. ; Set permissions for unix socket, if one is used. In Linux, read/write
  111. ; permissions must be set in order to allow connections from a web server.
  112. ; Default Values: user and group are set as the running user
  113. ; mode is set to 0660
  114. listen.owner = nginx
  115. listen.group = nginx
  116. listen.mode = 0660
  117.  
  118.  
  119.  
  120.  
  121. nano /etc/php.ini
  122.  
  123.  
  124. ; Maximum size of POST data that PHP will accept.
  125. ; Its value may be 0 to disable the limit. It is ignored if POST data reading
  126. ; is disabled through enable_post_data_reading.
  127. ; http://php.net/post-max-size
  128. post_max_size = 16M
  129.  
  130. ; Maximum execution time of each script, in seconds
  131. ; http://php.net/max-execution-time
  132. ; Note: This directive is hardcoded to 0 for the CLI SAPI
  133. max_execution_time = 300
  134.  
  135. ; Maximum amount of time each script may spend parsing request data. It's a good
  136. ; idea to limit this time on productions servers in order to eliminate unexpectedly
  137. ; long running scripts.
  138. ; Note: This directive is hardcoded to -1 for the CLI SAPI
  139. ; Default Value: -1 (Unlimited)
  140. ; Development Value: 60 (60 seconds)
  141. ; Production Value: 60 (60 seconds)
  142. ; http://php.net/max-input-time
  143. max_input_time = 300
  144.  
  145. ; Defines the default timezone used by the date functions
  146. ; http://php.net/date.timezone
  147. date.timezone = Europe/Vilnius
  148.  
  149.  
  150. chown -R nginx:nginx /var/run/php-fpm
  151. chown -R nginx:nginx /etc/zabbix/web
  152. chown -R nginx:nginx /usr/share/zabbix
  153. chown -R nginx:nginx /var/lib/php/session
  154.  
  155. nano /etc/nginx/conf.d/zabbix.conf
  156.  
  157. server {
  158. listen 80;
  159. server_name io.gameshow.media;
  160.  
  161. location / {
  162. root /usr/share/zabbix;
  163. index index.php index.html index.htm;
  164. }
  165.  
  166. location ~ \.php$ {
  167. root /usr/share/zabbix;
  168. try_files $uri =404;
  169. fastcgi_pass unix:/var/run/php-fpm/php.socket;
  170. fastcgi_index index.php;
  171. fastcgi_buffers 4 256k;
  172. fastcgi_busy_buffers_size 256k;
  173. fastcgi_temp_file_write_size 256k;
  174.  
  175. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  176. include fastcgi_params;
  177. }
  178.  
  179. # deny access to .htaccess files, if Apache's document root
  180. # concurs with nginx's one
  181. #
  182. location ~ /\.ht {
  183. deny all;
  184. }
  185. }
  186.  
  187. yum install grafana
  188.  
  189. nano /etc/grafana/grafana.ini
  190.  
  191.  
  192. [server]
  193. protocol = http
  194. http_addr =
  195. http_port = 3000
  196. domain = localhost
  197. enforce_domain = false
  198. root_url = %(protocol)s://%(domain)s:%(http_port)s/
  199. router_logging = false
  200.  
  201. [database]
  202. type = postgres
  203. host = 127.0.0.1
  204. name = grafana
  205. user = grafana
  206. password = grafana
  207. ssl_mode = disable
  208.  
  209. [session]
  210. provider = memory
  211.  
  212. [security]
  213. admin_user = admin
  214. admin_password = admin
  215.  
  216. secret_key = SW2YcwTIb9sdfghfdgsh
  217.  
  218. nano /etc/nginx/conf.d/grafana.conf
  219.  
  220. server {
  221. server_name board.gameshow.media;
  222. listen 80;
  223. access_log /var/log/nginx/grafana.access.log;
  224. error_log /var/log/nginx/grafana.error.log;
  225.  
  226. location / {
  227. proxy_pass http://localhost:3000;
  228. proxy_set_header Host $host;
  229. }
  230. }
  231.  
  232. grafana-cli plugins install alexanderzobnin-zabbix-app
  233. yum install zabbix-agent
  234.  
  235. systemctl daemon-reload
  236. systemctl enable grafana-server.service
  237.  
  238. systemctl enable nginx
  239.  
  240. systemctl enable zabbix-agent
  241.  
  242. systemctl enable php-fpm
  243.  
  244. systemctl enable postgresql-9.6.service
  245.  
  246. service nginx start
  247. service php-fpm start
  248.  
  249. reboot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement