Deploying Kubernetes Cluster With Ingress and Load Balancer on DigitalOcean

This article will give you the a simple way how to deploy a kubernetes cluster and it’s components on DigitalOcean Managed Kubernetes (DOKS). Along with my learning journey with kubernetes, I started to get my hands on trying kubernetes on DigitalOcean. It’s actually one of my favorite hosting platform that also offers Kubernetes managed service … Read more

Setup kubernetes cluster in Ubuntu 20.04 from scratch

Hello again, this article is a walk through how to setup your own kubernetes cluster with Ubuntu 20.04 LTS. Some steps are very straightforward, and you can directly follow along while you try to setup yourself. So before get started, I tried this using 2 ubuntu servers : ks8-master : 2gb memory, 2vCPUs k8s-node-0 : … Read more

Nginx: set the server_name as wildcard without hostname

Simple trick to run the nginx with no server_name. server { listen 80 default_server; server_name _; location / { root /path/to/app; index index.php; try_files $uri $uri/ /index.php?q=$uri&$args; location ~* \.php { try_files $uri =404; include fastcgi_params; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; } } }

Generate CSR for Nginx server

This is how to generate the .csr file, requirement for SSL certificate. $ openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr —– Country Name (2 letter code) [AU]:ID State or Province Name (full name) [Some-State]: Locality Name (eg, city) []: Organization Name (eg, company) [Internet Widgits Pty Ltd]: Organizational Unit Name (eg, section) … Read more

Setup python app in centos from scratch (centos 6.9+uwsgi+nginx+flask+mysql)

Initial setup $ sudo yum update $ sudo yum install epel-release $ sudo yum groupinstall “Development tools” $ sudo yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel telnet htop $ sudo yum install python-devel python-virtualenv $ sudo yum install mysql-connector-python mysql-devel mysql-server Install Python Download and install Python : https://www.python.org/ ./configure && make && make altinstall Install … Read more

Nginx config for staging application

resolver 172.17.0.1; resolver_timeout 10s; server { listen 80; server_name staging.app.com; charset utf-8; gzip_vary on; access_log /var/log/nginx/app.access.log; error_log /var/log/nginx/app.error.log; add_header ‘Access-Control-Allow-Origin’ ‘*’ always; add_header ‘Access-Control-Allow-Methods’ ‘GET, POST, OPTIONS, PUT, DELETE’ always; add_header X-Frame-Options “SAMEORIGIN”; set $appweb http://app-web.service.consul; location / { proxy_pass $appweb:5002; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $server_name; … Read more

WordPress still cannot Establishing a Database Connection – Error

Have you ever experiencing this problem like this? after your install wordpress, setup anything, webserver, database, everything is completed. Yet, wordpress still cannot establishing your database connection. Eventhough you’ve already make sure that your database is up and running (I’m using MySQL) and your port is already open, though. Trust me! I’ve done anything properly, … Read more

Configure php-fpm and nginx to run in low memory server

It was pain in the ass to have php-fpm and nginx together to serve php app, especially when you’re running on low-memory server, especially when you’re running cms like wordpress which basically heavy duty. I had a Centos server running with memory only 1024Mb (1Gb).

My web kept crushed every single time. And the problem stil remains, memory leak.

I don’t know what the root cause was. I still don’t know what that is but I think it’s something to do with php-fpm configuration or even nginx.

Just several days ago I had my blog up and running with wordpress in the same type of server, same OS (Centos) with the same memory (1Gb) and since I didn’t want to use apache for some reason, guess I had to get my nginx and php-fpm working together again.

I thought my web would be running very smoothly since the blog was still unlikely to receive much traffic. But I was wrong, somehow the memory was leaked again. My server only running with 1024Mb, but I thought It didn’t matter. The only way to get this problem mitigated is to tune up both the php-fpm and nginx configurations which I never liked this. But I need this, so let’s get this done.

Read more