Posts in the “technology” category

Amazon security flaw?

I was surprised to find out yesterday that you can change your Amazon email address without having to verify the change from your old email account. You only have to verify the new email address. That seems like a flaw.

How to configure Nginx to serve multiple static websites on one server

UPDATE: These days you should put your server configurations in files in the /etc/nginx/sites-enabled directory.

As a short note, if you need to configure Nginx to serve multiple static websites out of one nginx.conf file, I have been using this approach, and it seems to work well:

server {
    server_name  www.howisoldmybusiness.com;
    rewrite ^(.*) http://howisoldmybusiness.com$1 permanent;
}

server {
    server_name  howisoldmybusiness.com;
    listen       80;
    location / {
        root /var/www/howisoldmybusiness.com/html;
    }
    access_log  /var/log/nginx/hismb_access.log  main;
    error_log   /var/log/nginx/hismb_error.log  error;
}

The first server configuration says that I want all requests to www.howisoldmybusiness.com to go to howisoldmybusiness.com. I don’t see the need for the “www” part, so this is my way of forward all requests to howisoldmybusiness.com.

The second server configuration block does the real work. It tells Nginx to listen on Port 80 for requests to howisoldmybusiness.com, and when it gets a request it should look in the /var/www/howisoldmybusiness.com/html directory for the files it should server. It also states that all access requests should be logged to the file /var/log/nginx/hismb_access.log using the “main” format, and all errors should be logged to the file /var/log/nginx/hismb_error.log.

The 'main' access_log logging format

I think the main format came with the default Nginx configuration file. You should find it defined in the main http block like this:

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                  '$status $body_bytes_sent "$http_referer" '
                  '"$http_user_agent" "$http_x_forwarded_for"';

Multiple websites on the same server

If you have Nginx serving up multiple websites on the same server, all you have to do is copy that configuration for the other websites. For instance, I have a website named alaskasquirrel.com on the same server as the howisoldmybusiness.com website, and its configuration is almost identical:

server {
    server_name  www.alaskasquirrel.com;
    rewrite ^(.*) http://alaskasquirrel.com$1 permanent;
}

server {
    server_name  alaskasquirrel.com;
    listen       80;
    location / {
        root /var/www/alaskasquirrel.com/html;
    }
    access_log  /var/log/nginx/aksquirrel_access.log  main;
    error_log   /var/log/nginx/aksquirrel_error.log  error;
}

More information

This is a short blog post, so I’ll leave it at that for now. Here are a few links on configuring Nginx, particularly the Nginx log files:

  • http://nginx.org/en/docs/http/ngx_http_log_module.html
  • https://www.nginx.com/resources/admin-guide/logging-and-monitoring/
  • http://nginx.org/en/docs/ngx_core_module.html#error_log

LiquidText: e-Reading done right

I just saw this video for LiquidText. It made me think that this is the sort of functionality I always wanted from Amazon Kindle. More accurately, I knew I didn’t like how Kindle worked, and LiquidText makes you think, “See, there it is, that’s what I want.” (I’ll know it when I see it.)

The thermodynamics of learning

From a Phys.org article titled The thermodynamics of learning:

“The greatest significance of our work is that we bring the second law of thermodynamics to the analysis of neural networks,” Sebastian Goldt at the University of Stuttgart, Germany, told Phys.org. “The second law is a very powerful statement about which transformations are possible — and learning is just a transformation of a neural network at the expense of energy. This makes our results quite general and takes us one step towards understanding the ultimate limits of the efficiency of neural networks.”

AdWords campaign disapproved - trademark terms

"AdWords campaign disapproved! Disapproval reasons - trademark terms"

Yikes. I just saw this "AdWords trademark violation" message when I logged into my Google AdWords account. I've been trying to get a small AdWords campaign going for my "Hide Desktop Icons" software application, but it's been a battle getting through the AdWords approval process. My biggest problem is that Google AdWords won't approve my ads, and the only information they give me is this trademark message that states, "Disapproval reasons - trademark terms".

Dan Bricklin: The history of VisiCalc and other things

Dan Bricklin, inventor/creator of VisiCalc, the first spreadsheet program for personal computers, has created this page of historical notes and images about his work. His work came long before my interest in computers and programming, so I enjoy reading about it from a historical perspective. He shows a TI calculator and very large state diagram on this page. I remember seeing calculators like that in stores, and the work he put into the state diagram looks like a modern mind map.

If you’re into history, it’s all very cool.