CentOS7学习笔记介绍_第1页
CentOS7学习笔记介绍_第2页
CentOS7学习笔记介绍_第3页
CentOS7学习笔记介绍_第4页
CentOS7学习笔记介绍_第5页
已阅读5页,还剩16页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Apache运行账号daemonMysql账号Root:123179Cacti:123179Cacti系统账号:cactiuser:123179(给rrdlogs权限的账号,cron的运行账号)Cacti登录账号:admin:123179Nagios账号:Nagios系统账号:nagios,组:nagios,nagcmdNagiosWEBaccess账号:nagiosadmin:123179CentOS7源码安装apache错误:apr/apr-util1.下载apr/apr-util,解压至apache(httpd)目录./httpd-2.4-XX/srclib,将arp/arp-util后缀中的数字去掉2.重新编译./httpd-2.4-XX/configure--prefix=/usr/local/apache2--with-included-apr错误:pcre1.从下载pcre,解压,编译,安装./pcre-xxx/configure--prefix=/usr/loca/pcre;make;makeinstall2.重新编译./httpd-2.4-XX/configure--prefix=/usr/local/apache2--with-included-apr--with-pcre=/usr/local/pcre错误:gcc/gcc-c++1.sudoyuminstallgccgcc-c++经验:安装系统开机启动服务1./usr/lib/systemd/system(需要用户登录才启动的:/usr/lib/systemd/user)2.sudovim/usr/lib/systemd/system/apache2.service3.[Unit]Description=Apache2httpserverservices[Service]Type=forkingExecStart=/usr/local/apache2/bin/apachectlstartExecReload=/usr/local/apache2/bin/apachectlrestartExecStop=/usr/local/apache2/bin/apachectlstopPrivateTmp=true[Install]WantedBy=multi-user.target4.chmod754apache2.service5.sudosystemctlenable/disableapache2.service6.sudosystemctlstart/stop/restartapache2.service经验:CentOS7关闭默认防火墙sudosystemctlstopfirewalld.service或者放开防火墙端口Sudofirewall-cmd--permanent–add-port=80/tcp错误:图形界面开机后couldnotapplythestoredconfigurationrm–f~/.config/monitors.xmlCentOS7源码安装mysql经验:准备条件make,cmake,gcc-c++错误:FATALERROR:pleaseinstallthefollowingPerlmodulesbeforeexecuting./mysql_install_db:1.sudoyuminstallperl-Module-Install错误:CouldNOTfindCurses(missing:CURSES_LIBRARYCURSES_INCLUDE_PATH)CMakeErroratcmake/readline.cmake:85(MESSAGE):Curseslibrarynotfound.Pleaseinstallappropriatepackage,removeCMakeCache.txtandreruncmake.OnDebian/Ubuntu,packagenameislibncurses5-dev,onRedhatandderivatesitisncurses-devel.1.yuminstallncurses-devel2.删除CMakeCache.txt继续运行cmake.错误:CMakeErroratinfo_macros.cmake:110(FILE):fileInternalCMakeerrorwhentryingtoopenfile:/home/osborn.lee/Downloads/mysql-5.6.26/Docs/INFO_BINforwriting.CallStack(mostrecentcallfirst):cmake/info_bin.cmake:29(CREATE_INFO_BIN)make[2]:***[CMakeFiles/INFO_BIN]Error1make[1]:***[CMakeFiles/INFO_BIN.dir/all]Error2make:***[all]Error2yum-yinstallgccgcc-c++autoconfautomakezlib*fiex*libxml*ncurses-devellibmcrypt*libtool-ltdl-devel*cmakecmake-guilibaio-develbison-develmake错误:写入失败mysqld_safeLoggingto'/usr/local/mysql/data/CentOS7.err'.1修改data目录权限chown–Rmysqldata经验:修改mysqlroot账户密码1#mysqladmin–urootpassword“NEWPASSWORD”#在centos7上不成功2#mysqladmin–uroot–pMysql>setpasswordfor‘root’@’localhost’=password(‘NEWPASSWORD’);3#mysqladmin–uroot–pMysql>updatemysql.usersetpassword=password(‘NEWPASSWORD’)whereuser=’root’;Mysql>flushprivileges;经验:启动mysql(开机启动mysql)1启动/关闭mysql#/usr/local/mysql/bin/mysqld_safe–user=mysql&#/usr/local/mysql/bin/mysqladminshutdown可以将/usr/local/mysql/bin加入系统路径中a在/etc/profile加入PATH=/usr/local/mysql/bin:$PATHb重启系统或者刷新配置立即生效#source/etc/profile2使用mysql.server命令#/usr/local/mysql/support-files/mysql.serverstart#/usr/local/mysql/support-files/mysql.serverstop3开机自动启动mysql在/usr/lib/systemd/system/中创建mysql.service文件,内容如下:[Unit]Description=MySQLCommunityServerAfter=network.target[Install]WantedBy=multi-user.target[Service]User=mysqlGroup=mysqlPermissionsStartOnly=true#ExecStartPre=/usr/share/mysql/mysql-systemd-startpreExecStart=/usr/local/mysql/bin/mysqld_safe--user=mysqlExecStop=/usr/local/mysql/bin/mysqladminshutdown#ExecStartPost=/usr/share/mysql/mysql-systemd-startpostTimeoutSec=600Restart=on-failurePHP源码安装错误:configure:error:CannotfindOpenSSL's<evp.h>1sudoyuminstallphpphp-devel错误:error:PleasereinstalltheBZip2distribution1sudoyuminstallbzip2bzip2-devel编译PHP5.5.6时安装mcrypt2.6.8(2013-11-2016:52:44)转载▼标签:mcryptmhashlibmcryptld_library_pathlibmhashit 分类:Linux按顺序安装下列库:1.libmcrypt2.5.82.mhash3.mcrypt2.6.8问题出在安装mcrypt2.6.8的时候,编译时报错:checkingformhash_keygenin-lmhash...noconfigure:error:"Youneedatleastlibmhash0.8.15tocompilethisprogram.在安装mcrypt之前先配置路径###exportLD_LIBRARY_PATH=/usr/local/libmcrypt/lib:/usr/local/mhash/lib###exportLDFLAGS="-L/usr/local/mhash/lib/-I/usr/local/mhash/include/"###exportCFLAGS="-I/usr/local/mhash/include/"###./configure--prefix=/usr/local/mcrypt/--with-libmcrypt-prefix=/usr/local/libmcrypt接下来的php编译参数需要添加这两项:--with-mcrypt=/usr/local/libmcrypt--with-mhash=/usr/local/mhash经验:编译php./configure--prefix=/usr/local/php--with-mysql=/usr/local/mysql--with-openssl--with-mysqli=/usr/local/mysql/bin/mysql_config--enable-mbstring--with-freetype-dir--with-jpeg-dir--with-png-dir--with-zlib--with-libxml-dir=/usr--enable-xml--with-apxs2=/usr/local/apache2/bin/apxs--with-mcrypt=/usr/local/libmcrypt--with-config-file-path=/usr/local/php5/etc--with-config-file-scan-dir=/usr/local/php5/etc/php.d--with-bz2--enable-sockets--with-snmp=/usr/local/net-snmp安装rrdtool错误:libpngpangocairo1yuminstalllibpng-devellibpng-static2yuminstallpango-develcairo-develUseraddcactiuser–s/sbin/nologincrontab-ucactiuser-e

*/1****/usr/local/php5/bin/php/usr/local/apache/htdocs/cacti/poller.php>/dev/null2>&1crontab–ucactiuser–l安装nagios错误:Notrunning以及cgi不执行Httpd.conf启用:LoadModulecgid_modulemodules/mod_cgid.soNCPAasitisusinganon-standardport(5693)Windows测试:https://localhost:5693/api/?token=public

./check_nrpe-H29-calias_cpuPDQDeployNpreport:5666NSCLIENT++使用自定义脚本[/settings/externalscripts/scripts]check_py=cmd/c"scripts\python\check_py.py"NRPE使用自定义脚本[root@nhserver1libexec]#vim/usr/local/nagios/etc/nrpe.cfg

command[nh_check_getload]=/usr/local/nagios/libexec/getload.pyIcinga安装1#rpm--import/icinga.key#curl-o/etc/yum.repos.d/ICINGA-release.repo/epel/ICINGA-release.repo#yummakecacheRHEL/CentOS7andFedora:#yuminstallicinga2#systemctlenableicinga2#systemctlstarticinga2下载单个文件,默认将输出打印到标准输出中(STDOUT)中curl通过-o/-O选项保存下载的文件到指定的文件中:

-o:将文件保存为命令行中指定的文件名的文件中

-O:使用URL中默认的文件名保存文件到本地1#将文件下载到本地并命名为mygettext.html2curl-omygettext.html/software/gettext/manual/gettext.html34#将文件保存到本地并命名为gettext.html5curl-O/software/gettext/manual/gettext.html#icinga2featurelist1安装icinga-web1)安装mysql,centos7之后用mariadb替代mysql,maria是mysql的一个分支,防止orcal对mysql进行闭源的风险。#yuminstallicinga2-ido-mysqlSettinguptheMySQLdatabaseSetupaMySQLdatabaseforIcinga2:#mysql-uroot-pmysql>CREATEDATABASEicinga;GRANTSELECT,INSERT,UPDATE,DELETE,DROP,CREATEVIEW,INDEX,EXECUTEONicinga.*TO'icinga'@'localhost'IDENTIFIEDBY'123179';AftercreatingthedatabaseyoucanimporttheIcinga2IDOschemausingthefollowingcommand:#mysql-uroot-picinga</usr/share/icinga2-ido-mysql/schema/mysql.sql2)EnablingtheIDOMySQLmoduleThepackageprovidesanewconfigurationfilethatisinstalledin/etc/icinga2/features-available/ido-mysql.conf.Youwillneedtoupdatethedatabasecredentialsinthisfile.Allavailableattributesareexplainedinthe

IdoMysqlConnectionobjectchapter.Youcanenablethe

ido-mysql

featureconfigurationfileusing

icinga2featureenable:#icinga2featureenableido-mysqlModule'ido-mysql'wasenabled.MakesuretorestartIcinga2forthesechangestotakeeffect.Afterenablingtheido-mysqlfeatureyouhavetorestartIcinga2:Debian/Ubuntu,RHEL/CentOS6andSUSE:#serviceicinga2restartRHEL/CentOS7andFedora:#systemctlrestarticinga23)SettingUpExternalCommandPipeWebinterfacesandotherIcingaaddonsareabletosendcommandstoIcinga2throughtheexternalcommandpipe.YoucanenabletheExternalCommandPipeusingtheCLI:#icinga2featureenablecommand4)Bydefaultthecommandpipefileisownedbythegroup

icingacmd

withread/writepermissions.Addyourwebserver'susertothegroup

icingacmdtoenablesendingcommandstoIcinga2throughyourwebinterface:#usermod-a-Gicingacmddaemondaemon是apache2的运行账户,这里可以是其它用户自定义的账户,请注意查看。Youcanverifythattheuserhasbeensuccessfullyaddedtothe

icingacmdgroupusingthe

id

command:$id<your-webserver-user>gitclonegit:///icingaweb2.gitmvicingaweb2/usr/share/icingaweb2./bin/icingaclisetupconfigwebserverapache--document-root/usr/local/icingaweb2/public>/usr/local/apache2/conf/extra/icingaweb2.confPHPFatalerror:CalltoundefinedfunctionIcinga\Util\bindtextdomain()in/usr/local/icingaweb2/library/Icinga/Util/Translator.phponline158安装gettext,php加载gettext模块安装php的模块有两种方式:一、重新编译php,加上--with-gettext二、动态安装现在说下第二个动态安装1、下载同版本的php原包,解压后进入ext目录,目录下便是模块2、进入gettext目录下执行:/usr/local/php/bin/phpize./configure--with-php-config=/usr/local/php/bin/php-config(以上两个命令的路径根据自己系统情况而定)makemakeinstall3、在php.ini里添加上gettext.soextension="gettext.so"重启php即可extension=/usr/local/php5/lib/php/extensions/no-debug-zts-20131226/gettext.so在/usr/local/apache2/conf/http.conf中启用icingaweb2.confIncludeconf/extra/icingaweb2.conf5)[root@CentOS7icingaweb2]#groupadd-ricingaweb2[root@CentOS7icingaweb2]#usermod-a-Gicingaweb2daemon6)Use

icingacli

tocreatetheconfigurationdirectorywhichdefaultsto

/etc/icingaweb2:./bin/icingaclisetupconfigdirectoryWhenusingthewebsetupyouarerequiredtoauthenticateusingatoken.Inordertogenerateatokenusetheicingacli:./bin/icingaclisetuptokencreateIncaseyoudonotrememberthetokenyoucanshowitusingthe

icingacli:./bin/icingaclisetuptokenshowc4fbf84ca5d32185在浏览器中输入:1/icingaweb2/setup填写tokenFailedtosuccessfullyvalidatetheconfiguration:Canotfinddriver#./configure–with-php-config=/usr/local/php/bin/php-config–with-pdo-mysql=/usr/local/mysqlopensslpasswd-1password$1$ZG4d7BAp$ZfolJW124174MMy0OlL9B.Yum安装icinga2&icingaweb2#rpm--import/icinga.key#curl-o/etc/yum.repos.d/ICINGA-release.repo/epel/ICINGA-release.repo#yummakecachee#yuminstallicinga2#systemctlenableicinga2#systemctlstarticinga2Icingaweb2#yuminstallmariadb-servermariadb#systemctlenablemariadb#systemctlstartmariadb#mysql_secure_installation#yuminstallicinga2-ido-mysqlSetupaMySQLdatabaseforIcinga2:#mysql-uroot-pmysql>CREATEDATABASEicinga;GRANTSELECT,INSERT,UPDATE,DELETE,DROP,CREATEVIEW,INDEX,EXECUTEONicinga.*TO'icinga'@'localhost'IDENTIFIEDBY'123179';AftercreatingthedatabaseyoucanimporttheIcinga2IDOschemausingthefollowingcommand:#mysql-uroot-picinga</usr/share/icinga2-ido-mysql/schema/mysql.sqlEnablingtheIDOMySQLmoduleThepackageprovidesanewconfigurationfilethatisinstalledin/etc/icinga2/features-available/ido-mysql.conf.Youwillneedtoupdatethedatabasecredentialsinthisfile.Allavailableattributesareexplainedinthe

IdoMysqlConnectionobjectchapter.Youcanenablethe

ido-mysql

featureconfigurationfileusing

icinga2featureenable:#icinga2featureenableido-mysqlModule'ido-mysql'wasenabled.MakesuretorestartIcinga2forthesechangestotakeeffect.#systemctlrestarticinga2RHEL/CentOS7specific:#firewall-cmd--add-service=http#firewall-cmd--permanent--add-service=httpSettingUpExternalCommandPipeWebinterfacesandotherIcingaaddonsareabletosendcommandstoIcinga2throughtheexternalcommandpipe.YoucanenabletheExternalCommandPipeusingtheCLI:#icinga2featureenablecommand#systemctlrestarticinga2Bydefaultthecommandpipefileisownedbythegroup

icingacmd

withread/writepermissions.Addyourwebserver'susertothegroup

icingacmdtoenablesendingcommandstoIcinga2throughyourwebinterface:#usermod-a-Gicingacmdwww-dataYouneedtoaddtheIcingarepositorytoyourpackagemanagementconfigurationforinstallingIcingaWeb2.Belowisalistwithexamplesforvariousdistributions.RHELandCentOS:rpm--import/icinga.keycurl-o/etc/yum.repos.d/ICINGA-release.repo/epel/ICINGA-release.repoyummakecache安装epel下载:/wiki/EPEL#How_can_I_use_these_extra_packages.3FRpm–ivhepel-release-latest-7.noarch.rpm安装插件yuminstallnagios-plugins-allRHEL,CentOSandFedora:yuminstallicingaweb2icingacliPreparingWebSetupYoucansetupIcingaWeb2quicklyandeasilywiththeIcingaWeb2setupwizardwhichisavailablethefirsttimeyouvisitIcingaWeb2inyourbrowser.Whenusingthewebsetupyouarerequiredtoauthenticateusingatoken.Inordertogenerateatokenusethe

icingacli:icingaclisetuptokencreateIncaseyoudonotrememberthetokenyoucanshowitusingthe

icingacli:icingaclisetuptokenshowFinallyvisitIcingaWeb2inyourbrowsertoaccessthesetupwizardandcompletetheinstallation:

/icingaweb2/setup.Setenforce0constPluginDir="/usr/lib64/nagios/plugins"Error:FailedtosendexternalIcingacommand.Noneoftheconfiguredtransportswasabletotransferthecommand.Pleaseseethelogformoredetails.Selinux的问题。Setenforce0安装nrpe插件nagios-plugins-nrpeobjectHost"centos63"自定义注意一定要写双引号tarxvzficinga-nrpe-2.14.tar.gzZABBIX1安装zabbixrepo/zabbix/2.4/rhel/7/SRPMS/下载zabbix-release-2.4-1.el7.src.rpm在linux上#rpmbuild–rebuild–cleanzabbix-release-2.4-1.el7.src.rpm#rpm–ivh/root/rpmbuild/RPMS/noarch/zabbi

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论