CentOS 6 (74)

add a user to the sudoers linux为用户添加sudo权限

  用sudo时提示"xxx is not in the sudoers file. This incident will be reported.其中XXX是你的用户名,也就是你的用户名没有权限使用sudo,我们只要修改一下/etc/sudoers文件就行了。下面是修改方 法: 1)进入超级用户模式。也就是输入"su -",系统会让你输入超级用户密码,输入密码后就进入了超级用户模式。(当然,你也可以直接用root用)  2)添加文件的写权限。也就是输入命令"chmod u+w /etc/sudoers"。  3)编辑/etc/sudoers文件。也就是输入命令"vim /etc/sudoers",输入"i"进入编辑模式,找到这一 行:"root ALL=(ALL) ALL"在起下面添加"xxx ALL=(ALL) ALL"(这里的xxx是你的用户名),然后保存(就是先按一 下Esc键,然后输入":wq")退出。  4)撤销文件的写权限。也就是输入命令"chmod u-w /etc/sudoers"。
Read more...

CentOS Linux: Fix bash: ntpdate: command not found centos

First you have to install ntp: Run as root: yum install ntp Then if you run ntpdate again you might get the error again. You can run ntpdate with: /usr/sbin/ntpdate 2.pool.ntp.org Replace 2.pool.ntp.org with another server if that doesn’t work. If you get a ntpdate[585863]: the NTP socket is in use, exiting Error, then run: /etc/init.d/ntpd stop Took me 10 precious minutes to update the time in a server … That’s a lot!
Read more...

proftp 权限

.ftpaccess DeleteAbortedStores off Umask 000 GroupOwner root <Limit RMD DELE RNFR RETR READ> Denyall </Limit> Order allow,deny Allow from xxx.xxx.xxx.xxx Deny from all
Read more...

proftpd 配置可以上传,但无法删除的特殊权限

常见的特殊的需求:对于FTP服务器上的某个部门的目录,要求:部门所有人员可以上传下载但无法删除(包括文件和目录)部门领导全部权限(包括删除)用redhat自带的vsftp实现起来比较困难,google了以后发现proftpd实现起来比较简单 例如:客服部部门成员member,可以上传下载,但是无法删部门主管manager,有全部权限下载安装:因为是CENTOS,直接下载rpm安装wget http://packages.sw.be/proftpd/proftpd-1.3.2-1.el5.rf.i386.rpm 安装之后主目录在/var/ftp配置文件为 /etc/proftpd.conf服务名为 proftpd 直接启动服务的情况是:系统用户直接登录,且被chroot在"家目录"下匿名用户无法登陆 设计实施:部门的目录放在/var/ftp/kefu(客服部),部门人员登录后被chroot在此目录下目录的所有者是主管manager目录的所有组是kefu目录权限为770(只有此部门的人员才可以进此目录) 设置如下:/var/ftp下的kefu目录drwxrwx--- 2 manager kefu 4096 Mar 3 13:11 kefu/etc/passwd文件的设置(将他们的主目录设为/var/ftp/kefu,shell改为/sbin/nologin不允许ssh)manager:x:501:502::/var/ftp/kefu:/sbin/nologinmember:x:502:503::/var/ftp/kefu:/sbin/nologin新建kefu组,member是组员 配置文件proftpd.conf <Directory /var/ftp/kefu> 对这个目录进行限制 umask 000 <Limit DELE RMD> DenyGroup kefu </Limit> </Directory> 解释: umask 000 此目录下所有用户上传的掩码都是000,这样新文件权限是666,新文件夹是777,这样做是为了保证member传的文件,其他人也可以删,默认掩码是022 <Limit DELE RMD> DenyGroup kefu 此目录下对于DELE(删除文件)RMD(删除目录)操作加以限制,对kefu组是拒绝,也就保证了kefu组成员无法执行删除操作.如果需要对单个用户(例如member)限制就用 DenyUser member 其实就是无法执行(DELE ,RMD)这两个ftp指令 整个思路:通过系统权限来允许所有的文件都可以对任何人读写(就是非创建者也可以删)通过限制FTP指令的执行来限制特定的用户(组)无法执行删除总的来说就是利用两个层面的限制实现对权限”先放,后收”
Read more...

centos 6 memcached php 5.3.x ius repo

  yum install -y memcached   yum install php53u-pecl-memcached   yum install php53u-pecl-memcache service memcached start   chkconfig memcached on   测试是否安装成功   ps aux|grep memcached    php.ini   添加    extension="memcache.so"     修改/etc/init.d/memcached文件   CACHESIZE=1024   service memcached restart   /etc/init.d/httpd restart
Read more...

Centos 6 x64 php 53 php 5.3 ius

wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/epel-release-6-5.noarch.rpm wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/ius-release-1.0-11.ius.el6.noarch.rpm rpm -Uvh ius-release*.rpm epel-release*.rpm yum install yum-plugin-replace yum replace php --replace-with php53u yum install -y php53u-* --skip-broken
Read more...

Centos 6 X86 php 53 ius

  X86   wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/i386/epel-release-6-5.noarch.rpmwget http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/i386/ius-release-1.0-10.ius.el6.noarch.rpmrpm -Uvh ius-release*.rpm epel-release*.rpm yum install yum-plugin-replace yum replace php --replace-with php53u yum install -y php53u-xml php53u-dom php53u-mcrypt php53u-gd php53u-mbstring php53u-mhash
Read more...

centos memcached php 5.2.17 ius repo

1 安装 IUS repo 自动打开 rpel 2. yum install -y memcached 3. yum install -y gcc make 4. service memcached start chkconfig memcached on pecl install memcache 5 php.ini 添加 extension="memcache.so" Configure Memcached The most important value to configure is CACHESIZE. For example following configuration shows 512MB memory for Memcached. Edit /etc/sysconfig/memcached file, enter: # vi /etc/sysconfig/memcached Sample Output: PORT="11211" USER="memcached" MAXCONN="1024" CACHESIZE="512" OPTIONS="" For high traffic websites you need to increase the following values: MAXCONN : Set 1024 max simultaneous connections. For high traffic websites increase this value as per requirement. CACHESIZE : Set 512MB max memory. For high…
Read more...

1and1 augement volum

How can I increase a logical volume?   Step 1 First, log into the server via SSH. Step 2 Once logged in, type df - h at the command prompt and hit ENTER. The partition and logical volume sizes will be listed including the used disk space. In the image below, the var logical volume is 4GB. Assume that ~9GB of web content will be uploaded to the /var folder. The disk space needs to be increased before there is enough space to upload the content. Further Explanation: df  This is the disk free space command which will display disk usage information.-h  This option forces the output to be in human…
Read more...

How to disable IPV6 on centos 6.x

The following procedure worked for me.1. Add the following lines in the files listed below:% vi /etc/modprobe.d/modprobe.confoptions ipv6 disable=1alias net-pf-10 offalias ipv6 offinstall ipv6 /bin/true% vi /etc/sysconfig/networkNETWORKING_IPV6=noIPV6INIT=no% vi /etc/sysconfig/network-scripts/ifcfg-ethx (x=0, 1, 2 …)IPV6INIT=no2. Disable ip6tables servicechkconfig ip6tables off3. Reboot your systeminit 6 or reboot---There is a step 4 at the website which mentions to rmmod ivp6, but I didn't need to do that. Referenced:http://mikent.wordpress.com/2012/02/04/how-to-disable-ipv6-on-redhat-6-x/
Read more...

Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/category.php on line 191