Create a Self-Signed Certificate with openssl on IBM i

`openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out certificate.pem`

or

call QP2TERM

openssl genrsa -des3 -out server.key 1024

openssl req -new -key server.key -out server.csr

cp server.key server.key.org

openssl rsa -in server.key.org -out server.key

Generate the Self-Signed Certificate with the command openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

The last optional command is to convert the certificate to a PKCS12 format with the command openssl pkcs12 -export -out exported.pfx -inkey server.key -in server.crt

 

Reference:

https://www.ibm.com/support/pages/how-create-self-signed-certificate-openssl

No Comments IBM i, Open Source, SSL

NGINX on IBM i

To start default configuration:

===> /QOpenSys/pkgs/bin/nginx -c /QOpenSys/etc/nginx/nginx.conf

To stop:

===> /QOpenSys/pkgs/bin/nginx -c /QOpenSys/etc/nginx/nginx.conf -s stop

To list processes:

===> ps aux | grep nginx

or

===> ps ax | grep nginx
===> ps -f -u ernest

Sample nginx configuration file:

worker_processes  3;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;

    keepalive_timeout  65;

    server {
        listen       9010;
        server_name  localhost;

        location / { try_files $uri @er; }
		location @er {
		    include fastcgi_params;
		    fastcgi_param PATH_INFO $fastcgi_script_name;
		    fastcgi_param SCRIPT_NAME "";
		    fastcgi_pass unix:/tmp/er9010f-fcgi.sock;
		}

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
        location ~ /\.ht {
            deny  all;
        }
    }
}

More on ps command: https://www.binarytides.com/linux-ps-command/

No Comments IBM i, NGINX, Open Source

Open Source on IBM i

===> /QOpenSys/pkgs/bin/yum install <package>

Add yum (and other packages) to your path if want to call it directly

===> PATH=/QOpenSys/pkgs/bin:$PATH
===> export PATH

or if you want to store it permanently in your profile

===> echo 'PATH=/QOpenSys/pkgs/bin:$PATH' >> $HOME/.profile
===> export PATH >> $HOME/.profile

Some useful yum commands

===> yum list available
===> yum list installed
===> yum list all
===> yum search <package>
===> yum remove <package>

Use rpm for more detailed info about packages. Following will show when was each individual package updated.

===> rpm -qa --last
===> rpm -q <package> --last

This command will list all installed files for a package

===> rpm -ql <package>

 

References:

http://www-01.ibm.com/support/docview.wss?uid=nas8N1022619

https://bitbucket.org/ibmi/opensource/src/master/docs/yum/

No Comments IBM i, Open Source, PASE

Install Zend Expressive on IBM i

$ composer create-project zendframework/zend-expressive-skeleton expressive
$ composer require zendframework/zend-db
$ composer require --dev "zendframework/zend-expressive-tooling:^0.4.1"
$ ./vendor/bin/expressive module:create MyModule
./vendor/bin/expressive middleware:create "MyModule\Action\ListModuleAction"
$ composer require tuupola/cors-middleware
$ composer require zendframework/zend-stratigility

 

No Comments Uncategorized

WordPress setup

  1. Setup direct updates omitting FTP
  2. define('FS_METHOD','direct');

    Change owner

  3. chown -Rv apache:apache /var/www/wordpress/
  4. Correct permissions for directories and files
  5. find /var/www/wordpress/ -type f -exec chmod 644 {} \;
    find /var/www/wordpress/ -type d -exec chmod 755 {} \;

    Selinux

  6. chcon -t httpd_sys_rw_content_t /var/www/wordpress/ -R
    setbool -P httpd_can_sendmail=1

     

No Comments Wordpress