Plain Old Webserver Help and Hints

Announce and Discuss the Latest Theme and Extension Releases.
smartboyathome
Posts: 6
Joined: January 10th, 2007, 3:54 pm

Post by smartboyathome »

I contact you with the same question as above: WHERE IS THE STARTUP FOLDER?! I can not find it anywhere, and I need it to put my web page on the internet. Please respond ASAP. Thanks!
pcorcoran
Posts: 1
Joined: February 15th, 2007, 12:35 pm

Root Directory change?

Post by pcorcoran »

I have been trying to change the root directory to be something other than the default in profiles/xxx/pow/htdocs. But the change doesn't seem to work, even after FF restart.

Must this directory live in FF profiles?
Jerry1o1o1o
Posts: 3
Joined: February 28th, 2007, 7:05 am

getting started

Post by Jerry1o1o1o »

at http://localhost:6670/

there is no link, no start up folder, nothing to drag, no directory.

Firewall problem? Recommended alternative port?

Else?

thanks.
dakellog
Posts: 33
Joined: July 31st, 2006, 12:06 pm

Post by dakellog »

smartboyathome wrote:I contact you with the same question as above: WHERE IS THE STARTUP FOLDER?! I can not find it anywhere, and I need it to put my web page on the internet. Please respond ASAP. Thanks!


Sorry for the delay. The startup file is at /pow/htdocs/system/startup.sjs

If you do not have this directory or file, add it. Here are the contents of my startup file.

<?sjs
pow_server.update_infinilink();
?>
---
DKPHD
dakellog
Posts: 33
Joined: July 31st, 2006, 12:06 pm

Re: getting started

Post by dakellog »

Jerry1o1o1o wrote:at http://localhost:6670/

there is no link, no start up folder, nothing to drag, no directory.

Firewall problem? Recommended alternative port?

Else?

thanks.


I always see this:

Drag this: POW Files

I drag it from the local machine, and it works. From a remote machine, it will not work. If all else fails, clean out your FF profile's pow directory and reinstall.
---
DKPHD
dakellog
Posts: 33
Joined: July 31st, 2006, 12:06 pm

Re: Root Directory change?

Post by dakellog »

pcorcoran wrote:I have been trying to change the root directory to be something other than the default in profiles/xxx/pow/htdocs. But the change doesn't seem to work, even after FF restart.

Must this directory live in FF profiles?


It is not necessary to be in your profiles directory. It can be anywhere you have permission to write. Currently, my filepicker on the Mac does not work with my POW options. This is a bug. I will fix it for the next version.

DK
---
DKPHD
smartboyathome
Posts: 6
Joined: January 10th, 2007, 3:54 pm

Post by smartboyathome »

dakellog wrote:
smartboyathome wrote:I contact you with the same question as above: WHERE IS THE STARTUP FOLDER?! I can not find it anywhere, and I need it to put my web page on the internet. Please respond ASAP. Thanks!


Sorry for the delay. The startup file is at /pow/htdocs/system/startup.sjs

If you do not have this directory or file, add it. Here are the contents of my startup file.

<sjs>


Thanks, now I have another question. On the host computer, it says that it cannot find (my IP): 6670. I have not created a web site on it yet, would this be why it is giving me this message? Also, now that it is working, would I be able to host, say, an SMF forum? If not, I am still happy, as I can make my own website. Good job!
mariopokemon2
Posts: 7
Joined: June 30th, 2005, 3:01 pm
Location: Scottsdale, Arizona
Contact:

Post by mariopokemon2 »

I already have my firewall open for a server and things like that so it shoudl work.

But anytime I do not use localhost:6670 and use my IP address, it fails to work.
tdhombre
Posts: 2
Joined: March 5th, 2007, 11:43 am
Contact:

Use of pow_exec

Post by tdhombre »

I am trying to use the pow_exec to call a perl script (which works with an empty 2nd parameter) passing an "array of argumennts" in the second parameter of the call. I am unable to get this to work. Can anyone provide a code snippet showing a working implementation of pow_exec? Here is what I am trying:

var abcde= new Array();
abcde = pow_server.REQUEST;
pow_exec("runme","abcde"); // call a script and pass the array of variables
var contents = pow_file("./results.txt"); // read results file into variable
document.writeln("file: " + contents); // output variable to document content

The sjs and "runme" scripts run without error but I can not get any parameters to pass into the perl script. The perl script writes the "results.txt" file read in by the sjs script.

Suggestions??
pivo
Posts: 1
Joined: February 13th, 2005, 6:19 pm

setTimeout() or sleep() ?

Post by pivo »

Is it possible to wait a certain amount of time in sjs, so that data is produced in chunks with a delay in between? That's important to debug incremental rendering and complex javascripts.
Dinjaga
Posts: 1
Joined: March 19th, 2007, 7:49 am

Halp?

Post by Dinjaga »

I've set it up, and everything works fine on my computer, but other people can't access it! My infinilink doesn't work...I have the startup.sjs document and everything, it still doesnt work! I downloaded it, made a helloworld.sjs document, made the system folder and the startup.sjs document. What else do I need to do?

208.63.114.185
My IP.

So http://208.63.114.185:6670/immigrantsong.mp3 should take me to a page with a small quicktime plug-in. It does when I type it in with localhost on this computer, but thats not worth alot.

It has no password yet...

~Dinjaga*

EDIT: It says a different port might work...can someone show me how to change that?
Cannikin
Posts: 12
Joined: February 16th, 2004, 10:29 am

Post by Cannikin »

David,

POW is amazing, I'm extremely excited about this project! This could very well be the future of web development -- everything in JS. Kudos for doing this and trying to keep up with the tech support. As the author of my own open source project (http://www.cfwheels.com) I know how annoying us fans can be. ;) I had a couple questions...

* I haven't seen this mentioned anywhere else yet: is there anything special that needs to be done to get SQLite database access working? Do I need the binary somewhere on my Windows system and PATH (which I've done), or is this something that Firefox includes natively? When I try to run your DB example (http://davidkellogg.com/wiki/Pow_db) I get this:

Error: /pow/htdocs/db/:13 results.column_names has no properties

If I comment out that line then I get nothing at all.

* It seems like if you have certain syntax errors (I was playing around, adding a new .prototype method for the Array object), the server just won't serve anything anymore, even valid pages like your welcome screen. Nothing brings it back short of closing and reopening Firefox. Is this just a limitation of trying to do server side javascript inside of Firefox, or do you think you can do something on your end to catch these kinds of errors and let us know?

* Any plans to bake in some of the JS extensions in Prototype or JQuery right into the native SJS language? I've tried including some Prototype extensions as SJS includes but I'm having trouble using them ... they seem to cause the same fatal syntax error mentioned above. I'm planning on going through more systematically and see if I can find what's failing.

* How about a standalone version of the server? Let's say we development a nice little app (a blog for example) in SJS and now want to serve it to the world. Having a regular app server and a simple Apache module to hand off requests and we'd have a bonified, enterprise-ready web server! Of course it would need to support the full Mozilla API to be completely compatible with any code that used those objects, but still. How hard can it be? (Easy for me to say!)

* Any chance debugging would ever be available in Firebug? If we had that, and a little IDE in the browser, Firefox would be a complete development environment! Now we're getting somewhere. :)
brettz9
Posts: 123
Joined: November 5th, 2005, 9:16 am

Post by brettz9 »

I'd like to echo Cannikin's hopeful comments about this holding the possibility of seeing everything written in Javascript as well as for having an IDE in Firefox (with syntax highlighting and everything).

I've added some comments at http://davidkellogg.com/wiki/Talk:Main_Page#Paradise.3F on how cool I think it would be to see an XPCOM component to be developed for Berkeley DB XML, the open source native XML database which supports the powerful XQuery language (if there are any C++ folks who could reverse engineer its C++ API into XPIDL). Please check out http://w3schools.com/xquery/default.asp or http://www.oracle.com/technology/docume ... query.html if you want to see a little bit about how cool this W3C language is, and how nice it would be to have this accessible from Javascript on the client or server side.

I have one more thought. If SSL could be supported, this would seem to offer the very interesting possibility of allowing a peer-to-peer proxy (which would be unencumbered by blocked public proxies) and with a minimum of setup hassle (just install an extension--heck, maybe it could even be added to the Firefox trunk (though turned off by default), in order to avoid the extension site being blckd). This would be very important for some folks living in certain places.

It's a pity that, as I understand it, the client-side functions would not work on the server-side (e.g., XSLT), as I can see some uses for that (though you can at least send the client-side code over, including AJAX).

While I haven't tested this or thought this through, it seems using Mozilla's features to save the DOM state (especially if POW could support PUT requests) might make for interesting applications too...

thanks,
Brett
brettz9
Posts: 123
Joined: November 5th, 2005, 9:16 am

Post by brettz9 »

Oh, and also, while this is even more of a security nightmare, it would be cool to develop some way to read raw (but very trusted) SSJS code from remote and interpret it live--thus having a kind of live-updated extension (that wouldn't need a Firefox reboot).

As I see it, for any comic book fans, this reopening up of SSJS is kind of like the Beyonder convincing Molecule Man in the Secret War series that he was also capable of manipulating organic molecules... ;) Lots of untapped power--largely due to a self-imposed mental block on people that-- server-side is server-side and client-side, client-side, and never the twain shall meet... Of course, there is also a lot of unfortunately destructive potential there too...
User avatar
Philip Chee
Posts: 6475
Joined: March 1st, 2005, 3:03 pm
Contact:

Post by Philip Chee »

Cannikin wrote:* It seems like if you have certain syntax errors (I was playing around, adding a new .prototype method for the Array object), the server just won't serve anything anymore, even valid pages like your welcome screen. Nothing brings it back short of closing and reopening Firefox. Is this just a limitation of trying to do server side javascript inside of Firefox, or do you think you can do something on your end to catch these kinds of errors and let us know?
Well don't add new methods to the Array prototype. Mostly because it causes problems with extensions - including POW as you noticed.

Phil
Post Reply