Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- firewall-cmd --permanent --add-port=10050/tcp
- firewall-cmd --permanent --add-port=10051/tcp
- firewall-cmd --permanent --add-port=80/tcp
- firewall-cmd --permanent --add-port=3000/tcp
- firewall-cmd --reload
- service firewalld restart
- yum install wget yum-utils
- nano /etc/yum.repos.d/grafana.repo
- [grafana]
- name=grafana
- baseurl=https://packagecloud.io/grafana/stable/el/6/$basearch
- repo_gpgcheck=1
- enabled=1
- gpgcheck=1
- gpgkey=https://packagecloud.io/gpg.key https://grafanarel.s3.amazonaws.com/RPM-GPG-KEY-grafana
- sslverify=1
- sslcacert=/etc/pki/tls/certs/ca-bundle.crt
- wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
- wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
- rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm
- rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
- rpm -ivh https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
- yum update
- yum install postgresql96-server zabbix-server-pgsql zabbix-web-pgsql
- /usr/pgsql-9.6/bin/postgresql96-setup initdb
- systemctl start postgresql-9.6.service
- su - postgres
- createuser -d -S -R -P zabbix
- createdb -O zabbix zabbix
- createuser -d -S -R -P grafana
- createdb -O grafana grafana
- exit
- nano /var/lib/pgsql/9.6/data/pg_hba.conf
- # TYPE DATABASE USER ADDRESS METHOD
- # "local" is for Unix domain socket connections only
- local all all md5
- # IPv4 local connections:
- host all all 127.0.0.1/32 md5
- # IPv6 local connections:
- host all all ::1/128 md5
- # Allow replication connections from localhost, by a user with the
- # replication privilege.
- #local replication postgres peer
- #host replication postgres 127.0.0.1/32 ident
- #host replication postgres ::1/128 ident
- systemctl restart postgresql-9.6.service
- su - postgres
- zcat /usr/share/doc/zabbix-server-pgsql-3.2.1/create.sql.gz | psql -U zabbix zabbix
- exit
- setsebool -P zabbix_can_network 1
- setsebool -P httpd_can_network_connect 1
- setsebool -P httpd_can_connect_zabbix 1
- service httpd stop
- systemctl disable httpd
- yum-config-manager --enable remi-php70
- yum install nginx php-fpm
- nano /etc/php-fpm.d/www.conf
- ; RPM: apache Choosed to be able to access some dir as httpd
- user = nginx
- ; RPM: Keep a group allowed to write in log dir.
- group = nginx
- ; The address on which to accept FastCGI requests.
- ; Valid syntaxes are:
- ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
- ; a specific port;
- ; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
- ; a specific port;
- ; 'port' - to listen on a TCP socket to all addresses
- ; (IPv6 and IPv4-mapped) on a specific port;
- ; '/path/to/unix/socket' - to listen on a unix socket.
- ; Note: This value is mandatory.
- listen = /var/run/php-fpm/php.socket
- ; Set permissions for unix socket, if one is used. In Linux, read/write
- ; permissions must be set in order to allow connections from a web server.
- ; Default Values: user and group are set as the running user
- ; mode is set to 0660
- listen.owner = nginx
- listen.group = nginx
- listen.mode = 0660
- nano /etc/php.ini
- ; Maximum size of POST data that PHP will accept.
- ; Its value may be 0 to disable the limit. It is ignored if POST data reading
- ; is disabled through enable_post_data_reading.
- ; http://php.net/post-max-size
- post_max_size = 16M
- ; Maximum execution time of each script, in seconds
- ; http://php.net/max-execution-time
- ; Note: This directive is hardcoded to 0 for the CLI SAPI
- max_execution_time = 300
- ; Maximum amount of time each script may spend parsing request data. It's a good
- ; idea to limit this time on productions servers in order to eliminate unexpectedly
- ; long running scripts.
- ; Note: This directive is hardcoded to -1 for the CLI SAPI
- ; Default Value: -1 (Unlimited)
- ; Development Value: 60 (60 seconds)
- ; Production Value: 60 (60 seconds)
- ; http://php.net/max-input-time
- max_input_time = 300
- ; Defines the default timezone used by the date functions
- ; http://php.net/date.timezone
- date.timezone = Europe/Vilnius
- chown -R nginx:nginx /var/run/php-fpm
- chown -R nginx:nginx /etc/zabbix/web
- chown -R nginx:nginx /usr/share/zabbix
- chown -R nginx:nginx /var/lib/php/session
- nano /etc/nginx/conf.d/zabbix.conf
- server {
- listen 80;
- server_name io.gameshow.media;
- location / {
- root /usr/share/zabbix;
- index index.php index.html index.htm;
- }
- location ~ \.php$ {
- root /usr/share/zabbix;
- try_files $uri =404;
- fastcgi_pass unix:/var/run/php-fpm/php.socket;
- fastcgi_index index.php;
- fastcgi_buffers 4 256k;
- fastcgi_busy_buffers_size 256k;
- fastcgi_temp_file_write_size 256k;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- }
- # deny access to .htaccess files, if Apache's document root
- # concurs with nginx's one
- #
- location ~ /\.ht {
- deny all;
- }
- }
- yum install grafana
- nano /etc/grafana/grafana.ini
- [server]
- protocol = http
- http_addr =
- http_port = 3000
- domain = localhost
- enforce_domain = false
- root_url = %(protocol)s://%(domain)s:%(http_port)s/
- router_logging = false
- [database]
- type = postgres
- host = 127.0.0.1
- name = grafana
- user = grafana
- password = grafana
- ssl_mode = disable
- [session]
- provider = memory
- [security]
- admin_user = admin
- admin_password = admin
- secret_key = SW2YcwTIb9sdfghfdgsh
- nano /etc/nginx/conf.d/grafana.conf
- server {
- server_name board.gameshow.media;
- listen 80;
- access_log /var/log/nginx/grafana.access.log;
- error_log /var/log/nginx/grafana.error.log;
- location / {
- proxy_pass http://localhost:3000;
- proxy_set_header Host $host;
- }
- }
- grafana-cli plugins install alexanderzobnin-zabbix-app
- yum install zabbix-agent
- systemctl daemon-reload
- systemctl enable grafana-server.service
- systemctl enable nginx
- systemctl enable zabbix-agent
- systemctl enable php-fpm
- systemctl enable postgresql-9.6.service
- service nginx start
- service php-fpm start
- reboot
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement