ImageVerifierCode 换一换
格式:DOCX , 页数:18 ,大小:510.36KB ,
资源ID:4487097      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/4487097.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(CentOS7学习笔记.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

CentOS7学习笔记.docx

1、CentOS7学习笔记Apache 运行账号daemonMysql账号Root:123179Cacti:123179Cacti系统账号:cactiuser:123179(给rrd logs权限的账号,cron的运行账号)Cacti登录账号:admin:123179Nagios账号:Nagios系统账号:nagios, 组:nagios, nagcmdNagios WEB access账号:nagiosadmin:123179CentOS7源码安装apache错误:apr/apr-util1.下载apr/apr-util,解压至apache(httpd)目录./httpd-2.4-XX/srcl

2、ib,将arp/arp-util后缀中的数字去掉2.重新编译./httpd-2.4-XX/configure -prefix=/usr/local/apache2 -with-included-apr错误:pcre1.从pcre.org下载pcre,解压,编译,安装 ./pcre-xxx/configure -prefix=/usr/loca/pcre;make;make install2.重新编译./httpd-2.4-XX/configure -prefix=/usr/local/apache2 -with-included-apr -with-pcre=/usr/local/pcre错误

3、:gcc/gcc-c+1. sudo yum install gcc gcc-c+经验:安装系统开机启动服务1. /usr/lib/systemd/system (需要用户登录才启动的:/usr/lib/systemd/user)2. sudo vim /usr/lib/systemd/system/apache2.service3. UnitDescription= Apache2 http server servicesServiceType=forkingExecStart=/usr/local/apache2/bin/apachectl startExecReload=/usr/loc

4、al/apache2/bin/apachectl restartExecStop=/usr/local/apache2/bin/apachectl stopPrivateTmp=trueInstallWantedBy=multi-user.target4. chmod 754 apache2.service5. sudo systemctl enable/disable apache2.service6. sudo systemctl start/stop/restart apache2.service经验:CentOS7关闭默认防火墙sudo systemctl stop firewalld

5、.service或者放开防火墙端口Sudo firewall-cmd -permanent add-port=80/tcp错误:图形界面开机后could not apply the stored configurationrm f /.config/monitors.xmlCentOS7源码安装mysql经验:准备条件make, cmake, gcc-c+错误:FATAL ERROR: please install the following Perl modules before executing ./mysql_install_db:1.sudo yum install perl-Mod

6、ule-Install错误:Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH) CMake Error at cmake/readline.cmake:85 (MESSAGE): Curses library not found. Please install appropriate package, remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and der

7、ivates it is ncurses-devel.1. yum install ncurses-devel2. 删除CMakeCache.txt继续运行cmake .错误:CMake Error at info_macros.cmake:110 (FILE): file Internal CMake error when trying to open file: /home/osborn.lee/Downloads/mysql-5.6.26/Docs/INFO_BIN for writing.Call Stack (most recent call first): cmake/info_b

8、in.cmake:29 (CREATE_INFO_BIN)make2: * CMakeFiles/INFO_BIN Error 1make1: * CMakeFiles/INFO_BIN.dir/all Error 2make: * all Error 21.yum -y install gcc gcc-c+ autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* cmake cmake-gui libaio-devel bison-devel make错误:写入失败mysqld_sa

9、fe Logging to /usr/local/mysql/data/CentOS7.err.1 修改data目录权限chown R mysql data经验:修改mysql root账户密码1 #mysqladmin u root password “NEWPASSWORD” #在centos7上不成功2 #mysqladmin u root p Mysqlset password for rootlocalhost =password(NEWPASSWORD);3 #mysqladmin u root p Mysqlupdate mysql.user set password=passw

10、ord(NEWPASSWORD) where user=root; Mysqlflush privileges;经验:启动mysql(开机启动mysql)1 启动/关闭mysql#/usr/local/mysql/bin/mysqld_safe user=mysql&#/usr/local/mysql/bin/mysqladmin shutdown可以将/usr/local/mysql/bin加入系统路径中a 在/etc/profile加入PATH=/usr/local/mysql/bin:$PATHb 重启系统或者刷新配置立即生效#source /etc/profile2 使用mysql.s

11、erver命令#/usr/local/mysql/support-files/mysql.server start#/usr/local/mysql/support-files/mysql.server stop3 开机自动启动mysql在/usr/lib/systemd/system/中创建mysql.service文件,内容如下:UnitDescription=MySQL Community ServerAfter=network.targetInstallWantedBy=multi-user.targetServiceUser=mysqlGroup=mysqlPermissionsSt

12、artOnly=true#ExecStartPre=/usr/share/mysql/mysql-systemd-start preExecStart=/usr/local/mysql/bin/mysqld_safe -user=mysqlExecStop=/usr/local/mysql/bin/mysqladmin shutdown#ExecStartPost=/usr/share/mysql/mysql-systemd-start postTimeoutSec=600Restart=on-failurePHP源码安装错误:configure: error: Cannot find Ope

13、nSSLs 1 sudo yum install php php-devel错误:error: Please reinstall the BZip2 distribution1 sudo yum install bzip2 bzip2-devel编译PHP5.5.6时安装mcrypt2.6.8 (2013-11-20 16:52:44)转载标签: mcrypt mhash libmcrypt ld_library_path libmhash it 分类: Linux按顺序安装下列库:1. libmcrypt 2.5.82. mhash 0.9.9.93. mcrypt 2.6.8问题出在安装

14、mcrypt 2.6.8 的时候, 编译时报错:checking for mhash_keygen in -lmhash. noconfigure: error: You need at least libmhash 0.8.15 to compile this program.在安装mcrypt之前先配置路径#export LD_LIBRARY_PATH=/usr/local/libmcrypt/lib:/usr/local/mhash/lib#export LDFLAGS=-L/usr/local/mhash/lib/ -I/usr/local/mhash/include/#export

15、CFLAGS=-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

16、/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/

17、etc/php.d -with-bz2 -enable-sockets -with-snmp=/usr/local/net-snmp安装rrdtool错误:libpng pangocairo 1 yum install libpng-devel libpng-static2 yum install pango-devel cairo-develUseradd cactiuser s /sbin/nologincrontab -u cactiuser -e*/1 * * * * /usr/local/php5/bin/php /usr/local/apache/htdocs/cacti/poll

18、er.php /dev/null 2&1crontab u cactiuser l安装nagios错误:Not running 以及cgi不执行Httpd.conf启用:LoadModule cgid_module modules/mod_cgid.soNCPA as it is using a non-standard port (5693)Windows测试:https:/localhost:5693/api/?token=public./check_nrpe -H 10.16.93.229 -c alias_cpuPDQ DeployNpre port:5666NSCLIENT+使用自定

19、义脚本/settings/external scripts/scriptscheck_py = cmd /c scriptspythoncheck_py.pyNRPE使用自定义脚本rootnhserver1 libexec# vim /usr/local/nagios/etc/nrpe.cfgcommandnh_check_getload=/usr/local/nagios/libexec/getload.pyIcinga安装1 # rpm -import http:/packages.icinga.org/icinga.key# curl -o /etc/yum.repos.d/ICINGA

20、-release.repo http:/packages.icinga.org/epel/ICINGA-release.repo# yum makecacheRHEL/CentOS 7 and Fedora:# yum install icinga2# systemctl enable icinga2# systemctl start icinga2下载单个文件,默认将输出打印到标准输出中(STDOUT)中curl http:/www.centos.org通过-o/-O选项保存下载的文件到指定的文件中:-o:将文件保存为命令行中指定的文件名的文件中-O:使用URL中默认的文件名保存文件到本地1

21、 # 将文件下载到本地并命名为mygettext.html2 curl -o mygettext.html http:/www.gnu.org/software/gettext/manual/gettext.html34 # 将文件保存到本地并命名为gettext.html5 curl -O http:/www.gnu.org/software/gettext/manual/gettext.html# icinga2 feature list1 安装icinga-web1)安装mysql, centos7之后用mariadb替代mysql,maria是mysql的一个分支,防止orcal对my

22、sql进行闭源的风险。# yum install icinga2-ido-mysqlSetting up the MySQL databaseSet up a MySQL database for Icinga 2:# mysql -u root -pmysql CREATE DATABASE icinga; GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icinga.* TO icingalocalhost IDENTIFIED BY 123179;After creating the d

23、atabase you can import the Icinga 2 IDO schema using the following command:# mysql -u root -p icinga /usr/share/icinga2-ido-mysql/schema/mysql.sql2)Enabling the IDO MySQL moduleThe package provides a new configuration file that is installed in/etc/icinga2/features-available/ido-mysql.conf. You will

24、need to update the database credentials in this file.All available attributes are explained in theIdoMysqlConnection objectchapter.You can enable theido-mysqlfeature configuration file usingicinga2 feature enable:# icinga2 feature enable ido-mysqlModule ido-mysql was enabled.Make sure to restart Ici

25、nga 2 for these changes to take effect.After enabling the ido-mysql feature you have to restart Icinga 2:Debian/Ubuntu, RHEL/CentOS 6 and SUSE:# service icinga2 restartRHEL/CentOS 7 and Fedora:# systemctl restart icinga23)Setting Up External Command PipeWeb interfaces and other Icinga addons are abl

26、e to send commands to Icinga 2 through the external command pipe.You can enable the External Command Pipe using the CLI:# icinga2 feature enable command4)By default the command pipe file is owned by the groupicingacmdwith read/write permissions. Add your webservers user to the groupicingacmdto enabl

27、e sending commands to Icinga 2 through your web interface:# usermod -a -G icingacmd daemon daemon 是apache2的运行账户,这里可以是其它用户自定义的账户,请注意查看。You can verify that the user has been successfully added to theicingacmdgroup using theidcommand:$ id git clone git:/git.icinga.org/icingaweb2.gitmv icingaweb2 /usr/s

28、hare/icingaweb2./bin/icingacli setup config webserver apache -document-root /usr/local/icingaweb2/public /usr/local/apache2/conf/extra/icingaweb2.confPHP Fatal error: Call to undefined function IcingaUtilbindtextdomain() in /usr/local/icingaweb2/library/Icinga/Util/Translator.php on line 158安装gettex

29、t,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(以上两个命令的路径根据自己系统情况而定)makemake install3、在php.ini里添加上gettext.soextension = gettext.so重启php即可extens

30、ion=/usr/local/php5/lib/php/extensions/no-debug-zts-20131226/gettext.so在/usr/local/apache2/conf/http.conf中启用icingaweb2.confInclude conf/extra/icingaweb2.conf5)rootCentOS7 icingaweb2# groupadd -r icingaweb2rootCentOS7 icingaweb2# usermod -a -G icingaweb2 daemon6)Useicingaclito create the configuratio

31、n directory which defaults to/etc/icingaweb2:./bin/icingacli setup config directoryWhen using the web setup you are required to authenticate using a token. In order to generate a token use theicingacli:./bin/icingacli setup token createIn case you do not remember the token you can show it using theicingacli:./bin/icingacli setup

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1