Hard Light Productions Forums

Off-Topic Discussion => General Discussion => Topic started by: Sandwich on March 28, 2005, 07:44:38 am

Title: Webserver On a Thumb Drive?
Post by: Sandwich on March 28, 2005, 07:44:38 am
Would anybody have any ideas how I can get a typical USB thumb drive to work as a PHP/MySQL webserver, so I can take it in to another computer and load up a dynamic site in a browser? I have an inkling that it's impossible, but can't hurt to ask.
Title: Webserver On a Thumb Drive?
Post by: MatthewPapa on March 28, 2005, 07:52:45 am
I am 99% sure its impossible....i thought of something similiar once.....but since you cant run server software on a thumb drive its impossible.
Title: Webserver On a Thumb Drive?
Post by: MatthewPapa on March 28, 2005, 07:55:40 am
Unless of course you loaded the server software on the target machine, but is that probably defeats the purpose of what your trying to do...
Title: Webserver On a Thumb Drive?
Post by: kasperl on March 28, 2005, 08:11:20 am
A drive isn't a processor, you're only bet  is getting a big drive, a Linux distro, and boot from the thumbdrive into a linux distro running all your stuff.
Title: Webserver On a Thumb Drive?
Post by: Sandwich on March 28, 2005, 08:13:39 am
I guess it would require there being some sort of standalone Apache "program" that one could run that would map http://127.0.0.1/ to a folder.
Title: Webserver On a Thumb Drive?
Post by: kasperl on March 28, 2005, 08:19:00 am
I think the main issue is storage!=processing.

You need to process stuff to make it dynamic, therefore, you need software installed on some computer.
Title: Webserver On a Thumb Drive?
Post by: aldo_14 on March 28, 2005, 08:27:44 am
Hmm.... what are you trying to do, exactly?  Dynamically generate content off of a USB drive and view it on a local PC?

(i.e. instead of from remote server, take it from a local server using the USB drive data?)
Title: Webserver On a Thumb Drive?
Post by: Martinus on March 28, 2005, 11:19:54 am
[color=66ff00]Looked into thumbdrive distro's a while back and their issues, you need to be careful with the application; thumbdrives have a limited read write life which certain applications can murder.

Offhand I can only remember featherlinux. You get a surprising amount of applications in one of those. Hmmm, Knoppix boots off a CD and might have what you need, they push everything under the sun into one of those ISO's. :nod:
[/color]
Title: Webserver On a Thumb Drive?
Post by: Sandwich on March 28, 2005, 11:45:23 am
Quote
Originally posted by aldo_14
Hmm.... what are you trying to do, exactly?  Dynamically generate content off of a USB drive and view it on a local PC?

(i.e. instead of from remote server, take it from a local server using the USB drive data?)


I have a prototype website I'm building in PHP with a MySQL database tie-in. I'd like to take it to the client's offices to show them, but they do not have any computers with Apache or the equivalent installed. And let's just say that for the sake of argument, I can't upload it anywhere.
Title: Webserver On a Thumb Drive?
Post by: kasperl on March 28, 2005, 12:35:50 pm
Knoppix, or some other LiveCD.

It'll allow you to use the local RAM as RAM, saving your drive. You might still be safer of with a CD, though.
Title: Webserver On a Thumb Drive?
Post by: MatthewPapa on March 28, 2005, 02:37:15 pm
Quote
Originally posted by Sandwich


I have a prototype website I'm building in PHP with a MySQL database tie-in. I'd like to take it to the client's offices to show them, but they do not have any computers with Apache or the equivalent installed. And let's just say that for the sake of argument, I can't upload it anywhere.


Well, if you need to borrow use of a remote machine I can give you an MySQL and FTP account on my old freespaceserver (http://freespaceserver.cjb.net)  that used to hold Game Warden.
Title: Webserver On a Thumb Drive?
Post by: Sandwich on March 28, 2005, 03:03:12 pm
The problem with Knoppix is that I need to configure the MySQL and PHP parts of the webserver, and that configuration is not saved on disc, but on HDD.

And I have access to plenty of webservers online that I could potentially use, I just was wondering if there was a USB drive way to accomplish the goal. Guess not, though.
Title: Webserver On a Thumb Drive?
Post by: 1-Off on March 29, 2005, 12:36:18 am
Extract THIS (http://sourceforge.net/project/showfiles.php?group_id=53691&package_id=48193) onto your hard-drive, copy it to the 'thumb' drive.

Then (assuming you've got a driverless USB drive) you can just plug it into a port, open the drive, double-click Start.bat and "Start MySQL Server" on the subsequent admin page, and you're good to go with a fully functional PHP/MySQL/Apache setup running off the drive.

Lord knows how fast or how stable it'll be, but it'll work [in theory].

*waits to be banned again*
Title: Webserver On a Thumb Drive?
Post by: WMCoolmon on March 29, 2005, 02:39:26 am
You'd be much better off asking on a Linux forum...

This sounds like something someone might have done, just for amusement. I don't think you'd be able to boot directly from the thumb drive (you'd need a floppy) but it should be possible to make a distro entirely on the thumb drive that does what you want (mounted read-only and using a ramdisk for all file writing needed) - and just have the boot loader on a floppy.

The question is whether or not that exists atm...
Title: Webserver On a Thumb Drive?
Post by: Sandwich on March 29, 2005, 11:13:55 am
Quote
Originally posted by 1-Off
Extract THIS (http://sourceforge.net/project/showfiles.php?group_id=53691&package_id=48193) onto your hard-drive, copy it to the 'thumb' drive.

Then (assuming you've got a driverless USB drive) you can just plug it into a port, open the drive, double-click Start.bat and "Start MySQL Server" on the subsequent admin page, and you're good to go with a fully functional PHP/MySQL/Apache setup running off the drive.

Lord knows how fast or how stable it'll be, but it'll work [in theory].

*waits to be banned again*


an0n?? :wtf:

That project is precisely what I was looking for. :yes: It works beautifully - danke sheun! :)
Title: Webserver On a Thumb Drive?
Post by: IceFire on March 29, 2005, 11:47:39 am
WOW...I'm in awe!
Title: Webserver On a Thumb Drive?
Post by: 1-Off on March 29, 2005, 01:33:59 pm
See, I do have my non-destructive uses.

Incidentally, you didn't ban my IP, you banned the local subnet exchange thingy's IP - it's semi-transparent as a security precaution - which means you've banned a large part of North Eastern UK. Good going :yes:
Title: Webserver On a Thumb Drive?
Post by: Sandwich on March 29, 2005, 03:23:58 pm
So tell me then, why do you keep on doing things that get you banned?
Title: Webserver On a Thumb Drive?
Post by: 1-Off on March 29, 2005, 03:38:05 pm
Because of the 'Circle Jerk Effect'.

Whereby - being generally pussies - the collective asshattery of the Admin staff results in my innocuous jokes being taken as intentional slander.

From there it progresses into a group therapy session before Shrike comes along and goes "Christ! Just ban him, you bunch of little goddamn girls..."

In short: It's everbody's fault but my own.
Title: Webserver On a Thumb Drive?
Post by: redsniper on March 29, 2005, 04:15:20 pm
It is an0n. I guess I was wrong in the other thread. Welcome back. (don't know for how long)
Whoa... post # 1337 :arr:
Title: Webserver On a Thumb Drive?
Post by: 1-Off on March 29, 2005, 04:31:14 pm
What 'other thread'?
Title: Webserver On a Thumb Drive?
Post by: redsniper on March 29, 2005, 04:34:30 pm
the one where you posted something, then Rictor says "I wonder who that is" insinuating that it's you, and then I respond "It doesn't sound like an0n"
EDIT: "Land of the Free"
Title: Webserver On a Thumb Drive?
Post by: WeatherOp on March 29, 2005, 04:34:56 pm
I was wondering why that model in the contest said an0n.
Title: Webserver On a Thumb Drive?
Post by: 1-Off on March 29, 2005, 04:41:33 pm
.................And they banned me!

Jesus ****ing Christ.....
Title: Webserver On a Thumb Drive?
Post by: Shrike on March 29, 2005, 04:52:37 pm
Quote
Originally posted by 1-Off
From there it progresses into a group therapy session before Shrike comes along and goes "Christ! Just ban him, you bunch of little goddamn girls..."
I'd never say that.

I'd involve more swearing. :p
Title: Webserver On a Thumb Drive?
Post by: 1-Off on March 29, 2005, 04:55:11 pm
Considering I'm still under a ban, I thought it best not to aggrevate anyone by trying to **** with the censor.
Title: Webserver On a Thumb Drive?
Post by: Shrike on March 29, 2005, 04:57:15 pm
I feel like turning it off again.  I hate censors.
Title: Webserver On a Thumb Drive?
Post by: 1-Off on March 29, 2005, 04:56:29 pm
You could always make it replace the *'s with :mad:'s
Title: Webserver On a Thumb Drive?
Post by: 1-Off on March 29, 2005, 04:57:00 pm
I see the time thing is still ****ed.....
Title: Webserver On a Thumb Drive?
Post by: Windrunner on March 29, 2005, 05:36:45 pm
yeah we know that you hate but lets keep it as it is shall we..
Title: Webserver On a Thumb Drive?
Post by: 1-Off on March 29, 2005, 06:07:48 pm
Incidentally, you can fix the time thing through centralization of the referencing.

It's ****ing up now because it's using PHP's time() function, which is relative to the server.

To fix just the post times: Replace time() in the MySQL query with NOW() - which is a MySQL function - and it'll use the singular MySQL database server's clock instead of the multiple and relative dynamic server clocks.

Or as a better way, open up newreply.php and newthread.php in WordPad then Find/Replace all instances of time() with $time.

Then add something like:
$checker = file("http://whatever.com/time.php") or die(time());
if (str_len($checker)!=WHATEVER-IT-SHOULD-BE) {
$time = time();
} else {
$time = $checker;
}
....to the beginning of the global.php and make a file called time.php at whatever.com containing:
echo time();

That way all your references to time in whichever files you Find/Replaced the contents of would be synched to a central clock - namely the clock of the server upon which the time.php was stored.

Also, if it can't get time.php it defaults to the server's time(). If it gets it and it's too long (IE, an error message) it defaults to the server's time(). So if it's anything other than a time() output, it goes "**** it" and uses the server's time() instead.
Title: Webserver On a Thumb Drive?
Post by: Ace on March 29, 2005, 06:12:22 pm
Quote
Originally posted by Windrunner
yeah we know that you hate but lets keep it as it is shall we..


Why? We know what words are in the "*"s. Is there really a point to censorship of this nature? It's not truely protecting anyone from anything.

The logic of "FreeSpace is a teen rated game, thus the forums must be teen rated" isn't even being used here for the censorship.
Title: Webserver On a Thumb Drive?
Post by: 1-Off on March 29, 2005, 06:18:28 pm
Hows about "GameSpy are dicks"?
Title: Webserver On a Thumb Drive?
Post by: Sandwich on March 30, 2005, 07:35:20 am
Quote
Originally posted by Ace


Why? We know what words are in the "*"s. Is there really a point to censorship of this nature? It's not truely protecting anyone from anything.

The logic of "FreeSpace is a teen rated game, thus the forums must be teen rated" isn't even being used here for the censorship.


The logic is that we'd rather not have to deal with any possible "my child saw this and that on your forums and is now swearing all over the place" accusations. Nothing more, nothing less.

And since you all know what the asterisks are replacing, then leaving them there isn't going to harm your ability to express yourselves, now is it?

So quit your ******* ******** already. :p
Title: Webserver On a Thumb Drive?
Post by: aldo_14 on March 30, 2005, 07:50:43 am
Anyone who gives a ****ing **** about my ****ing *****ing about ****ing anything needs to take a ****ing minute to ****ing step back and look at all the ****ing **** that ****ing happens in the ****ing world and understand there's more ****ing important **** to give a **** about.

*cough*

Sorry.  I think excessive swearing is more amusing with the filter, though. :D

Although I had to edit in asterisks.... it's not a particularly strict filter, really - strange that 'b itch' but not **** is censored.
Title: Webserver On a Thumb Drive?
Post by: MatthewPapa on March 30, 2005, 02:29:37 pm
So....an0ns new account got deleted again?
Title: Webserver On a Thumb Drive?
Post by: StratComm on March 30, 2005, 02:38:13 pm
All of them, yes.  It's a game of will now, an0n's against the collective will of the Administrative staff here, as to who will give up first.  It's not helping an0n's chances for being unbanned though.
Title: Webserver On a Thumb Drive?
Post by: WMCoolmon on March 30, 2005, 05:37:30 pm
Quote
Originally posted by aldo_14
I think excessive swearing is more amusing with the filter, though. :D