Saturday, June 5, 2021

Portable Mongodb

wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian10-4.4.6.tgz

tar xvf mongodb-linux-x86_64-debian10-4.4.6.tgz

cd mongodb-linux-x86_64-debian10-4.4.6/

mkdir database

mkdir logs

touch logs/mongodb.log

nano start_mongo.sh

cd bin
./mongod --dbpath ../database --directoryperdb --logpath ../logs/mongodb.log &

nano stop_mongo.sh

cd bin
./mongod --dbpath ../database --directoryperdb --logpath ../logs/mongodb.log --shutdown


Dynamic install module Nginx

 Example for ModSecurity-nginx

$ cd nginx-version
$ ./configure --with-compat --add-dynamic-module=../ModSecurity-nginx
$ make modules
$ cp objs/ngx_http_modsecurity_module.so /etc/nginx/modules

Tuesday, June 1, 2021

Build Nginx from source for Debian 10

 apt install libssl-dev

wget https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz

tar -zxf pcre-8.44.tar.gz
cd pcre-8.44
./configure
make

cd \

wget http://zlib.net/zlib-1.2.11.tar.gz
tar -zxf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure
make

cd \

wget http://nginx.org/download/nginx-1.20.1.tar.gz

mkdir -p nginx/3party_module

mkdir -p nginx/nginx-rtmp-module

touch nginx/3party_module/config

touch nginx/nginx-rtmp-module/config

cd nginx-1.20.1

./configure --prefix=/home/othername/nginx --sbin-path=/home/othername/nginx/nginx --conf-path=/home/othername/nginx/nginx.conf --pid-path=/home/othername/nginx/nginx.pid --with-http_ssl_module --with-stream --with-mail=dynamic --add-module=/home/othername/nginx/nginx-rtmp-module --add-dynamic-module=/home/othername/nginx/3party_module  --with-pcre=../pcre-8.44 --with-zlib=../zlib-1.2.11

make

make install




Builde portable nodejs

wget https://nodejs.org/dist/latest-v12.x/node-v12.22.1-linux-x64.tar.gz

tar xvf node-v12.22.1-linux-x64.tar.gz


nano .profile

# Nodejs
VERSION=v12.22.1
DISTRO=linux-x64
export PATH=/home/lucian/node-$VERSION-$DISTRO/bin:$PATH

 

 


Sunday, September 27, 2020

Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

 OpenJDK 11


1. Export certificate from url

firefox - click on HTTPS certificate chain (the lock icon right next to URL address). Click "more info" > "security" > "show certificate" > "details" > "export..". Pickup the name and choose file type example.cer

chrome - click on site icon left to address in address bar, select "Certificate" -> "Details" -> "Export" and save in format "Der-encoded binary, single certificate".

2. Import cer to jdk

./keytool -import -trustcacerts -cacerts -storepass changeit -noprompt -alias file_name -file /path/to/file.pem



Monday, September 21, 2020

Allow remote connection MySQL

 

Your root account, and this statement applies to any account, may only have been added with localhost access (which is recommended).

You can check this with:

SELECT host FROM mysql.user WHERE User = 'root';

If you only see results with localhost and 127.0.0.1, you cannot connect from an external source. If you see other IP addresses, but not the one you're connecting from - that's also an indication.

You will need to add the IP address of each system that you want to grant access to, and then grant privileges:

CREATE USER 'root'@'ip_address' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'ip_address';

If you see %, well then, there's another problem altogether as that is "any remote source". If however you do want any/all systems to connect via root, use the % wildcard to grant access:

CREATE USER 'root'@'%' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';

Finally, reload the permissions, and you should be able to have remote access:

FLUSH PRIVILEGES;