POV-Ray : Newsgroups : povray.off-topic : Just ask Google Server Time
29 Jul 2024 10:27:23 EDT (-0400)
  Just ask Google (Message 18 to 27 of 47)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Invisible
Subject: Re: Just ask Google
Date: 19 Jul 2012 03:56:39
Message: <5007bdb7@news.povray.org>
>> Most of the discussions appear to be /very/ old.
>
> It's an example of how to do a search.  Use the search tools to constrain
> the results to a more recent timeframe.

One of the discussions suggests that the correct search term is "shell 
host". This does indeed appear to generate a lot of hits...


Post a reply to this message

From: Invisible
Subject: Re: Just ask Google
Date: 19 Jul 2012 04:36:01
Message: <5007c6f1$1@news.povray.org>
On 17/07/2012 09:03 AM, Invisible wrote:
> - Finding a web hosting company that allows arbitrary CGI /binaries/ is
> seemingly impossible.

Apparently my /current/ web host offers arbitrary CGI using PHP. (And a 
MySQL database, if I want one.)

According to the manual, any file ending *.php4 or *.php5 is considered 
to be a PHP file. Anything ending *.cgi is assumed to be a CGI script. 
(I think it supports one other language - maybe Perl.)



First attempt: Write a small C program, compile it on Linux, upload it 
to the server, name it HelloWorld.cgi, try to access it.

Oh dears: HTTP 500. No way of accessing the logs to find out what failed.



Second attempt: PHP apparently contains a passthru() function which lets 
you run an arbitrary command and pipe its output to the HTTP client. So 
if I just run ./HelloWorld.cgi, I'm golden.

No good. Statements before passthru() execute fine. Statements after 
passthru() execute fine. passthru() itself appears to generate no 
output. Again, this is a scripting language, so there's no way of 
knowing why it failed.



I know for a fact that my host runs Linux, and the web server is Apache. 
It seems a reasonable assumption that it's AMD64, but the documentation 
does not specify. Nor does it state which Linux distro. I had hoped that 
PHP might offer some function to query this information... but no, it 
doesn't.

If I scheme hard enough, perhaps I can trick my existing web host into 
doing what I actually want, without having to upgrade to their dedicated 
server product at 15x the price...


Post a reply to this message

From: Invisible
Subject: Re: Just ask PHP
Date: 19 Jul 2012 04:50:30
Message: <5007ca56@news.povray.org>
On 19/07/2012 09:36 AM, Invisible wrote:

> If I scheme hard enough, perhaps I can trick my existing web host into
> doing what I actually want, without having to upgrade to their dedicated
> server product at 15x the price...

Apparently PHP has a phpinfo() function which dumps a whole bunch of data.

According to this,

   System: Linux infong 2.4 #1 SMP Tue Jan 17 02:58:41 UTC 2012 i686 
GNU/Linux

So perhaps I should try compiling a 32-bit ELF binary and see if that 
works? (Man, is there even a way to do that with a 64-bit Linux distro? 
I'm sure there is, but finding it...)


Post a reply to this message

From: Le Forgeron
Subject: Re: Just ask PHP
Date: 19 Jul 2012 05:01:48
Message: <5007ccfc@news.povray.org>
Le 19/07/2012 10:50, Invisible a écrit :
> On 19/07/2012 09:36 AM, Invisible wrote:
> 
>> If I scheme hard enough, perhaps I can trick my existing web host into
>> doing what I actually want, without having to upgrade to their dedicated
>> server product at 15x the price...
> 
> Apparently PHP has a phpinfo() function which dumps a whole bunch of data.
> 
> According to this,
> 
>   System: Linux infong 2.4 #1 SMP Tue Jan 17 02:58:41 UTC 2012 i686
> GNU/Linux

Strange, a 2.4 serie kernel compiled at the beginning of 2012.
2.6 is more mainstream, and kernel has now entered the 3.2 serie


> 
> So perhaps I should try compiling a 32-bit ELF binary and see if that
> works? (Man, is there even a way to do that with a 64-bit Linux distro?
> I'm sure there is, but finding it...)

You need a multi-lib gcc (or whatever, g++...)
You can then use -m32 to get a 32 bits binary.

(-m32 should be used for compilation & link)


Post a reply to this message

From: Invisible
Subject: Re: Just ask PHP
Date: 19 Jul 2012 05:11:07
Message: <5007cf2b$1@news.povray.org>
>> According to this,
>>
>>    System: Linux infong 2.4 #1 SMP Tue Jan 17 02:58:41 UTC 2012 i686
>> GNU/Linux
>
> Strange, a 2.4 serie kernel compiled at the beginning of 2012.
> 2.6 is more mainstream, and kernel has now entered the 3.2 serie

Don't look at me. This is from the same company that's running a 
long-obsolete version of WordPress too. (At least, it was obsolete when 
I checked 4 years ago, and it hasn't been updated since, so...)

>> So perhaps I should try compiling a 32-bit ELF binary and see if that
>> works? (Man, is there even a way to do that with a 64-bit Linux distro?
>> I'm sure there is, but finding it...)
>
> You need a multi-lib gcc (or whatever, g++...)
> You can then use -m32 to get a 32 bits binary.
>
> (-m32 should be used for compilation&  link)

Adding -m32 causes a whole bunch of errors due to missing header files.

Installing glibc-devel-i386 makes compilation succeed, but now I get 
half a dozen linker errors instead. Blindly installing packages at 
random eventually made the errors go away.

(That's what I love about Linux - there's never any /documentation/ 
about what the hell all these packages do! For example, almost every 
single package related to GCC simply tells you what GCC is - /not/ what 
part of GCC is contained within this specific package!)


Post a reply to this message

From: Invisible
Subject: Re: Just ask PHP
Date: 19 Jul 2012 05:13:32
Message: <5007cfbc$1@news.povray.org>
On 19/07/2012 09:50 AM, Invisible wrote:

> So perhaps I should try compiling a 32-bit ELF binary and see if that
> works?

DAMNIT! >_<

No, that still fails miserably. *sigh*


Post a reply to this message

From: Invisible
Subject: Re: Just ask Google
Date: 19 Jul 2012 05:20:07
Message: <5007d147$1@news.povray.org>
> Apparently my /current/ web host offers arbitrary CGI using PHP. (And a
> MySQL database, if I want one.)
>
> According to the manual, any file ending *.php4 or *.php5 is considered
> to be a PHP file. Anything ending *.cgi is assumed to be a CGI script.
> (I think it supports one other language - maybe Perl.)

Apparently the supported list is actually Perl, Python, PHP and Ruby.

Interestingly, the documentation claims that all CGI scripts must begin 
with a shebang and must have execute permissions. For at least PHP, this 
is clearly untrue...


Post a reply to this message

From: Invisible
Subject: Re: Just ask Unix
Date: 19 Jul 2012 05:24:01
Message: <5007d231@news.povray.org>
On 19/07/2012 10:13 AM, Invisible wrote:
> On 19/07/2012 09:50 AM, Invisible wrote:
>
>> So perhaps I should try compiling a 32-bit ELF binary and see if that
>> works?
>
> DAMNIT! >_<
>
> No, that still fails miserably. *sigh*

Hold the phone... If I change the permissions on the file to 755, *now* 
it works perfectly! :-D

OK, I now have arbitrary binary CGI on my web host. That was easy...

Now, how much do you want to bet that a non-trivial program compiled on 
one Unix box won't run on another Unix box? :-/


Post a reply to this message

From: Francois Labreque
Subject: Re: Just ask Google
Date: 19 Jul 2012 10:17:49
Message: <5008170d$1@news.povray.org>
Le 2012-07-18 10:39, clipka a écrit :
> Am 18.07.2012 16:28, schrieb Francois Labreque:
>> Le 2012-07-17 10:34, Invisible a écrit :
>>> Typically the host sets up a special folder, and any files within it are
>>> considered to be CGI scripts in whatever language the server is
>>> hard-coded to accept. (Or /maybe/ based on the filename.) Presumably
>>> you'd have to find a host that allows executable binaries...
>>
>> On Apache, it _is_ done by filename.  Since the host has to "chmod" the
>> files to make them executable (on *NIX), it probably automagically does
>> this on a specific set of file extensions.  so you need to find out what
>> extensions are supported.
>
> Comes as a surprise to me, given that it's Unix customary practice to
> identify file types by signatures.

I meant to say that a web hosting service might have some automated 
process that would automatically chmod +x any file with the .pl or .cgi 
extension that the user uploads to his or her cgi-bin/ directory, 
whereas a .jpg or .html wouldn't be chmodded.

And you are right, Unices do use file signatures to determine what to do 
with them, that's why I told Andy that if he uploaded a compiled Haskell 
binary and simply named it "andy.pl" it might run anyway as the web 
server would more than likely issue a system() call and let the OS 
figure out what to do with it.

-- 
/*Francois Labreque*/#local a=x+y;#local b=x+a;#local c=a+b;#macro P(F//
/*    flabreque    */L)polygon{5,F,F+z,L+z,L,F pigment{rgb 9}}#end union
/*        @        */{P(0,a)P(a,b)P(b,c)P(2*a,2*b)P(2*b,b+c)P(b+c,<2,3>)
/*   gmail.com     */}camera{orthographic location<6,1.25,-6>look_at a }


Post a reply to this message

From: Francois Labreque
Subject: Re: Just ask Google
Date: 19 Jul 2012 10:20:07
Message: <50081797$1@news.povray.org>
Le 2012-07-19 03:56, Invisible a écrit :
>>> Most of the discussions appear to be /very/ old.
>>
>> It's an example of how to do a search.  Use the search tools to constrain
>> the results to a more recent timeframe.
>
> One of the discussions suggests that the correct search term is "shell
> host". This does indeed appear to generate a lot of hits...

A shell host means that they give you a complete VM to yourself and you 
can do whatever you want (still subject to the TOS of the company) with 
it, so you can load it up with your own copy of Apache or IIS and 
configure it as you want.

(And then see it overtaken by l33t hax0rz in 3.2 seconds.)

-- 
/*Francois Labreque*/#local a=x+y;#local b=x+a;#local c=a+b;#macro P(F//
/*    flabreque    */L)polygon{5,F,F+z,L+z,L,F pigment{rgb 9}}#end union
/*        @        */{P(0,a)P(a,b)P(b,c)P(2*a,2*b)P(2*b,b+c)P(b+c,<2,3>)
/*   gmail.com     */}camera{orthographic location<6,1.25,-6>look_at a }


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.