Topic: Software

[SOLUTIONS] 504 GATEWAY TIMEOUT NGINX 0

SOLUTIONS 504 GATEWAY TIMEOUT NGINX - [SOLUTIONS] 504 GATEWAY TIMEOUT NGINX

Today, We want to share with you [SOLUTIONS] 504 GATEWAY TIMEOUT NGINX.In this post we will show you HTTP Status Code 504 Gateway Timeout in NGINX, hear for How to fix 504 gateway time out Nginx? we will give you demo and example for implement.In this post, we will learn about 504 Gateway Timeout and How to Fix it for Nginx step by step with an example.

[SOLUTIONS] 504 GATEWAY TIMEOUT NGINX

There are the Following The simple About [SOLUTIONS] 504 GATEWAY TIMEOUT NGINX Full Information With Example and source code.

As I will cover this Post with live Working example to develop How to Fix 504 Gateway Timeout Error in NGINX, so the 504 Gateway Timeout Error resolve for this example is following below.

SOLUTIONS 504 GATEWAY TIMEOUT NGINX Ubuntu - [SOLUTIONS] 504 GATEWAY TIMEOUT NGINX

[SOLUTIONS] 504 GATEWAY TIMEOUT NGINX – Ubuntu

Here are there sre the following the common ways that We might diplay some the HTTP 504 error:

  • Nginx 504 Gateway Timeout
  • HTTP 504
  • HTTP 504 Gateway Timeout
  • HTTP 504 Error
  • Gateway Timeout (504)
  • 504 Gateway Timeout
  • 504 Gateway Timeout NGINX
  • 504 Gateway Time-Out

There are the some Best Following ways to fix it: 504 gateway timeout

For using Nginx as Proxy (php-fpm disabled): To apply set some settings globally files, increase the main some times to following timeout values by inserting the filepath Like as a /etc/nginx/conf.d/timeout.conf after that you have some time to restarting ‘nginx’ your main service:# cat /etc/nginx/conf.d/timeout.conf

proxy_connect_timeout       3000;
proxy_send_timeout          3000;
proxy_read_timeout          3000;
send_timeout                3000;

If We only are should to step by step your increase timeout settings each domain, it can be completed in this way: 504 gateway time-out nginx

step by step resolve 504 error - [SOLUTIONS] 504 GATEWAY TIMEOUT NGINX

step by step resolve 504 error


504 GATEWAY TIMEOUT NGINX - [SOLUTIONS] 504 GATEWAY TIMEOUT NGINX

504 GATEWAY TIMEOUT NGINX

Changes in Nginx Config files

Last step, include you fastcgi_read_timeout main variable inside our main Nginx virtual host configuration like as below:

location ~* \.php$ {
    include         fastcgi_params;
    fastcgi_index   index.php;
    fastcgi_read_timeout 150;
    fastcgi_pass    127.0.0.1:9000;
    fastcgi_param   SCRIPT_FILENAME    $document_root$fastcgi_script_name;
}

and then you simple a Reload PHP-FPM and Nginx

service php–fpm restart
service nginx restart

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about [SOLUTIONS] 504 GATEWAY TIMEOUT NGINX.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Apache Block IP using .htaccess File Tutorials 0

Apache Block IP using .htaccess File Tutorials

Today, We want to share with you Apache Block IP using .htaccess File Tutorials.In this post we will show you How to Set Up the htaccess File on Apache, hear for How to Allow or Block Visitors From Specific Countries Using .htaccess we will give you demo and example for implement.In this post, we will learn about How To Block IP using .htaccess File in Apache with an example.

Apache Block IP using .htaccess File Tutorials

There are the Following The simple About Apache Block IP using .htaccess File Tutorials Full Information With Example and source code.

As I will cover this Post with live Working example to develop htaccess allow from multiple IP’s Syntax problem, so the Allowing and denying access by IP address with Apache for this example is following below.

Block IP using .htaccess

Create a file named .htaccess

First of all you have a simple, create a file named Like as .htaccess in your root path main website document root folder and add these simple example lines:

<Files *>
   <RequireAll>
 Require all granted        #First allow all 
 Require not ip 192.168.0.10      #Block single IP 
 Require not ip 192.168.0.0/24      #Block IP range
 Require not ip 192.168.0.11 10.10.0.1/32    #Simple Block mutile IPs and range
  </RequireAll>
</Files>

Apache Block IP using .htaccess File Tutorial - Apache Block IP using .htaccess File Tutorials

htaccess allow from ip range

 Require not ip 192.168.0.0/24      #Block IP range

Block a specific IP address

Deny from 123.123.123.123

Block a specific domain

Deny from 123.123.123.123/255.255.255.0

htaccess allow from multiple ip

# Apache v2.2
Allow from 1.2.3.4 1.2.3.10
# Apache v2.4
Require ip 1.2.3.4 1.2.3.10

Block multiple IP addresses

Deny from 111.111.111.111 222.222.222.222 333.333.333.333

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Block IP using .htaccess File Tutorials.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Install Elasticsearch on Debian 10/9/8 Tutorial 0

Install Elasticsearch on Debian 10-9-8 Tutorial

Today, We want to share with you Install Elasticsearch on Debian 10/9/8 Tutorial.In this post we will show you elasticsearch install elasticsearch, hear for install elasticsearch ubuntu 18.04 digitalocean we will give you demo and example for implement.In this post, we will learn about e: unable to locate package elasticsearch with an example.

Install Elasticsearch on Debian 10/9/8 Tutorial

There are the Following The simple About Install Elasticsearch on Debian 10/9/8 Tutorial Full Information With Example and source code.

As I will cover this Post with live Working example to develop install kibana ubuntu, so the Install Elasticsearch with Debian Package for this example is following below.

Step 1 – Prerequsities

Simple Step by step You need to Debian system using sudo privileged user or root account Details

$ java -version

java version "11.0.2" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode)

install Java on Debian 10 and Debian 9.
$ echo $JAVA_HOME

/usr/lib/jvm/java-8-oracle

Step 2 – Install Elasticsearch on Debian

import GPG key for Elasticsearch packages

sudo apt-get install apt-transport-https
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add 

install latest Elasticsearch 6.X
add-apt-repository "deb https://artifacts.elastic.co/packages/6.x/apt stable main"

install Elasticsearch packages on your system
sudo apt-get update
sudo apt-get install elasticsearch

Step 3 – Configure Elasticsearch on Debian

sudo nano /etc/elasticsearch/elasticsearch.yml

/etc/elasticsearch/elasticsearch.yml

 network.host: 0.0.0.0
 cluster.name: ES_Cluster_01
 node.name: "Cluster_01_Node_001"

Step 4 – Manage Elasticsearch Service

sudo /bin/systemctl enable elasticsearch.service

Elasticsearch can be started and stopped

sudo systemctl start elasticsearch.service
sudo systemctl stop elasticsearch.service

Step 5 – Test Elasticsearch Setup

GET command using curl to verify the setup

curl -X GET http://192.168.10.100:9200

simple Output
{
  "name" : "California DataCenter 1",
  "cluster_name" : "Cluster_01_Node_001",
  "cluster_uuid" : "GWqKIFxSQOy2FhyMO-tB5g",
  "version" : {
    "number" : "6.4.2",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "04711c2",
    "build_date" : "2018-09-26T13:34:09.098244Z",
    "build_snapshot" : false,
    "lucene_version" : "7.4.0",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

Angular 6 CRUD Operations Application Tutorials

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Install Elasticsearch on Debian 10/9/8 Tutorial.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Paypal Payment Gateway Integration using Java 0

Paypal Payment Gateway Integration using Java

Paypal Payment Gateway Integration using Java

In this Post We Will Explain About is Paypal Payment Gateway Integration using Java With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Accept PayPal with the Payments API using Java Example

In this post we will show you Best way to implement Integrate Paypal in Web Application using Java, hear for How to integrate Paypal Website Payment in Javawith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Integrate Paypal in Web Application using Java

Paypal is most and very popular payment gateway system available.Paypal provides all the currency exchange Rest API implementation step by step to simple integrate gateway to your ad web-application or website.We Are here using Java Based Restful API to integrate some account Paypal and payment will be simple made on our web-site.

In this laexample example we’re learn to cart total and some total_shiiping as HTML input, We can calculate them some as per your own.

We can download simple project with source code also at the all end of this tutorials.

Paypal is providing the developer guideline and url where we can test our local application.we will use the express checkout method for payment in this example.

paypal payment gateway integration in java source code

Step 1. Open the simple paypal developer link https://developer.paypal.com/
Step 2. We need to make two different some email address , One for Merchant account and other for buyer account respectively.
Step 3. Simple push on Like as a“Sign Up Now” button.
Step 4. Enter the your some information to access the data sandbox environment.
Step 5. Simple push on “Agree and Submit” simple button.
Step 6. Now login with given like as a username/password.
Step 7. Simple push on “Test Account” link
Step 8. make a new test account and provide the some Informations in textfields also.
Step 9. choose the “Account Type” as we want either “Merchant” or “buyer”
Step 10.It will created the default some email id for us.
Step 11.simple data set Credit card data information as “NONE” .
Step 12.Set the some balance amount for your any account.

Dependency

  4.0.0
  livePaypal_example
  livePaypal_example
  war
  0.0.1-SNAPSHOT
  livePaypal_example Maven Webapp
  http://maven.apache.org
  
    
      live24u
      live24u
      3.8.1
      example
    
    
  com.paypal.sdk
  rest-api-sdk
  LATEST

<!--Devloped By Pakainfo.com Servlet and JSP API Jars -->

    javax.servlet
    javax.servlet-api
    3.1.0
    provided


    javax.servlet.jsp
    javax.servlet.jsp-api
    2.3.1
    provided

<!--Devloped By Pakainfo.com JSTL Jars -->

    javax.servlet
    jstl
    1.2

 
 
  
    livePaypal_example
  

Paypal API Credentials

We simple need to create a devloper app under developer account using simple paypal web-site and simple client id and secret need to Put in PaypalServlet.java.

Step 1 : Client ID
Step 2 : Client Secret

index.jsp

Here We have larning HTML inputs simple cart total as well as total_shiiping. We can calculate them as some own way.


<h2>Step by setpPaypal Payment Example by Pakainfo.com</h2>
 
<form action="http://localhost:8080/livePaypal_example/LiveDirectPay" method="post">
<table>
<tr>
<td>Live Cart Sub Total</td>
<td></td>
</tr>
<tr>
<td>Total Shipping</td>
<td></td>
</tr>
<tr>
<td></td>
</tr>
</table>
</form>
 


LiveServicePayment.java

This simple class simple defines the functions for paypal payment integrate processing.

package com.liveJavaPaypal.livePaypal_example;
 
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
 
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
 
import com.paypal.api.payments.Amount;
import com.paypal.api.payments.Details;
import com.paypal.api.payments.Links;
import com.paypal.api.payments.Payer;
import com.paypal.api.payments.Payment;
import com.paypal.api.payments.PaymentExecution;
import com.paypal.api.payments.RedirectUrls;
import com.paypal.api.payments.Transaction;
import com.paypal.base.rest.APIContext;
import com.paypal.base.rest.PayPalRESTException;
 
public class LiveServicePayment {
    private APIContext apiContext;
    public LiveServicePayment(String clientId,String clientSecret,String mode) {
        apiContext = new APIContext(clientId, clientSecret, mode);  
    }
    public void proecssPayment(HttpServletRequest request,HttpServletResponse response) {
        //Devloped By Pakainfo.com Set payer details
        Payer payer = new Payer();
        payer.setPaymentMethod("paypal");
 
        //Devloped By Pakainfo.com Set redirect URLs
        RedirectUrls redirectUrls = new RedirectUrls();
        redirectUrls.setCancelUrl("http://localhost:8080/livePaypal_example/cancel");
        redirectUrls.setReturnUrl("http://localhost:8080/livePaypal_example/LiveDirectPay");
 
        //Devloped By Pakainfo.com Set payment details
        double total_shiiping = Double.parseDouble(request.getParameter("total_shiiping"));
        double total_Cart = Double.parseDouble(request.getParameter("total_Cart"));
        double tax  = (total_Cart*14)/100;
         
        Details details = new Details();
        details.setShipping(total_shiiping+"");
        details.setSubtotal(total_Cart+"");
        details.setTax(tax+"");
         
         
        double total = total_Cart+total_shiiping+tax;
         
        //Devloped By Pakainfo.com Payment amount
        Amount amount = new Amount();
        amount.setCurrency("USD");
        //Devloped By Pakainfo.com Total must be equal to sum of total_shiiping, tax and subtotal.
        amount.setTotal(""+total);
        amount.setDetails(details);
 
        //Devloped By Pakainfo.com Transaction information
        Transaction transaction = new Transaction();
        transaction.setAmount(amount);
        transaction
          .setDescription("This is the Pakainfo.com payment transaction description.");
 
        //Devloped By Pakainfo.com Add transaction to a list
        List live_tansactions = new ArrayList();
        live_tansactions.add(transaction);
 
        //Devloped By Pakainfo.com Add payment details
        Payment payment = new Payment();
        payment.setIntent("sale");
        payment.setPayer(payer);
        payment.setRedirectUrls(redirectUrls);
        payment.setTransactions(live_tansactions);  
         
        //Devloped By Pakainfo.com Create payment
        try {
          Payment liveCreatedPay = payment.create(apiContext);
           

          Iterator links = liveCreatedPay.getLinks().iterator();
          while (links.hasNext()) {
            Links link = links.next();
            if (link.getRel().equalsIgnoreCase("approval_url")) {
              // REDIRECT USER TO link.getHref()    
             response.sendRedirect(link.getHref()); 
            }
          }
        } catch (PayPalRESTException e) {
            System.err.println(e.getDetails());
        } catch (IOException e) {
            e.printStackTrace();
        }
         
    }
    public void totalPaymentMethod(HttpServletRequest req) {
        Payment payment = new Payment();
        payment.setId(req.getParameter("paymentId"));
 
        PaymentExecution paymentExecution = new PaymentExecution();
        paymentExecution.setPayerId(req.getParameter("PayerID"));
        try {
          Payment liveCreatedPay = payment.execute(apiContext, paymentExecution);
          System.out.println(liveCreatedPay);
        } catch (PayPalRESTException e) {
          System.err.println(e.getDetails());
        }
    }
}

PaypalServlet.java

This java servlet will process step by step the HTML form and create rest api call to the implementation paypal for further some package processing. The Paypal implementation API response shall be printed in cmd console. we can use them some accordingly as per your some need.

package com.liveJavaPaypal.livePaypal_example;
 
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class PaypalServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //Devloped By Pakainfo.com TODO Auto-generated method stub
        doPost(request,response);
    }
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
         
        LiveServicePayment livepaypal_Service;
        if (request.getParameter("PayerID") != null) {
            livepaypal_Service = new LiveServicePayment("live_YOUR_CLIENT_ID","live_YOUR_CLIENT_SECRET","sandbox");
            livepaypal_Service.totalPaymentMethod(request);
             
        } else {
            livepaypal_Service = new LiveServicePayment("live_YOUR_CLIENT_ID","live_YOUR_CLIENT_SECRET","sandbox");
            livepaypal_Service.proecssPayment(request,response);
        }
    }
 
}

Download

I hope you have Got What is paypal payment gateway integration in java source code And how it works.I would Like to have FeadBack From My Blog(Pakainfo.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(Pakainfo.com) Are Most Always Welcome.