Code Monkey home page Code Monkey logo

Comments (4)

frmichel avatar frmichel commented on July 26, 2024

Hi Lavdim,

Thx for your interest in this project.

Could you please let me know whether SPARQL Microservice works behind proxy, and what could be the fix?

I have honestly never tried it behind a proxy, although I don't see any reason why it would not work. The Flickr micro-service will simply issue a https query to Flickr's Web API, nothing more. Can you make sure port 443 is open on your proxy?

Also you may have a look at the log file, as the log directory is mounted on the docker host. See https://github.com/frmichel/sparql-micro-service/blob/master/doc/04-install.md#check-application-logs.

Let me know how it goes and we'll see from there.

In addition, if I would like to create a docker image with SPARQL Microservice installed in it, what is the entry command that should run on docker container initialization apart from starting Apache?

None. The only thing that needs to run is a properly configured Apache server. In addition to the running the Corese and MongoDB containers of course.
If you like, I can share with you the files and procedure I use to build the Docker image.

Franck.

from sparql-micro-service.

lavdim avatar lavdim commented on July 26, 2024

Hi Frank,

thank you for your quick response.

Actually, it seems that the proxy information should be given during the service call. So, according to this link: https://stackoverflow.com/questions/1336262/file-get-contents-behind-a-proxy , I added/changed the following code lines into the common/Utils.php file, now your docker container is working fine:

$PROXY_HOST = "proxyAdress"; // Proxy server address
$PROXY_PORT = 8080;// Proxy server port
$PROXY_USER = "username"; // Username
$PROXY_PASS = "pass"; // Password
// Username and Password are required only if your proxy server needs basic authentication

$auth = base64_encode("$PROXY_USER:$PROXY_PASS");

    // Build the list of HTTP headers
    $headers = array();
    $headers[] = "Accept: application/json; q=0.9, */*; q=0.1";
    $headers[] = "User-Agent: SPARQL-Micro-Service";
    $headers[] = "Proxy-Authorization: Basic $auth";

    if ($headers != null) {
        foreach ($additionalHeaders as $hName => $hVal)
            $headers[] = $hName . ": " . $hVal;
    }



    $streamContextOptions = array(
        'method' => 'GET',
        'header' => $headers,
         'proxy' => "tcp://$PROXY_HOST:$PROXY_PORT",
        'timeout' => Processor::REMOTE_TIMEOUT,
        'ssl' => [
            'verify_peer' => true,
            'verify_peer_name' => true,
    'allow_self_signed' => false
        ]
    )

The only thing that needs to run is a properly configured Apache server.

Is there anything else which is done for configuring Apache, since I see that in your docker there are a number of environment variables which are set and there exist a number of scripts into /usr/local/bin, such as docker-php-entrypoint, etc. Also, I see that docker-php-entrypoint is run on the initialization of the docker container.

If you like, I can share with you the files and procedure I use to build the Docker image.

Would be great if you can share the Docker build file.

Lavdim

from sparql-micro-service.

frmichel avatar frmichel commented on July 26, 2024

Indeed you are right! I had not thought about that use case but indeed, the proxy configuration has to be made explicit at some point. Thx for the code, I'll put this into the code asap and make it part of the main configuration file.

If you like, I can share with you the files and procedure I use to build the Docker image.
Would be great if you can share the Docker build file.

Ok sure. It's not public yet, can you send me your email address?
When would you like to have that, like asap or that can wait a few days? (I'm in the middle of a conference right now... quite dense! ;)).

from sparql-micro-service.

frmichel avatar frmichel commented on July 26, 2024

Implemented in 0.4.2_RC.

from sparql-micro-service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.