แสดงกระทู้

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - golfreeze

Pages: 1 ... 3 4 [5] 6 7 ... 141
61
/usr/local/etc/rc.d/pure-ftpd: WARNING: run_rc_command: cannot run /usr/local/sbin/pure-config.pl

=== re-build pureftpd & dovecot again.
cd /usr/local/directadmin/custombuild
Check versions.txt see pureftpd if found version then
./build pureftpd
./build dovecot

62
=== freebsd 11.x 64bit compile directadmin and failed on snail

/usr/local/directadmin/custombuild/s-nail-14.9.19/src/mx/xtls.c:1937:20: warning: incompatible integer to pointer conversion assigning to 'const EVP_MD *'
      (aka 'const struct env_md_st *') from 'int' [-Wint-conversion]
         fprnt_mdp = a_XTLS_FINGERPRINT_DEFAULT_DIGEST();
                   ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/directadmin/custombuild/s-nail-14.9.19/src/mx/xtls.c:1942:27: warning: implicit declaration of function 'TLS_client_method' is invalid in C99
      [-Wimplicit-function-declaration]
   if((ctxp = SSL_CTX_new(mx_XTLS_CLIENT_METHOD())) == NULL){
                          ^
/usr/local/directadmin/custombuild/s-nail-14.9.19/include/mx/gen-config.h:379:31: note: expanded from macro 'mx_XTLS_CLIENT_METHOD'
#define mx_XTLS_CLIENT_METHOD TLS_client_method
                              ^
/usr/local/directadmin/custombuild/s-nail-14.9.19/src/mx/xtls.c:1942:27: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'const SSL_METHOD *'
      (aka 'const struct ssl_method_st *') [-Wint-conversion]
   if((ctxp = SSL_CTX_new(mx_XTLS_CLIENT_METHOD())) == NULL){
                          ^~~~~~~~~~~~~~~~~~~~~~~
/usr/local/directadmin/custombuild/s-nail-14.9.19/include/mx/gen-config.h:379:31: note: expanded from macro 'mx_XTLS_CLIENT_METHOD'
#define mx_XTLS_CLIENT_METHOD TLS_client_method
                              ^
/usr/include/openssl/ssl.h:2131:40: note: passing argument to parameter 'meth' here
SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth);
                                       ^
4 warnings and 7 errors generated.
gmake[1]: *** [mk-config.mk:421: mx-072.o] Error 1
gmake[1]: Leaving directory '/usr/local/directadmin/custombuild/s-nail-14.9.19/.obj'
gmake: *** [makefile:25: build] Error 2
Could not find /usr/local/directadmin/scripts/directadmin_cron or it is empty

====> how to fixed
snail is use your old openssl and not openssl 1.1.1

and also my problem in the past.

You may set 0 as the version in custom_versions.txt for it.
cd /usr/local/directadmin/custombuild
vi custom_versions.txt
s-nail:0

=== manually install s-nail package in freebsd
pkg install s-nail

===then run setup again.
./setup auto

63
[100%] Built target pfs_connect_attr-t
Make complete
Packaging mysql-5.7.27...
CPack: Create package using TGZ
CPack: Install projects
CPack: - Run preinstall target for: MySQL
CPack: - Install project: MySQL
CPack: Create package
CPack: - package: /usr/local/directadmin/custombuild/mysql-5.7.27/mysql-5.7.27-freebsd11.3-x86_64.tar.gz generated.
Moving mysql-5.7.27-*.tar.gz to /usr/local/directadmin/custombuild ...
Done.
Cannot find mysql-5.7.27-freebsd11-x86_64.tar.gz for installation

===> ทำการแก้ไขโดย
cd /usr/local/directadmin/custombuild
cp mysql-5.7.27-freebsd11.3-x86_64.tar.gz mysql-5.7.27-freebsd11-x86_64.tar.gz
แล้วทำการ
./setup auto

64
ถ้ายังมี error ssl อยู่อาจจะต้องเอา configure -ssl ออกลองดูนะครับ
cd /usr/local/directadmin/custombuild/custom/php
vi configure.php56

delete
 --with-openssl=/usr/local/openssl-unsafe \

แล้วทำการรัน compile เฉพาะ php5.6
./build php_expert 5.6 php-fpm

===> เปิดอีก session ทำการ copy patch ext/mbstring/php_mbregex.c เข้าไปทับตัวที่ download source php-5.6.40 ไปด้วยนะครับ =>
cd /usr/local/directadmin/custombuild
cp php_mbregex.c php-5.6.40/ext/mbstring/.

===สุดท้ายทำการรัน
./build rewrite_confs

===reference
https://forum.directadmin.com/threads/migrating-from-openssl-to-openssl-unsafe.60104/page-2

65
cd /usr/local/directadmin/custombuild
mkdir -p custom/php
cp -p configure/php/configure.php53 custom/php/configure.php53
mkdir -p custom/fpm/.custom_openssl
touch custom/fpm/.custom_openssl
perl -pi -e 's|with-openssl|with-openssl=/usr/local/lib_http2|g' custom/php/configure.php53
wget ftp://ftp.openssl.org/source/openssl-1.0.2s.tar.gz
tar xzf openssl-1.0.2s.tar.gz
cd openssl-1.0.2s
./config --prefix=/usr/local/lib_http2 no-ssl2 no-ssl3 zlib-dynamic -fPIC
make depend
make install
./build php_expert 5.3 php-fpm

===> เปิดอีก session ทำการ copy patch ext/mbstring/php_mbregex.c เข้าไปทับตัวที่ download source php-5.6.40 ไปด้วยนะครับ =>
cd /usr/local/directadmin/custombuild
cp php_mbregex.c php-5.6.40/ext/mbstring/.

===สุดท้ายทำการรัน 
./build rewrite_confs

66
วันนี้มีเทส compile php5.6.x บน freebsd 12.x ดูครับแล้วพบว่ามี error เกี่ยวกับ onig_get_encoding
คือจริงๆ ใน directadmin ก็มีออก patch มาเพื่อแก้ไขตัว php_mb_regex_t

cd /usr/local/da/custombuild/php5.6/ext/mbstring

==== Start of Patch ====
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -454,7 +454,7 @@ static php_mb_regex_t *php_mbregex_compile_pattern(const char *pattern, int patlen, OnigOptionType options, OnigEncoding enc, OnigSyntaxType *syntax TSRMLS_DC)
   OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];

   found = zend_hash_find(&MBREX(ht_rc), (char *)pattern, patlen+1, (void **) &rc);
-   if (found == FAILURE || (*rc)->options != options || (*rc)->enc != enc || (*rc)->syntax != syntax) {
+   if (found == FAILURE || onig_get_options(*rc) != options || onig_get_encoding(*rc) != enc || onig_get_syntax(*rc) != syntax) {
      if ((err_code = onig_new(&retval, (OnigUChar *)pattern, (OnigUChar *)(pattern + patlen), options, enc, syntax, &err_info)) != ONIG_NORMAL) {
         onig_error_code_to_str(err_str, err_code, err_info);
         php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex compile err: %s", err_str);

==== End of Patch ====

OpenSSL version
It is known fact that PHP 5.x versions have issues to compile against OpenSSL 1.1.1. So first we need to install an alternative OpenSSL version. In FreeBSD ports we can find openssl-unsafe, which offers OpenSSL 1.0.2. So we install it

=== install portsnap on freebsd12.x
#portsnap fetch
#portsnap extract

cd /usr/ports/security/openssl-unsafe
make && make install

# /usr/local/openssl-unsafe/bin/openssl version
OpenSSL 1.0.2-chacha (1.0.2k-dev)

cd /usr/local/directadmin/custombuild
mkdir -p custom/php/
cp -p configure/php/configure.php5* custom/php/
mkdir -p custom/fpm/.custom_openssl
touch custom/fpm/.custom_openssl

perl -pi -e 's|with-openssl|with-openssl=/usr/local/openssl-unsafe|g' custom/php/configure.php5*

cd /usr/local/directadmin/custombuild
./build update
./build php

===> เปิดอีก session ทำการ copy patch ext/mbstring/php_mbregex.c เข้าไปทับตัวที่ download source php-5.6.40 ไปด้วยนะครับ =>
cd /usr/local/directadmin/custombuild
cp php_mbregex.c php-5.6.40/ext/mbstring/.

./build rewrite_confs

https://forum.directadmin.com/threads/migrating-from-openssl-to-openssl-unsafe.60104/


67
==== For FreeBSD 11.x , 12.x
wget --no-check-certificate https://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
wget http://www.nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gz

tar zxf nagios-plugins-2.1.1.tar.gz
cd nagios-plugins-2.1.1
useradd nagios
passwd nagios

./configure --with-nagios-user=nagios --with-nagios-group=nagios --enable-redhat-pthread-workaround && make && make install
chown nagios:nagios /usr/local/nagios
chown -R nagios:nagios /usr/local/nagios/libexec/

cd ..
tar zxf nrpe-2.15.tar.gz
cd nrpe-2.15

./configure
make all
make install-plugin
make install-daemon
make install-daemon-config

cp init-script /usr/local/etc/rc.d/nrpe
chmod 755 /usr/local/etc/rc.d/nrpe

/usr/local/etc/rc.d/nrpe restart

68
[Tue May 14 14:57:17.838720 2020] [proxy:error] [pid 20668:tid 140271263479552] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /usr/local/php72/sockets/web.sock (*) failed
[Tue May 14 14:57:17.838746 2020] [proxy_fcgi:error] [pid 20668:tid 140271263479552] [client 1.2.3.4:51451] AH01079: failed to make connection to backend: httpd-UDS

ทำการแก้ไขโดยทำการ restart php-fpm72 services 1 ครั้ง แล้วเข้าใช้งานอีกรอบก็จะทำให้ใช้งานได้ปกติครับ
สาเหตุน่าจะเกิดจากตอนทำการ compile php-fpm module แล้ว service ค้างค่า configure module เก่าไว้ครับ

==centos / ubuntu
systemctl restart php-fpm72

==freebsd
/usr/local/etc/rc.d/php-fpm72 restart

69
จาก error exim version 4.93.0.4 จะเป็น
2020-03-16 19:13:34 1jDvB8-000Hpr-8r attempt to expand tainted string '$originator_uid'
2020-03-16 19:13:34 1jDvB8-000Hpr-8r failed to expand condition "${perl{check_limits}}" for lookuphost router: syntax error in Exim::expand_string argument: attempt to expand tainted string '$originator_uid' at /etc/exim.pl line 479.

70
==exim 4.93.0.4 on directadmin could not send email , downgrade exim to 4.92.3
cd /usr/local/directadmin/custombuild
echo "exim:4.92.3:" > custom_versions.txt
./build exim


71
#pkg update and found error for wrong version and repo information
pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2

=== fixed by
#pkg bootstrap -f
#pkg update -f
#pkg upgrade

or
#pkg install rsync

== then update path
/usr/libexec/locate.updatedb

==rsync installed done.
# rsync --version
rsync  version 3.1.3  protocol version 31
Copyright (C) 1996-2018 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
    64-bit files, 32-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, symtimes, no prealloc, file-flags

rsync comes with ABSOLUTELY NO WARRANTY.  This is free software, and you
are welcome to redistribute it under certain conditions.  See the GNU
General Public Licence for details.

72
  +-------------------------------------+        +---------------------------------+
  |                 IPMI                |        |          GAMING CONSOLES        |
  |-------------------------------------|        |---------------------------------|
  | Sun SSP                 | $100,000+ |        | Xbox ONE X (RCE)     | $75,000+ |
  | Dell DRAC               | $100,000+ |        | Playstation 4 (RCE)  | $75,000+ |
  | HP iLO                  | $100,000+ |        | Nintendo (RCE)       | $50,000+ |
  | Supermicro IPMI         | $100,000+ |        +---------------------------------+
  | Cisco CIMC              | $50,000+  |
  | VNC, Teamviewer, Radmin | $50,000+  |
  | Other                   | $20,000+  |
  +-------------------------------------+

73
What is PGP (Pretty Good Privacy)?
Pretty Good Privacy (PGP) is a data encryption and decryption computer program that provides cryptographic privacy and authentication for data communication. PGP is often used for signing, encrypting, and decrypting texts, emails, files, directories, and whole disk partitions and to increase the security of email communications.
For more information:  http://en.wikipedia.org/wiki/Pretty_Good_Privacy

What is GPG (GNU Privacy Guard)?
GNU Privacy Guard is a free alternative to the PGP suite (owned by Symantec).  It is interoperable with PGP and operates similarly.
For more information:  http://en.wikipedia.org/wiki/GNU_Privacy_Guard

Start Using PGP
Gnupg.org has many resources to help get you started.  The site provides a nice GUI (graphical user interface) for Windows and Mac users.  Windows users can download GPG4Win from http://www.gpg4win.org/.  Mac users can download GPG Tools Suite from https://gpgtools.org/

Public and Private Keys
Understanding public and private keys is the key to using PGP encryption.  The user on each end of the communication must have a PGP key. Each public key is bound to an email address.  The sender will encrypt the message with the recipient’s public PGP key and the sender’s signature. When the recipient receives the message, they must use their passphrase (private key) in order to decrypt the message. 

Obtaining Keys
The following will show how to obtain your private and public key with GNU Privacy Assistant (GPG4Win).  The process is essentially the same on Apple machines.  However, you are able to search public keys by email address on Apple machines (on Windows you have to have the Key ID or the public key text/file).​

74
command , shell script ,tool , crontab / cp and history command
« on: เมษายน 19, 2020, 08:52:54 PM »
===copy command with same name and added _bck end of file name
cp events.py{,_bck}
ls
events.py
events.py_bck

history
!789
Run command on line 789 again

75
ในการ transfer file ระหว่าง os window -> os linux หรือ unix
บางทีจะมีพวก อักขระพิเศษต่างๆที่เพิ่มไประหว่างทาง ช่วงที่มีการ scp , wget ก็เกิดขึ้นได้
หลังจากที่ไฟล์ ที่เราต้องการ download วิ่งมาถึง linux , unix แล้ว

ต้องทำการรัน command dos2unix เพื่อลบอักขระพิเศษเหล่านั้นออก เพื่อให้สามารถ execute ได้
ถ้าไม่ทำอาจจะขึ้น ": no file or directory found" or error on line อะไรประมาณนี้ครับ

วิธีการรันก็คือ ถ้าชื่อไฟล์ที่มีการ transfer มาเป็น file.sh
#dos2unix file.sh

เท่านี้เราก็จะสามารถ รัน shell script ได้อย่างไม่มี error เรื่องอักขระพิเศษแล้วครับ

 ;)

Pages: 1 ... 3 4 [5] 6 7 ... 141