แสดงกระทู้

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 ... 7 8 [9] 10 11 ... 146
121
ถ้ามีการอัฟเกรดระบบ และถ้ามีการเรียกอัฟเกรด xz ไปด้วย จะทำให้ตอน boot os เจอ error ประมาณนี้ครับ
xz /usr/local/lib/liblzma.so.5 version XZ 5.2.2 not found (required by xz)
/lib64/liblzma.so.5: version `XZ_5.1.2alpha' not found (required by /lib/librpmio.so.5)

ทำการแก้ไขโดยใช้ ISO ของ CentOS7.x image โหลดเข้า "linux rescue" mode
ทำการเข้าไปในโหมด Option 1 (Continue) to get to the shell.

mount --bind /proc /mnt/sysimage/proc
mount --bind /dev /mnt/sysimage/dev
mount --bind /sys /mnt/sysimage/sys
chroot /mnt/sysimage
cd /usr/local/lib
unlink liblzma.so.5
ln -s /usr/lib64/liblzma.so.5  /usr/local/lib/liblzma.so.5

dracut -f
exit
cd /
sync
telinit 6

122
ทำการเพิ่ม
   location ~ .php$ {
                try_files $uri =404;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }

ลงไปในแถบ server ใน nginx.conf ดังข้างล่างครับ

vi /etc/nginx/nginx.conf

server {
    server_name www.packetlove.com packetlove.com; # managed by Certbot
        index index.php index.html index.htm;
        root         /var/www/it-money.com/public_html;
        include snippets/phpMyAdmin.conf;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        if ( !-e $request_filename ){
                rewrite ^/(.*)$ /index.php?/$1 last;
                break;
        }

        location / {
                try_files $uri $uri/ /index.html;
        }

         location ~ .php$ {
                try_files $uri =404;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
....

หลังจากนั้นทำการ restart nginx 1 รอบ

123
command , shell script ,tool , crontab / added routing in centos 8.x
« on: กรกฎาคม 22, 2020, 08:14:15 PM »
ถ้าต้องการทำ static route ใน centos 8.x เช่น
192.168.0.0/16 ให้วิ่งออก 192.168.1.254 สามารถทำได้ดังนี้
172.30.0.0/16 ให้วิ่งออก 192.168.1.254 สามารถทำได้ดังนี้

vi /etc/sysconfig/network-scripts/route-ens160
192.168.0.0/16 via 192.168.1.254
172.30.0.0/16 via 192.168.1.254


124
=== check status logstash
curl -XGET '10.2.8.123:9600/_node/stats/jvm?pretty'

=== test send curl post to logstash
curl -X GET "localhost:9600/?v"
curl -X GET "10.2.8.123:9600/?v"

=== test send stat to logstash server port 9600
curl -XGET '10.2.8.123:9600/_node/stats/events?pretty'

125
ทำการอัฟเกรด จาก zcoin 0.13 -> 0.14


1.ทำการ download ตาม os ที่ใช้งาน
https://github.com/zcoinofficial/zcoin/releases/tag/v0.14.0.1

2.แล้วทำการ backup wallet ก่อนจาก console version 0.13
File -> Backup Wallet

3. ปิดโปรแกรม zcoin console version 0.13

4. ทำการติดตั้ง zcoin console version 0.14

5. ทำการเปิดโปรแกรม zcoin version 0.14

6. ทำการ configure ตามลิ้ง
https://github.com/zcoinofficial/zcoin/wiki/Migrating-your-Legacy-Znodes-to-the-new-Deterministic-Znodes-system

Preparing for migration
Legacy Znodes can be registered as Deterministic Znodes with this command:

protx register collateralHash collateralIndex ipAndPort ownerAddress operatorPubKey votingAddress operatorReward payoutAddress feeSourceAddress

An example of how this would look like is as follows:

protx register 4950f88867b69760d3cd7c1f53531340f6723eb8f7d7f00730abfa12c5fe10e0 0 207.148.122.12:8168 TRVDAxJwaZYFfmti4aTeKCByz1jbMq8Jy4 995b3e1e2a65ce960a8cc7d305c5914b7f60e888c338c1f3317efbdcac58e82ecc110315ce03f49d9d387ff35c2796ad "" 0 TEZ8M8Fgp8h4HvUjXtjz3krYraRtySiXdw

This looks extremely complicated but don't worry! The guide will explain each field below.

127
all application on unix knowledges by golfreeze / rufus burn iso to boot disk usb on window 10
« on: มิถุนายน 23, 2020, 01:26:58 PM »
rufus burn iso to boot disk usb on window 10
https://github.com/pbatard/rufus/releases/download/v3.11/rufus-3.11.exe

หรือเข้าไป download จาก https://rufus.ie

128
ทำการ monitoring mysql_slave_status ติดตั้ง nrpe ที่เครื่อง mysql slave node แล้วทำการติดตั้ง script check_mysql_slavestatus.sh

===download script จาก
https://golfreeze.packetlove.com/check_mysql_slavestatus.sh
or
https://www.claudiokuenzler.com/monitoring-plugins/check_mysql_slavestatus.sh

ทำการเพิ่มใน nagios nrpe command
vi nrpe.cfg
### custom script by PKL ###
command[check_mysql_slavestatus]=/usr/local/nagios/libexec/check_mysql_slavestatus.sh -H 127.0.0.1 -P 3306 -u nagios -p checkstatus@

แล้วทำการ เพิ่มใน nagios ฝั่ง server
vi dbslave.cfg

define service{
        use                             local-service         ; Name of service template to use
        host_name                       dbslave.com
        service_description             Check_Mysql_Slave_Status
        check_command                   check_nrpe!check_mysql_slavestatus
        notifications_enabled           1
        }

ผลการแสดงจาก nagios จะแสดงเป็นดังนี้ พร้อมกับ ดูได้ว่า sync ตามหลัง master node อยู่กี่วินาที
OK: Slave SQL running: Yes Slave IO running: Yes / master: 192.168.1.9 / slave is 0 seconds behind master

special thank you for script from :
https://www.claudiokuenzler.com

129
/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

130
=== 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

131
[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

132
ถ้ายังมี 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

133
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

134
วันนี้มีเทส 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/


135
==== 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

Pages: 1 ... 7 8 [9] 10 11 ... 146