Showing posts with label Computer. Show all posts
Showing posts with label Computer. Show all posts

Monday, March 27, 2017

Where nginx.conf location?

Nginx is now beginning to peep as web server software alternative because they are lightweight and efficient resource server than Apache. One feature that is missed is using .htaccess files for quick solutions to regulate the behavior of the site, well ... in Nginx things like this should be put in the server{} or location{} nginx.conf. Not memorized the location?




You install Nginx server depending on what Linux distributions (CentOS, Debian, Ubuntu, ArchLinux, etc.) or use a script that automatically complete the setting up web server location can be different. Please check one of several possible positions :


  • /usr/local/nginx/conf/nginx.conf
  • /etc/nginx/nginx.conf – Usually used in EasyEngine.
  • /usr/local/etc/nginx/nginx.conf
  • /etc/nginx/nginx.conf/nginx.conf
  • /usr/local/nginx/conf/nginx.conf – Centminmod put it here.
  • /etc/nginx/conf.d/nginx.conf – Ini in VPSSIM.
  • C:\WT-NMP\conf\nginx.conf – WT-NMP is Nginx for Windows localhost.
It turns out you have to check one by one of the above directories but not found Nginx configuration file? Still no alternative solution is to ask directly to the program currently using nginx.conf located where:

nginx -t "

Later will come the reply as follows:

" nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: [emerg] listen() to 0.0.0.0:80, backlog 256 failed (98: Address already in use) 
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed "

Actually, the above command is used to test the Nginx configuration and a side effect is to show the location of the file. And because there is an error it seems the end of this week I have to be busy troubleshooting the problem.

But my server is still normal, it's not vital. :-)) :-))


Share:

Overcoming 502 Bad Gateway on Nginx

in this article I will discuss " Overcoming 502 Bad Gateway on Nginx " 

This time the problem I experienced was on the WordPress website using Nginx and there in front of CloudFlare, but the reason for the emergence of HTTP 502 Bad Gateway error. 

If you see a white page Nginx with the following error message means the same case :

  • 502 Bad Gateway
  • 502 Proxy Error
  • 502 Bad Gateway NGINX
  • 502 Service Temporarily Overloaded
  • Error 502
  • HTTP 502
  • HTTP Error 502 – Bad Gateway
Before we discuss the solution is then obliged us to understand what the purpose of this error message. So Bad Gateway that means is the gate / driveway problematic. The point is that the service or application that receives and processes requests from Nginx can not handle it. It usually occurs in PHP-FPM and became my base in the discussion of this case.



Restart PHP-FPM

The solution is easy and fast, you just type:

service php5-fpm restart " 

This could be said to be temporary because we are not trying to find out and fix the problem. After servicenya active again you must check the contents of the error logs PHP-FPM what the problem to be diagnosed.



Make sure your PHP-FPM listening to right

There are 2 kinds of ways services PHP-FPM listen to and serve the request, via a socket or IP address. Please check the configuration (named www.conf) and make sure the contents one of the following, or you exchange: 
listen = /var/run/php5-fpm.sock "

                              or

        " listen = 127.0.0.1:xxxx "

After that the restart PHP-FPM.

Check the rights of PHP-FPM AKSes

There are times when we forget governs how files - file PHP-FPM service will be used by Nginx. Just make sure it can communicate:

  • Check php.ini and www.conf contents in user and group parts are compatible with the existing Nginx configuration.
  • Is /var/run/php5-fpm.sock file can be used Nginx?
  • Including the / var / lib / php please verify.

Turn off the APC or try another caching system in PHP

APC (Alternative PHP Cache) function is to create a cache of code - PHP code that is executed so that the next process requiring the same functions will be faster processing. But sometimes these features result in error 502, I suggest that first try disabling it.

I recommended replacing the alternative to it. The consideration is the old system and has been replaced by PHP OPcache, try using a new one and formally included in PHP version 5.5 and above.

Increase the buffer size and timeout on Nginx configuration

So please edit nginx.conf and place the following code in the block http {}:

http { fastcgi_buffers 8 16k; fastcgi_buffer_size 32k; fastcgi_connect_timeout 300; fastcgi_send_timeout 300; fastcgi_read_timeout 300; }

Functions that Nginx process data with a larger container in memory so it does not need to be stored in the hard disk while. Also when the process is timed to avoid direct longer be considered a failure.

So first up the discussion here, I just know some of the above solutions. And I just realized though the title Nginx but the solution is 4 the tooling - tweaking PHP-FPM and the only one whose dealings with Nginx.
Share:

Tuesday, March 7, 2017

Device Network

Hello my friend .... 
in my first post, I will introduce the types of network hardware and its functions ... Cekidoot :-D


Okay let's look at what the router and functions :


1. ROUTER



                     Router is a computer, such as other computers, including PCs. Routers have some similarities in hardware and software components that exist within a computer, such as: CPU, RAM, ROM, and the operating system. Router is a network device that operates at the network layer of the OSI model.This router serves as a connecting device between two or more networks to carry data from one network to another.  And also  the router  can split  collision domains and broadcast domains  . There are a variety of interfaces on the router that is Fast / Gigabit Ethernet, optical, E1, SONET etc. 




2. SWITCH




                       Switch is a network device that operates at the data link layer of the OSI model. But there is also a switch that can operate dilayer network with a specific purpose and are usually referred to as Multi-Layer Switch. Switches are used to expand the network and serves as a liaison multiple end-devices (computers, tablets etc) to form one or several segments of a network / LAN. On Switch also has a variety of interfaces as well as the router is Ethernet, optical, E1, SONET dll.Tapi generally switch has many ports so often called a multi-port bridge.




3. Bridge


                  Bridge is a network device that also operate in the data link layer of the OSI model. Therefore, how the bridge together with the switch. Bridge can also be used to combine two different network media, as well as between the cable media Unshielded Twisted-Pair (UTP) and fiber-optic cable or two different network architectures. Usually the realization of the bridge is "a particular router or switch" that functioned as a bridge.




4. Access Point


                    Access Point is a network device that contains a transceiver and an antenna for transmitting and receiving signals to and from remote clients. With access points (AP) wireless clients can quickly and easily connect to the wireless LAN network cables. Access Point sebenarmya introductory course only media like cable function that operates at the physical layer.



5. Server


                    The server is a computer system that provides a specific kind of service in a network. Server powered by a processor that is both scalable and large RAM, also equipped with a special operating system, which is referred to as the network operating system or network operating system . The server is also running administrative software that controls access to the network and the resources contained therein, as well as file or display devices (printers), and giving access to theworkstation network members.



6. End-Device


                End-device is a device that is directly related to the user, for example the device is a PC client, tablet, smartphone, etc.
Share:

click banner for more

Translate

Categories