DA过期 Directadmin License has expired

Centos5 老古董上的 Directadmin 还在服役,登录控制面板提示: License has expired 检查License并未过期,原因是TLSv1.1与TLSv1.2无法在Centos5上正常工作,导致 Directadmin 无法正常更新License
  1. [root@hostname scripts]# ./getLicense.sh $client_id $license_id
  2. --2020-03-06 01:50:58--  https://www.directadmin.com/cgi-bin/licenseupdate?lid=$license_id&uid=$client_id
  3. Resolving www.directadmin.com... 216.144.255.179
  4. Connecting to www.directadmin.com|216.144.255.179|:443... connected.
  5. Unable to establish SSL connection.
  6. Error downloading the license file
  7. Error determining IP via myip.directadmin.com
  8. Trying license relay server...
  9. --2020-03-06 01:50:59--  https://license.directadmin.com/licenseupdate.php?lid=$license_id&uid=$client_id
  10. Resolving license.directadmin.com... 69.162.69.58, 185.42.221.168
  11. Connecting to license.directadmin.com|69.162.69.58|:443... connected.
  12. Unable to establish SSL connection.
  13. Error downloading the license file from relay server as well.
  14. Error determining IP via myip.directadmin.com
登录服务器
  1. echo 1 > /root/.insecure_download && chattr +i /root/.insecure_download ; cd /usr/local/directadmin/scripts && ./getLicense.sh $client_id $license_id && service directadmin restart || killall -TERM directadmin ; service directadmin start

Directadmin清空所有Tickets

  1. 即可清空所有工单,包括系统提示
  2. :> /usr/local/directadmin/data/admin/tickets.list
  3. rm -rf /usr/local/directadmin/data/tickets/*

apache 2.4无法安装mod_rpaf

  1. apache2.4已经有了mod_remoteip.so 但手头事情太多,没时间仔细研究,Directadmin无法正常加载,先行编译mod_rpaf达到要求
  2. 编译时提示的错误
  3. [root@server mod_rpaf-0.6]# apxs -i -c -n mod_rpaf-2.0.so mod_rpaf-2.0.c
  4. /var/www/build/libtool --silent --mode=compile gcc -std=gnu99 -prefer-pic   -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/usr/include/apache  -I/usr/include/apache   -I/usr/include/apache   -c -o mod_rpaf-2.0.lo mod_rpaf-2.0.c && touch mod_rpaf-2.0.slo
  5. mod_rpaf-2.0.c: In function 'rpaf_cleanup':
  6. mod_rpaf-2.0.c:150: error: 'conn_rec' has no member named 'remote_ip'
  7. mod_rpaf-2.0.c:151: error: 'conn_rec' has no member named 'remote_addr'
  8. mod_rpaf-2.0.c:151: warning: implicit declaration of function 'inet_addr'
  9. mod_rpaf-2.0.c:151: error: 'conn_rec' has no member named 'remote_ip'
  10. mod_rpaf-2.0.c: In function 'change_remote_ip':
  11. mod_rpaf-2.0.c:164: error: 'conn_rec' has no member named 'remote_ip'
  12. mod_rpaf-2.0.c:183: error: 'conn_rec' has no member named 'remote_ip'
  13. mod_rpaf-2.0.c:186: error: 'conn_rec' has no member named 'remote_ip'
  14. mod_rpaf-2.0.c:187: error: 'conn_rec' has no member named 'remote_addr'
  15. mod_rpaf-2.0.c:187: error: 'conn_rec' has no member named 'remote_ip'
  16. apxs:Error: Command failed with rc=65536
  17. .
  1. 解决办法:
  2. wget http://mirror.trouble-free.net/sources/mod_rpaf-0.6.tar.gz
  3. tar xzvf mod_rpaf-0.6.tar.gz
  4. cd mod_rpaf-0.6
  5. git clone git://gist.github.com/2716030.git
  6. patch < 2716030/mod_rpaf-2.0.c.patch
  7. apxs -i -c -n mod_rpaf-2.0.so mod_rpaf-2.0.c

Directadmin安装XCache

  1. mkdir -p /usr/local/src/xcache
  2. cd /usr/local/src/xcache
  3. wget http://xcache.lighttpd.net/pub/Releases/2.0.0/xcache-2.0.0.tar.gz
  4. tar zxf xcache-2.0.0.tar.gz 
  5. cd xcache-2.0.0
  6. ./configure --enable-xcache
  7. make && make install
  8.  
  9. /usr/local/lib/php/extensions/no-debug-non-zts-20060613/
  10.  
  11. vim /usr/local/etc/php5/cgi/php.ini
  12.  
  13. ########################################################################
  14. [xcache-common]
  15. ;; install as zend extension (recommended), normally "$extension_dir/xcache.so"
  16. zend_extension = /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so
  17. ; zend_extension_ts = /usr/local/lib/php/extensions/non-debug-zts-xxx/xcache.so
  18. ;; For windows users, replace xcache.so with php_xcache.dll
  19. zend_extension_ts = c:/php/extensions/php_xcache.dll
  20. ;; or install as extension, make sure your extension_dir setting is correct
  21. ; extension = xcache.so
  22. ;; or win32:
  23. ; extension = php_xcache.dll
  24.  
  25. [xcache.admin]
  26. xcache.admin.enable_auth = On
  27. xcache.admin.user = "mOo"
  28. ; xcache.admin.pass = md5($your_password)
  29. xcache.admin.pass = ""
  30.  
  31. [xcache]
  32. ; ini only settings, all the values here is default unless explained
  33.  
  34. ; select low level shm/allocator scheme implemenation
  35. xcache.shm_scheme =        "mmap"
  36. ; to disable: xcache.size=0
  37. ; to enable : xcache.size=64M etc (any size > 0) and your system mmap allows
  38. xcache.size  =               60M
  39. ; set to cpu count (cat /proc/cpuinfo |grep -c processor)
  40. xcache.count =                 1
  41. ; just a hash hints, you can always store count(items) > slots
  42. xcache.slots =                8K
  43. ; ttl of the cache item, 0=forever
  44. xcache.ttl   =                 0
  45. ; interval of gc scanning expired items, 0=no scan, other values is in seconds
  46. xcache.gc_interval =           0
  47.  
  48. ; same as aboves but for variable cache
  49. xcache.var_size  =            4M
  50. xcache.var_count =             1
  51. xcache.var_slots =            8K
  52. ; default ttl
  53. xcache.var_ttl   =             0
  54. xcache.var_maxttl   =          0
  55. xcache.var_gc_interval =     300
  56.  
  57. ; N/A for /dev/zero
  58. xcache.readonly_protection = Off
  59. ; for *nix, xcache.mmap_path is a file path, not directory.
  60. ; Use something like "/tmp/xcache" if you want to turn on ReadonlyProtection
  61. ; 2 group of php won't share the same /tmp/xcache
  62. ; for win32, xcache.mmap_path=anonymous map name, not file path
  63. xcache.mmap_path =    "/dev/zero"
  64.  
  65.  
  66. ; leave it blank(disabled) or "/tmp/phpcore/"
  67. ; make sure it's writable by php (open_basedir is not checked)
  68. xcache.coredump_directory =   ""
  69.  
  70. ; per request settings
  71. xcache.cacher =               On
  72. xcache.stat   =               On
  73. xcache.optimizer =           Off
  74.  
  75. xcache.test =                Off
  76. xcache.experimental =        Off
  77.  
  78. [xcache.coverager]
  79. ; per request settings
  80. ; enable coverage data collecting for xcache.coveragedump_directory and xcache_coverager_start/stop/get/clean() functions (will hurt
  81.  executing performance)
  82. xcache.coverager =          Off
  83.  
  84. ; ini only settings
  85. ; make sure it's readable (open_basedir is checked) by coverage viewer script
  86. ; requires xcache.coverager=On
  87. xcache.coveragedump_directory = ""
  88.  
  89. ########################################################################
  90.  
  91. 如果php -v提示找不到xcache.so 要进php.ini改成正确的xcache.so的路径
  92. [root@baiqiuyi ~]# php -v
  93. Failed loading /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so: /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so: cannot open shared object file: No such file or directory
  94. PHP 5.2.17 (cli) (built: Jun 28 2012 00:15:29) 
  95. Copyright (c) 1997-2010 The PHP Group
  96. Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
  97.     with the ionCube PHP Loader v4.0.10, Copyright (c) 2002-2011, by ionCube Ltd., and
  98.     with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
  99.  
  100. [root@baiqiuyi ~]# php -v
  101. PHP 5.2.17 (cli) (built: Jun 28 2012 00:15:29) 
  102. Copyright (c) 1997-2010 The PHP Group
  103. Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
  104.     with XCache v2.0.0, Copyright (c) 2005-2012, by mOo
  105.     with the ionCube PHP Loader v4.0.10, Copyright (c) 2002-2011, by ionCube Ltd., and
  106.     with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies

Directadmin安装eAccelerator

  1. mkdir -p /usr/local/src/eAccelerator
  2. cd /usr/local/src/eAccelerator
  3. wget http://dpvps.googlecode.com/files/eaccelerator-0.9.6.tar.bz2
  4. tar jxvf eaccelerator-0.9.6.tar.bz2
  5. cd eaccelerator-0.9.6/
  6. php -i|grep php.ini #查看php.ini路径
  7.  
  8. [root@baiqiuyi eaccelerator-0.9.6]# php -v
  9. PHP 5.2.17 (cli) (built: Jun 28 2012 00:15:29) 
  10. Copyright (c) 1997-2010 The PHP Group
  11. Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
  12.     with the ionCube PHP Loader v4.0.10, Copyright (c) 2002-2011, by ionCube Ltd., and
  13.     with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies
  14. [root@p1 eaccelerator-0.9.6]# php -i|grep '/usr/local/etc/php5/cgi/php.ini'
  15. Loaded Configuration File => /usr/local/etc/php5/cgi/php.ini
  16. [root@p1 eaccelerator-0.9.6]# export PHP_PREFIX="/usr/local"
  17. [root@p1 eaccelerator-0.9.6]# $PHP_PREFIX/php5/bin/phpize
  18. Configuring for:
  19. PHP Api Version:         20041225
  20. Zend Module Api No:      20060613
  21. Zend Extension Api No:   220060519
  22.  
  23. yum install autoconf automake -y && ./configure --enable-eaccelerator=shared  --with-php-config=$PHP_PREFIX/php5/bin/php-config
  24.  
  25. [root@baiqiuyi eaccelerator-0.9.6]# echo $?
  26. 0
  27. [root@baiqiuyi eaccelerator-0.9.6]# 如果输出为0
  28. [root@baiqiuyi eaccelerator-0.9.6]# make && make install
  29. [root@baiqiuyi eaccelerator-0.9.6]# vim /usr/local/etc/php5/cgi/php.ini
  30. G,再按O (大写字母O
  31.  
  32. [eaccelerator]
  33. zend_extension="/usr/local/php5/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so"
  34. eaccelerator.shm_size="32"
  35. eaccelerator.cache_dir="/tmp/eaccelerator"
  36. eaccelerator.enable="1"
  37. eaccelerator.optimizer="1"
  38. eaccelerator.check_mtime="1"
  39. eaccelerator.debug="0"
  40. eaccelerator.filter=""
  41. eaccelerator.shm_max="0"
  42. eaccelerator.shm_ttl="0"
  43. eaccelerator.shm_prune_period="0"
  44. eaccelerator.shm_only="0"
  45. eaccelerator.compress="1"
  46. eaccelerator.compress_level="9"
  47.  
  48. Esc,然后 shift + zz (按住shift键,按两次小写字母z
  49.  
  50. [root@baiqiuyi eaccelerator-0.9.6]# service httpd configtest #测试配置文件
  51. # 输出Syntax OK的话直接
  52. [root@baiqiuyi eaccelerator-0.9.6]# service httpd restart
  53. ###注意:eAccelerator的配置文件一定要放到ZendOptimizer ioncube之类的前面,否则会报错。
6 12345»...6