很久沒有發表博文了,感受有點對不住51CTO和本身,嘿嘿~~php
近期公司要安裝監控服務器,正好趁此機會,將流程系統梳理下,製成文檔,分享衆人!我以爲這事兒利人利己,也便於本身之後複習使用!
html
服務器版本信息:mysql
[root@localhost ~]# cat /proc/versionsql
Linux version 3.10.0-327.el7.x86_64(builder@kbuilder.dev.centos.org) (gcc version 4.8.3 20140911 (Red Hat 4.8.3-9)(GCC) ) #1 SMP Thu Nov 19 22:10:57 UTC 2015數據庫
操做系統鏡像爲:CentOS-7-x86_64-DVD-1511.isovim
準備工做:centos
設置阿里雲yum源爲本地默認源服務器
[root@localhost yum.repos.d]# mv CentOS-Base.repo CentOS-Server.repocurl
[root@localhost yum.repos.d]# wget http://mirrors.aliyun.com/repo/Centos-7.repoide
[root@localhost yum.repos.d]# mv Centos-7.repo CentOS-Base.repo
命令解析:
重命名CentOS-Base.repo文件名爲 CentOS-Server.repo;
獲取阿里雲yum源文件;
設置阿里雲yum源文件爲本地默認yum源;
添加數據庫yum源
[root@localhostyum.repos.d]#wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
[root@localhost yum.repos.d]# rpm -ivhmysql-community-release-el7-5.noarch.rpm
[root@localhost yum.repos.d]# rm -rfmysql-community-release-el7-5.noarch.rpm
[root@localhost yum.repos.d]# cd
命令解析:
獲取mysql官方安裝準備包,安裝後獲得mysql的yum源文件,以後刪除安裝包,返回root目錄;
安裝開始
經過yum安裝Web,mysql和php及其擴展服務
[root@localhost~]# yum install httpd mysql-community mysql-community-servermysql-community-client php php-devel php-mysql php-pdo php-mbstring php-odbcphp-embedded php-fpm php-embedded –y
…….
Complete!
啓動Web服務,查看服務是否正常;
[root@localhost ~]# systemctl starthttpd.service
編寫indxe.php測試文件
[root@localhost conf.d]# vim/var/www/html/index.php
<?php
phpinfo();
?>
測試php訪問效果:
[root@localhost conf.d]# curl http://192.168.171.130
啓動mysql服務
[root@localhost conf.d]#systemctl start mysqld.service
訪問數據庫
[root@localhost conf.d]# mysql
建立數據庫
mysql> create database zabbix characterset utf8;
Query OK, 1 row affected (0.00 sec)
受權數據庫用戶
mysql> grant all on zabbix.* to'zabbix'@'localhost' identified by "zbbix";
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
退出數據庫
mysql> \q
Bye
設置httpd和mysqld服務開機自動啓動
[root@localhost ~]# systemctl enablehttpd.service
[root@localhost ~]# systemctl enablemysqld.service
至此,環境準備完畢!