Category Archives: web

spinnaker

manifest, in kubernetes, it is used to create/modify resources, such as pod. Normally it is .yaml file. For example kubectl apply -f my-file.yaml artifact, a deployable resource. Could be docker image, git repo, github file, http file, s3 object etc chart, a combined K8S yaml manifests helm, is a tool. Similar to yum, apt in

Category: web

Bastion host configuration and private key in ~/.ssh folder,

We need to ssh to bastion host, from there, ssh to xxx.ec2.internal host. The configuration in ~/.ssh/config file is like below: Host *.ec2.internal     // it applies to every *.ec2.internal User hadoop     // the default username for final host. hadoop@xxx.ec2.internal, IdentityFile ~/.ssh/ssh-private.key    // the private ssh key UseKeychain yes ProxyCommand ssh username@xxx.bastion-host.com -W %h:%p. … Read More »

Category: web

nginx map, geo

below one will handle or not handle the request based on original country. geoip_country_code is a variable provided by nginx to tell the country of the IP. # Allowed countries # map $geoip_country_code $allowed_country { default no; country_code_1 yes; country_code_2 yes; } server { listen 80 default_server; listen [::]:80 default_server; # Disallow access based on GeoIP if… Read More »

Category: web

nginx rate limiter

  http { limit_req_zone $binary_remote_addr zone=mylimit:10m rate=2r/m; upstream myserver { server 127.0.0.1:8000; } server { listen 80; server_name myserver; location /api { limit_req mylimit; proxy_pass “http://myserver”; } } } $binary_remote_addr, meaning the rate limiter is based on per IP. Each IP has 2 request per minute; zone=mylimit:10m, define rate limiter name mylimit, use 10M to… Read More »

Category: web

Misconfiguration in DNS Forwarding which leads ERR_TOO_MANY_REDIRECTS

Today, I misconfigured DNS in GoDaddy Forwarding which caused this issue. In GoDaddy, I’ve setup Forwarding to my IP 11.11.11.11(sample IP). Then in the host, I have wordpress with below config in wp-config.php: define(‘WP_HOME’, ‘http://www.sample.com/’); define(‘WP_SITEURL’,’ http://www.sample.com/’); This means, my host will forward to www.sample.com. Then GoDaddy Forwarding setup will redirect to 11.11.11.11. Then wordpress… Read More »

Category: web

Setup a DNS name on GoDaddy for your host

First of all, some name concepts: A Name, mapping from alias to IP. For example: sample.com -> 11.11.11.11 CNAME, mappgin from alias to another alias. For example: www -> sample.com Below is a GoDaddy DNS page. Assume I registered a sample.com dns name. In the first row, it has type A ‘@‘ name. Put your hosting… Read More »

Category: web

wordpress installation issues

Mysql connection issue. If there is always connection issue. Try update mysql password with mysql_native_password keyword. ALTER USER root@localhost identified with mysql_native_password by ‘your_password’; ‘Invalid default value’ = database install fail error It is because php is too strict to allow the script to run. vim /etc/my.cnf Add below: [mysqld] sql_mode=NO_ENGINE_SUBSTITUTION Unable to install plugin. Add below into wp-config.php… Read More »

Category: web