Directadmin到期 更换license的步骤

  1. cd /usr/local/directadmin/scripts
  2. ./getLicense.sh 你的client_ID 新的DA_LicenseIP
  3. service directadmin restart

for english people:
how to fix the expired issue for directadmin,
when you trying to log into your DA control panel and it showing:
License has expired, it means you need to start a new subscription.
log into your DA server by ssh,
cd in your DA path ( default is /usr/local/directadmin/scripts)
run the getLicense.sh with your client id and new license , new IP address.
Eg, ./getLicense.sh Your_Client_ID Your_new_DA_Licnese NewIP
./getLicense.sh 112233 123456 1.2.3.4
finally,just type command to restart the DA service,
service directadmin restart

centos配置vpn 基于pptpd

centos上配置vpn并指定出口IP

  1. 添加centos的源
  2. /etc/yum.repos.d/CentOS-Base.repo 
  3.  
  4. [doylenet]
  5. name=Doylenet custom repository for CentOS
  6. baseurl=http://files.doylenet.net/linux/yum/centos/5/i386/doylenet/
  7. gpgcheck=1
  8. gpgkey=http://files.doylenet.net/linux/yum/centos/RPM-GPG-KEY-rdoyle
  9. enabled=1
  10.  
  11. yum install ppp pptpd.i386 -y
  12.  
  13. echo 1 > /proc/sys/net/ipv4/ip_forward 
  14. sysctl -p
  15.  
  16. 修改 /etc/pptpd.conf
  17. 注释掉logwtmp
  18. 并添加IP范围
  19. localip 10.0.0.1
  20. remoteip 10.0.0.2-254
  21.  
  22. 修改 /etc/ppp/options.pptpd
  23. 添加DNS
  24. ms-dns 8.8.8.8
  25. ms-dns 8.8.4.4
  26.  
  27. 添加用户名密码
  28. /etc/ppp/chap-secrets 
  29.  
  30. iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -j SNAT --to-source YourIPs
  31. iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -j MASQUERADE #或者轮询

centos5更新kernel

centos5 更新kernel

yum list kernel*

yum install kernel-PAE.i686 -y
# PAE为支持大内存的版本

reboot 后就可以

#查看32位或64位系统
file /sbin/init

未更新前: 2.6.18-164.el5PAE
更新后: 2.6.18-194.8.1.el5PAE

修复proftpd的550 Forbidden filename

公司客户的机器,装的是webmin+virtualmin
上传文件提示550 forbidden filename
把/etc/proftpd.conf里的这两行注释掉
PathAllowFilter “”
PathDenyFilter “”
proftpd的官方网站上有详细的解释:
http://www.proftpd.org/docs/directives/linked/config_ref_PathDenyFilter.html
http://www.proftpd.org/docs/directives/linked/config_ref_PathAllowFilter.html

重启ftp服务恢复

客户讲放着没动过,FTP自己变成这样,这年头有的人可真厉害,睁眼说瞎话哈~

proftpd启动报错

proftpd启动报错
proftpd默认没有开启日志的记录,所以/var/log/proftpd/ 这个目录下是空的

  1. [root@centos proftpd]# service proftpd restart
  2. Shutting down proftpd:                                     [FAILED]
  3. Starting proftpd:                                          [FAILED]

由于客户的服务器没有开启日志,查不到相关报错信息,/var/log/messages也没有

运行:

  1. proftpd --configtest

可以看到

  1. IPv4 getaddrinfo 'xxx.com' error: Name or service not known

写入/etc/hosts里
Your_IP_Address Your_domain_name

  1. [root@centos proftpd]# service proftpd restart
  2. Shutting down proftpd:                                     [FAILED]
  3. Starting proftpd:                                          [  OK  ]

最好打开日志以便查找问题:

  1. echo 'SystemLog                       /var/log/proftpd/proftpd.log' >> /etc/proftpd.conf && service proftpd reload