ElkArte Community

General => Chit Chat => Topic started by: Adrek on March 28, 2016, 06:10:48 pm

Title: Using SSH on shared host to check connection?
Post by: Adrek on March 28, 2016, 06:10:48 pm
Hey, I have small issue and maybe you can help me with it.

Some users from Netherlands are telling me that my forum is not available for them, all the see is white page.
I have SSH on my shared host, and my question is - can I use it somehow to check if server can ping (or something like that) to users computer?
Title: Re: Using SSH on shared host to check connection?
Post by: Spuds on March 28, 2016, 08:21:19 pm
I would think a white page is a server error ... like a misconfiguration in an .htaccess file if you are using Apache.  There should be some log in your access or error file that would show why things are failing.

If you are really on sharred hosting, then to my knowledge, you will be in a jailed (chrooted) ssh, which means you will have a very limited set of commands available to you inside that SSH.

Title: Re: Using SSH on shared host to check connection?
Post by: Frenzie on March 29, 2016, 08:30:02 am
You could always toss together some curl stuff in PHP. A quick search gives this example (http://stackoverflow.com/a/4607776).

    $url = 'yoururl';
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_NOBODY, true);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_exec($ch);
    $retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);
    if (200==$retcode) {
        // All's well
    } else {
        // not so much
    }