POV-Ray : Newsgroups : povray.off-topic : Just ask Google Server Time
29 Jul 2024 08:16:57 EDT (-0400)
  Just ask Google (Message 21 to 30 of 47)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
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

From: Invisible
Subject: Re: Just ask Google
Date: 19 Jul 2012 10:32:50
Message: <50081a92$1@news.povray.org>
>> 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

I thought the term for that was "virtual server"? (Or "dedicated server" 
if the physical hardware is not shared - usually very expensive!)


Post a reply to this message

From: Invisible
Subject: Re: Just ask Unix
Date: 19 Jul 2012 10:34:30
Message: <50081af6$1@news.povray.org>
On 19/07/2012 10:24 AM, Invisible wrote:

> 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? :-/

A simple test confirms that this is indeed the case. Compile 
HelloWorld.c on OpenSUSE and it works. Copy it to Debian and it 
complains about lots of lib.so files not existing...

Apparently the solution is http://www.pgbovine.net/cde.html


Post a reply to this message

From: Francois Labreque
Subject: Re: Just ask Google
Date: 19 Jul 2012 11:06:47
Message: <50082287$1@news.povray.org>
Le 2012-07-19 10:32, Invisible a écrit :
>>> 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
>
> I thought the term for that was "virtual server"? (Or "dedicated server"
> if the physical hardware is not shared - usually very expensive!)

Well you might have shell access on a shared server, but with the advent 
of easier virtualization, it's easier to just give you a VM rather than 
worrying about the security mightmares of having multiple users 
installing software on the same machine.

-- 
/*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.