CentOS7学习笔记Word文件下载.docx
- 文档编号:17419320
- 上传时间:2022-12-01
- 格式:DOCX
- 页数:18
- 大小:510.36KB
CentOS7学习笔记Word文件下载.docx
《CentOS7学习笔记Word文件下载.docx》由会员分享,可在线阅读,更多相关《CentOS7学习笔记Word文件下载.docx(18页珍藏版)》请在冰豆网上搜索。
经验:
安装系统开机启动服务
1./usr/lib/systemd/system(需要用户登录才启动的:
/usr/lib/systemd/user)
2.sudovim/usr/lib/systemd/system/apache2.service
3.[Unit]
Description=Apache2httpserverservices
[Service]
Type=forking
ExecStart=/usr/local/apache2/bin/apachectlstart
ExecReload=/usr/local/apache2/bin/apachectlrestart
ExecStop=/usr/local/apache2/bin/apachectlstop
PrivateTmp=true
[Install]
WantedBy=multi-user.target
4.chmod754apache2.service
5.sudosystemctlenable/disableapache2.service
6.sudosystemctlstart/stop/restartapache2.service
CentOS7关闭默认防火墙
sudosystemctlstopfirewalld.service
或者放开防火墙端口
Sudofirewall-cmd--permanent–add-port=80/tcp
图形界面开机后couldnotapplythestoredconfiguration
rm–f~/.config/monitors.xml
CentOS7源码安装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-devel
2.删除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]Error1
make[1]:
***[CMakeFiles/INFO_BIN.dir/all]Error2
make:
***[all]Error2
1.yum-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–p
Mysql>
setpasswordfor‘root’@’localhost’=password(‘NEWPASSWORD’);
3#mysqladmin–uroot–p
updatemysql.usersetpassword=password(‘NEWPASSWORD’)whereuser=’root’;
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:
$PATH
b重启系统或者刷新配置立即生效#source/etc/profile
2使用mysql.server命令
#/usr/local/mysql/support-files/mysql.serverstart
#/usr/local/mysql/support-files/mysql.serverstop
3开机自动启动mysql
在/usr/lib/systemd/system/中创建mysql.service文件,内容如下:
[Unit]
Description=MySQLCommunityServer
After=network.target
User=mysql
Group=mysql
PermissionsStartOnly=true
#ExecStartPre=/usr/share/mysql/mysql-systemd-startpre
ExecStart=/usr/local/mysql/bin/mysqld_safe--user=mysql
ExecStop=/usr/local/mysql/bin/mysqladminshutdown
#ExecStartPost=/usr/share/mysql/mysql-systemd-startpost
TimeoutSec=600
Restart=on-failure
PHP源码安装
configure:
error:
CannotfindOpenSSL'
s<
evp.h>
1sudoyuminstallphpphp-devel
error:
PleasereinstalltheBZip2distribution
1sudoyuminstallbzip2bzip2-devel
编译PHP5.5.6时安装mcrypt2.6.8(2013-11-2016:
52:
44)
转载
▼
标签:
mcryptmhashlibmcryptld_library_pathlibmhashit分类:
Linux
按顺序安装下列库:
1.libmcrypt2.5.8
2.mhash0.9.9.9
3.mcrypt2.6.8
问题出在安装mcrypt2.6.8的时候,编译时报错:
checkingformhash_keygenin-lmhash...no
"
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
libpngpangocairo
1yuminstalllibpng-devellibpng-static
2yuminstallpango-develcairo-devel
Useraddcactiuser–s/sbin/nologin
crontab-ucactiuser-e
*/1****/usr/local/php5/bin/php/usr/local/apache/htdocs/cacti/poller.php>
/dev/null2>
&
1
crontab–ucactiuser–l
安装nagios
Notrunning以及cgi不执行
Httpd.conf
启用:
LoadModulecgid_modulemodules/mod_cgid.so
NCPAasitisusinganon-standardport(5693)
Windows测试:
https:
//localhost:
5693/api/?
token=public
./check_nrpe-H10.16.93.229-calias_cpu
PDQDeploy
Npreport:
5666
NSCLIENT++使用自定义脚本
[/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.py
Icinga安装
1#rpm--importhttp:
//packages.icinga.org/icinga.key
#curl-o/etc/yum.repos.d/ICINGA-release.repohttp:
//packages.icinga.org/epel/ICINGA-release.repo
#yummakecache
RHEL/CentOS7andFedora:
#yuminstallicinga2
#systemctlenableicinga2
#systemctlstarticinga2
下载单个文件,默认将输出打印到标准输出中(STDOUT)中
curlhttp:
//www.centos.org
通过-o/-O选项保存下载的文件到指定的文件中:
-o:
将文件保存为命令行中指定的文件名的文件中
-O:
使用URL中默认的文件名保存文件到本地
1#将文件下载到本地并命名为mygettext.html
2curl-omygettext.htmlhttp:
//www.gnu.org/software/gettext/manual/gettext.html
3
4#将文件保存到本地并命名为gettext.html
5curl-Ohttp:
#icinga2featurelist
1安装icinga-web
1)安装mysql,centos7之后用mariadb替代mysql,maria是mysql的一个分支,防止orcal对mysql进行闭源的风险。
#yuminstallicinga2-ido-mysql
SettinguptheMySQLdatabase
SetupaMySQLdatabaseforIcinga2:
#mysql-uroot-p
mysql>
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.sql
2)EnablingtheIDOMySQLmodule
Thepackageprovidesanewconfigurationfilethatisinstalledin/etc/icinga2/features-available/ido-mysql.conf.Youwillneedtoupdatethedatabasecredentialsinthisfile.
Allavailableattributesareexplainedinthe
IdoMysqlConnectionobjectchapter.
Youcanenablethe
ido-mysql
featureconfigurationfileusing
icinga2featureenable:
#icinga2featureenableido-mysql
Module'
ido-mysql'
wasenabled.
MakesuretorestartIcinga2forthesechangestotakeeffect.
Afterenablingtheido-mysqlfeatureyouhavetorestartIcinga2:
Debian/Ubuntu,RHEL/CentOS6andSUSE:
#serviceicinga2restart
#systemctlrestarticinga2
3)SettingUpExternalCommandPipe
WebinterfacesandotherIcingaaddonsareabletosendcommandstoIcinga2throughtheexternalcommandpipe.
YoucanenabletheExternalCommandPipeusingtheCLI:
#icinga2featureenablecommand
4)Bydefaultthecommandpipefileisownedbythegroup
icingacmd
withread/writepermissions.Addyourwebserver'
susertothegroup
icingacmdtoenablesendingcommandstoIcinga2throughyourwebinterface:
#usermod-a-Gicingacmddaemon
daemon是apache2的运行账户,这里可以是其它用户自定义的账户,请注意查看。
Youcanverifythattheuserhasbeensuccessfullyaddedtothe
icingacmdgroupusingthe
id
command:
$id<
your-webserver-user>
gitclonegit:
//git.icinga.org/icingaweb2.git
mvicingaweb2/usr/share/icingaweb2
./bin/icingaclisetupconfigwebserverapache--document-root/usr/local/icingaweb2/public>
/usr/local/apache2/conf/extra/icingaweb2.conf
PHPFatalerror:
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
(以上两个命令的路径根据自己系统情况而定)
make
3、在php.ini里添加上gettext.so
extension="
gettext.so"
重启php即可
extension=/usr/local/php5/lib/php/extensions/no-debug-zts-20131226/gettext.so
在/usr/local/apache2/conf/http.conf中启用icingaweb2.conf
Includeconf/extra/icingaweb2.conf
5)[root@CentOS7icingaweb2]#groupadd-ricingaweb2
[root@CentOS7icingaweb2]#usermod-a-Gicingaweb2daemon
6)
Use
icingacli
tocreatetheconfigurationdirectorywhichdefaultsto
/etc/icingaweb2:
./bin/icingaclisetupconfigdirectory
Whenusingthewebsetupyouarerequiredtoauthenticateusingatoken.Inordertogenerateatokenusetheicingacli:
./bin/icingaclisetuptokencreate
Incaseyoudonotrememberthetokenyoucanshowitusingthe
icingacli:
./bin/icingaclisetup
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- CentOS7 学习 笔记
![提示](https://static.bdocx.com/images/bang_tan.gif)