アプリ関連ニュース

Apache VS Nginx

What is Apache?

Apache is a Web server released under the open source Apache 2.0 license. Like all Web servers, it hosts Web content – such as HTML pages, PHP files, and audio and video – and serves the content to users when they visit a website. It can host content for websites on the public Internet, or for internal company websites on an Intranet.

Since its early days, Apache has offered a variety of benefits that have made it a popular Web server solution for many IT and DevOps teams.

Apache also offers a modular plugin system that makes it easy to add functionality to an Apache installation by installing modules that enable Apache to serve different types of Web content, log information, compress data, and so on. Modules in Apache can be easily activated and deactivated, providing a flexible solution for extending and controlling how Apache behaves.

What is NGINX?

NGINX is a Web server that is designed to also work as a reverse proxy server, a load balancer, and an HTTP cache. NGINX is open source and governed by a BSD license. While Apache can be configured to perform these various additional tasks, it was designed first and foremost as simply a Web server.

NGINX offers many of the same benefits as Apache. It’s open source and (in its core open source form, at least) freely available to use.

Unlike Apache, however, NGINX has a somewhat simpler configuration system. Some of the functionality that would have to be added to an Apache installation using modules is included in NGINX by default, which means that there is less setup for admins to perform. For example, NGINX caches Web content by default in order to enable faster performance when multiple users request the same content.

Simplicity

Developing and innovating applications on Apache is easy. The one-connection-per-process model makes it very easy to insert modules at any point in its web serving logic. Developers could add code in such a way that if there were failures only the worker process running the code would be affected. Processing of all other connections would continue undisturbed.

NGINX, on the other hand, has a sophisticated architecture hence developing modules is not easy. NGINX module developers need to be very careful to create efficient and accurate code, without any failures, and to interact appropriately with the complex event-driven kernel to avoid blocking operations.

Performance

Performance is measured by how the server delivers large volumes of content to the client browser and this is an important factor. Content can be Static or Dynamic.

OS support

Apache runs on all operating systems such as UNIX, Linux or BSD and has full support for Microsoft Windows. NGINX also runs on several modern Unix-like systems and has support for Windows, but its performance on Windows is not as stable as that on UNIX platforms.

By Yuuma.



CakePHP Windows10環境構築ガイド

CakePHPフレームワークをWindows10で使用する際の環境構築ガイドです。

続きを読む

Android9以上でhttp平文通信を行う

Android9以上ではデフォルトでSSL/TLS通信を行うようになっています。

続きを読む

Lodash Js Array & Object – Part 3 (Final)

Today I will talk about dealing with array and object in Lodash Js.

Filter

  • Filtering a list to transform the elements we want to get back
var numbers = _.range(0,10);      // [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

var evenNumbers = _.filter(numbers, function(e){ return e % 2 != 0; });
// evenNumbers is now [ 0, 2, 4, 6, 8 ]

Reduce

  • Reducing a list of objects to a single value.
  • Ex=>A group of people can buy a meal or not. In that case we have to check out they have the enough amount by the sum of money they have.
  • (Each’s money => sum money)
var ppl = [
    {
        'name': 'Keita',
        'money': 1000
    },
    {
        'name': 'Sato',
        'money': 3000
    },
    {
        'name': 'Ruma',
        'money': 500
    },
]

var sumMoney = function(data){
    return _.reduce(
        data,
        function(accumulated, e){
            return accumulated + e.money;
        },
        0
    );
}

function canBuyMeal(data){
    return 3500 < sumMoney(data);
}

canBuyMeal(ppl);    // returns true

Some

  • If there is at least one record in a collection that meets some criteria.
var ppl = [
    {
        'name': 'Keita',
        'hasMoney': true
    },
    {
        'name': 'Sato',
        'hasMoney': false
    },
    {
        'name': 'Ruma',
        'hasProperty': true
    },
]

function canLive(data){
    return _.some(data, function(e){ return e.hasProperty; });
}

canGroupDrive(ppl);    // returns true

Map

  • Useful for changing a list into a different list in a purely declarative way.
  • Can just specify how you want to manipulate an element of a list.
  • Make a new list transformed by providing a function
var res1 = _.range(5);       // [ 0, 1, 2, 3, 4]

var res2 = _.map(a, function(e){ return e + e;} );

//result is [0, 2, 4, 6, 8]

By Yuuma



[php] printf sprintf vprintf vsprintf の違いについて(その2)

PHPでフォーマットした文字列の出力をおこなう際に使用する関数、
printf sprintf vprintf vsprintf の使い分けについて記載します。

続きを読む

アプリ関連ニュース

お問い合わせはこちら

お問い合わせ・ご相談はお電話、またはお問い合わせフォームよりお受け付けいたしております。

tel. 06-6454-8833(平日 10:00~17:00)

お問い合わせフォーム