cpanel关闭mysql strict mode的方法介绍

linux关闭mysql strict mode的方法非常简单下面我来给大家总结了些常用的关闭mysql strict mode模式的例子希望文章对各位同学会带来帮助

首先用putty连接linux终端

vi /etc/my.cnf

在最后一行看到:

sql-mode= NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

保存后service mysqld restart

Komentarji

Linux挂载ftp服务器

Linux挂载ftp服务器需要用到一个名为fuse-curlftpfs的包正常情况下无法通过yum的方式获取此包因此需要先安装DAG repository

Centos5 64位 wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm
Centos5 32位 wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.i386.rpm
Centos6 64位 wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
Centos6 32位 wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm
然后是安装下载的rpm包

rpm -ivh rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm
然后就可以通过yum的方式安装fuse-curlftpfs了

yum install fuse-curlftpfs -y
在Centos6上执行此命令可能会遇到 Requires: libcurl.so.3 的错误解决方法编辑 /etc/yum.repos.d/rpmforge.repo 文件 [rpmforge-extras] 项打开再执行 yum clean all 即可

接下来就可以挂载ftp了

写法1curlftpfs ftp://用户名:密码@ftp地址 挂载点 -o codepage=utf8
写法2curlftpfs ftp://ftp地址 挂载点 -o user=用户名:密码
Bodite pozorni:如果提示“fuse: failed to open /dev/fuse: Operation not permitted”说明你是在使用OpenVZ技术的Linux VPS的因为OpenVZ技术的缺陷性(所有小鸡共用母鸡的内核)导致无法使用curlftpfs命令请在Xen或者vmware技术中使用

开机自动挂载

echo “curlftpfs#用户名:密码@ftp地址 挂载点 fuse rw,allow_other,uid=0,gid=0 0 0” >> /etc/fstab

Komentarji

linux中下载ftp文件的几个方法

ena、最简单的方法: wget
下面的命令用来下载ftp服务器上指定目录的所有文件
[html] view plain copy print?
wget ftp://IP:PORT/*ftp-user=xxxftp-password=xxx -r
-r 参数表示递归下载
可以使用directory-prefix=/mypath/ 指定下载后存储路径;-nH选项可以不在本地创建服务器上的目录结构
另一个令人迷惑的选项是delete-after它并不是用来删除服务器上的已下载文件而是用来删除本机的
wget之所以是wget而不是wput它只能进行下载操作不支持对ftp服务器上的任何写操作比如删除
可以删除文件的方法:lftp
项目需求是下载ftp服务器上的指定文件夹取内的所有文件并于下载后删除wget不能满足要求于是改写出下面的脚本
mget命令可以下载多个文件,-E参数表示下载后删除服务器上的文件
[python] view plain copy print?
#!/bin/bash
#指定ftp服务器的ip
serverip=1.2.3.4
#指定ftp服务器的ftp用户
serveruser=root
#指定ftp服务器的ftp用户密码
serverpass=123456
#指定client主机本地下载文件存放的目录
localdir=./data
logfile=../log/ftp_download.log
#指定server主机的ftp目录
remotedir=./
#指定server主机的主机名
host=test_host
#切换到本地下载文件存放的目录
cd $localdir
#输入开始备份的信息
echo “Starting FTP Download on ” $host
#连接ftp服务器
/usr/bin/lftp << EOF open $serverip user $serveruser $serverpass #切换到server主机的ftp目录 echo "cd " $remotedir cd $remotedir #列出ftp服务器ftp目录中文件列表并存放到client中的$localdir中 ls . >> $logfile
#下载ftp服务器ftp目录中的所有文件
mget -E *.txt
#退出ftp服务器
bye
其他方法
系统中的ftp命令和强大的curl
curl支持FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET 和TFTP方便在自己的程序中调用同时支持cookie代理密码和证书验证非常强大

Komentarji

Disable SSLv2 on cPanel and Apache Ports

On this post we are going to show how to quickly patch a common PCI Vulnerability Alert that says something like this:
“The remote service appears to encrypt traffic using SSL protocol version 2?.

In Apache common ports 80 and 443, you need to modify the SSLCipherSuite directive in the httpd.conf or ssl.conf file.
An example would be editing the following lines to something like:

在whm路径

WHM > Apache Configuration > Global Configuration area

1.
SSLProtocol -ALL +SSLv3 +TLSv1
2.
SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP

After you have done this, if you see you are still getting PCI Compliance vulnerability emails regarding to this issue its probably that cPanel is still allowing SSLv2 on their ports.

To quickly disable SSL version 2 on cPanel ports: 2082, 2083, 2086, 2087, 2095, 2096. You will need to do the following:

edit /var/cpanel/cpanel.config and change nativessl=1 to nativessl=0

This will make cPanel to use sTunnel.

edit /usr/local/cpanel/etc/stunnel/default/stunnel.conf

and add:

1.
options = NO_SSLv2

just below the “Authentication stuff” tab.

After you have done all this you will need to restart cPanel:

1.
/etc/init.d/cpanel restart

Done!

How to quickly check this?

SSH to your server and type the following commands

1.
root@cPanel [~]# openssl s_client -ssl2 -connect localhost:2096
2.
root@cPanel [~]# openssl s_client -ssl2 -connect localhost:2083
3.
root@cPanel [~]# openssl s_client -ssl2 -connect localhost:2087
4.
root@cPanel [~]# openssl s_client -ssl2 -connect localhost:2086

If everything is fine you should receive something like this,

1.
root@cPanel [~]# openssl s_client -ssl2 -connect localhost:2096
2.
CONNECTED(00000003)
3.
write:errno=104

Komentarji

500 No response from subprocess (whostmgr (whostmgr)): The subprocess exited with status 127 (EKEYEXPIRED)

If you see such an error message after logging into cPanel, it says something is broken with the cPanel system. First step you should do is to take a look into the cPanel error log. An eaiest way to do this is, run the following command in command line and reload the WHM/cPanel inteface; that will show you the latest errors while loading the panel.

tail -f /usr/local/cpanel/logs/error_log

Once the error is identified, you may take corrective actions and fix errors. Many errors can be fixed by running a cPanel update, but sometime it needs additional troubleshooting steps.

For example, a sample error we were facing with one of the servers is following.

/usr/local/cpanel/whostmgr/bin/whostmgr: error while loading shared libraries: /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/cpanel_lib/x86_64-linux-64int/auto/Cpanel/Optimizer/Optimizer.so: cannot open shared object file: No such file or directory
Duplicate logaccess: at /usr/local/cpanel/Cpanel/Server.pm line 421.
Cpanel::Server::logaccess(Cpanel::Server=HASH(0x380aed0)) called at /usr/local/cpanel/Cpanel/Server.pm line 365
Cpanel::Server::body_internal_error(Cpanel::Server=HASH(0x380aed0), 500, “No response from subprocess (whostmgr (whostmgr)): The subpro”…) called at /usr/local/cpanel/Cpanel/Server.pm line 313

The error states, there is a missing library for whostmgr binary. We fixed the above error by running the following commands

/scripts/autorepair fix_duplicate_cpanel_rpms
/usr/local/cpanel/scripts/check_cpanel_rpmsfix

Komentarji

capnel whm gmail obvestilo

vi / etc / sysconfig / iptables

 

Pod požarnim zidom dodajte pravila

-INPUT -p tcp -m stanje –stanje NOVO -m tcp –dport 465 -j ACCEPT
/etc / init.d / iptables restart
#Končno, ponovno zaženite požarni zid konfiguracijo, da bo učinek

Komentarji

badblocks 检查硬盘是否有坏道

硬盘是比较容易坏掉的设备使用一段时间后可能会出现坏道等物理故障当硬盘出现坏道后若不及时更换或者进行技术上的处理磁盘的坏道就会越来越多并会造成频繁死机和数据丢失最好的处理方法是更换新的磁盘在临时的情况下我们应及时屏蔽坏道部分的扇区不要触动它们

badblocks是一个检查磁盘是否有坏道的工具可以以读的方式检查也可以以写的方式检查

这里我使用

badblocks -v /dev/sda

检查是否有坏道检查结果未出错

 

 

 

 

badblocks的参数选项

-b blocksize
指定磁盘的区块大小单位为字节默认值为“block 4K ”(4K/block)
-c blocksize
每个区块检查的次数默认是16次
-f
强制在一个已经挂载的设备上执行读写或非破坏性的写测试操作
(我们建议先umount设备然后再进行坏道检测仅当/etc/mtab出现误报设备挂载错误的时候可以使用该选项)
-i file
跳过已经显示在file文件中的坏道而不进行检测(可以避免重复检测)
-o file
把检测结果输出到file文件
-p number
重复搜寻设备直到在指定通过次数内都没有找到新的坏块位置默认次数为0
-s
在检查时显示进度
-t pattern
通过按指定的模式读写来检测区块你可以指定一个0到ULONG_MAX-1的十进制正值或使用random(随机)
如果你指定多个模式badblocks将使用第一个模式检测所有的区块然后再使用下一个模式检测所有的区块
Read-only方式仅接受一个模式它不能接受random模式的
-v
执行时显示详细的信息
-w
对每个区块都先写入然后再从它读取信息
[device]
指定要检查的磁盘装置
[last-block]
指定磁盘装置的区块总数
[start-block]
指定要从哪个区块开始检查

Komentarji

bash: scp: command not found lost connection问题解决

在内网从一台服务器传mysql源码安装包到另外一台服务器时发生如下的错误

[root@localhost ~]# scp mysql-5.1.55.tar.gz root@192.168.3.22:.
[email protected]’s password:
bash: scp: command not found
lost connection
提示scp的命令找不到但是查找发现命令是存在的
[root@localhost ~]# whereis scp
scp: /usr/bin/scp /usr/share/man/man1/scp.1.gz
[root@localhost ~]# find / -name scp
/usr/bin/scp
是因为没有加入到环境变量的原因?
evn查看已经加入了环境变量了
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
而且带上全路径执行的时候还是报相同的错误
[root@localhost ~]# /usr/bin/scp mysql-5.1.55.tar.gz [email protected]:.
[email protected]’s password:
bash: scp: command not found
lost connection
查看scp所依赖的包
[root@localhost ~]# rpm -qf /usr/bin/scp
openssh-clients-5.3p1-81.el6.i686
怀疑会不会是有其他的依赖包没有安装上重新安装一遍
[root@localhost ~]# yum install openssh-clients*
naloženi vstavki: fastestmirror, security
Hitrosti Nalaganje ogledalo iz predpomnilnika hostfile
* baza: centos.ustc.edu.cn
* epel: mirrors.ustc.edu.cn
* dodatki: centos.ustc.edu.cn
* posodobitve: centos.ustc.edu.cn
Nastavitev postopek namestitve
package openssh-clients-5.3p1-81.el6.i686 already installed and latest version
Nothing to do
提示已经安装了而且已经是最新的版本了
再测试的时候还是出现同样的错误纳尼如果是命令不存在或者找不到应该在scp命令敲出来之前就有问题啊而不应该是成功敲完命令之后再出现这个问题如果本地都没有问题那是另一端服务器上没有安装scp的命令?
[root@com ~]# whereis scp
scp:
[root@com ~]#
果真是如此所以是server端没有找到scp的命令而不是本地
安装上scp的依赖包
[root@com ~]# yum install openssh-clients*
安装好之后重新传输文件
[root@localhost ~]# scp mysql-5.1.55.tar.gz [email protected]:.
[email protected]’s password:
mysql-5.1.55.tar.gz
本文章

Komentarji

cpanel 突然发性出现403 修复

/scripts/rebuildhttpdconf
/scripts/restartsrv_httpd

Komentarji

centos7关闭防火墙

 

1. Disable Firewalld Service.

[root@rhel-centos7-tejas-barot-linux ~]# systemctl mask firewalld

2. Stop Firewalld Service.

[root@rhel-centos7-tejas-barot-linux ~]# systemctl stop firewalld

3. Install iptables service related packages.

[root@rhel-centos7-tejas-barot-linux ~]# yum -y install iptables-services

4. Make sure service starts at boot:

[root@rhel-centos7-tejas-barot-linux ~]# systemctl enable iptables

# If you do not want ip6tables, You can skip following command.

[root@rhel-centos7-tejas-barot-linux ~]# systemctl enable ip6tables

5. Now, Finally Let’s start the iptables services.

[root@rhel-centos7-tejas-barot-linux ~]# systemctl start iptables

# If you do not want ip6tables, You can skip following command.

[root@rhel-centos7-tejas-barot-linux ~]# systemctl start ip6tables

Firewalld Service is now disabled and stop, You can use iptables.

 

 

关闭 selinux

vi/etc/selinux/config

#SELINUX=enforcing
SELINUX=disabled

Komentarji

Iftop

iftop有什么用?

iftop可以用来监控网卡的实时流量(可以指定网段)反向解析IP显示端口信息等详细的将会在后面的使用参数中说明

namestitev Iftop

namestitev 1、Prevesti in namestiti

Če lahko zbere in namestite Iftop na uradni spletni strani, da prenesete najnovejši paket izvorne。

Pred namestitvijo nastajanje okolje, potrebno za osnovne potrebe, ki so bili nameščeni,Na primer, da、gcc、autoconf 等。Namestitev Iftop morali namestiti tudi libpcap in libcurses。

Potrebna za namestitev odvisnosti na CentOS:

yum install flex byacc libpcap ncurses ncurses-devel libpcap-devel

Potrebna za namestitev odvisnosti na Debian:

apt-get install flex byacc libpcap0.8 libncurses5

Prenos Iftop

wget http://www.ex-parrot.com/pdw/iftop/download/iftop-0.17.tar.gz

tar zxvf Iftop-0.17.tar.gz

CD Iftop-0.17

./konfiguracijo

Znamka && make install

Komentarji

网卡补丁

http://ftp.colocall.net/pub/elrepo/elrepo/el6/x86_64/RPMS/

Komentarji

! Ni bilo mogoče namestiti združenju CPAN PERL MODULE(S) Crypt::PASSWDMD5 !! - EASY APACHE

No, da se določi ta problem samo teči naslednji ukaz za namestitev Crypt::PasswdMD5

# /usr / local / cpanel / bin / cpanm -n Digest::SHA1 Crypt::PasswdMD5

Ko ste teči zgornjo kodo v SSH poskusiti znova Easy Apache.

Komentarji (1)

perl的module的安装

namestiti Digest::SHA1 Crypt::PasswdMD5

združenju CPAN> install Bundle::CPAN
združenju CPAN> reload cpan
združenju CPAN> install DateTime  združenju CPAN> install DBI  združenju CPAN> install DBD::mysql združenju CPAN> install Class::Autouse združenju CPAN> namestiti Digest::MD5 združenju CPAN> namestiti Digest::SHA1 združenju CPAN> install HTML::Template združenju CPAN> install Image::Size združenju CPAN> install MIME::Lite združenju CPAN> install MIME::Wordszdruženju CPAN> install Compress::Zlib združenju CPAN> install Net::DNS združenju CPAN> install URI::URL združenju CPAN> install HTML::Tagset združenju CPAN> install HTML::Parser združenju CPAN> install LWP::Simple združenju CPAN> install LWP::UserAgentzdruženju CPAN> install GD združenju CPAN> install Mail::Address združenju CPAN> install Unicode::MapUTF8 združenju CPAN> install XML::Simple združenju CPAN> install IO::WrapTie združenju CPAN> install Unicode::CheckUTF8 združenju CPAN> install Captcha::reCAPTCHA združenju CPAN> namestiti Digest::HMAC_SHA1

Preberite preostanek tega vnosa »

Komentarji

linux inode 占用100%的解决办法

什么是 inode ?

文件储存在硬盘上硬盘的最小存储单位叫做”扇区”(Sector)每个扇区储存512字节(相当于0.5KB)
操作系统读取硬盘的时候不会一个个扇区地读取这样效率太低而是一次性连续读取多个扇区即一次性读取一个”块”(block)这种由多个扇区组成的”块”是文件存取的最小单位”块”的大小最常见的是4KB即连续八个 sector组成一个 block
文件数据都储存在”块”中那么很显然我们还必须找到一个地方储存文件的元信息比如文件的创建者文件的创建日期文件的大小等等这种储存文件元信息的区域就叫做inode中文译名为”索引节点”
每一个文件都有对应的inode里面包含了与该文件有关的一些信息

如何查看系统的 innode 占用情况

df -ih

如何查找那个目录下文件最多

首先切到根目录 /

cd /

然后执行

for i in /*; do echo $i; find $i | wc -l; done

ali

for i in `ls -1A | grep -v "\.\./" | grep -v "\./"`; do echo "`find $i | sort -u | wc -l` $i"; done | sort -rn | head -10

这样会依次返回/目录下文件最多的目录,进入这个目录再执行上述命令就这样层层深入最终确定是那个目录文件最多

如何删除那个目录的的所有文件

一般情况下如果这个目录下应该会有数以百万的文件如果你直接用 rm -rf 目录名 的话效率会很低可以用下面方法

find 目录 -type f -name '*' -print0 | xargs -0 rm

时间可能会比较久所以你最好开一个 screen 来处理

有可能是你遇到了下面的情况

/var/spool/postfix/maildrop 下面有很多文件
为了避免可以执行 crontab -e
在最开头添加 MAILTO='"' skladiščenje,Potem server crond restart 重启 crond

Komentarji

« Prejšnja stran« Previous entries « Prejšnja stran · Next Page » Naslednji vnosi »Next Page »