Configure Codenode with Apache

2 views
Skip to first unread message

theo

unread,
Aug 28, 2009, 1:33:46 PM8/28/09
to codenode-devel
First of all, I would like to say how pleased I am with codenode; I
have been searching for a web-based programming tool for a while. It
was hard getting started - not installing, but using it: I couldn't
find any documentation online. Lukily, I stumbled upon http://knoboo.com/demos/
which finally told me how to run the script! (shift+enter)

So far I have used Apache's ProxyPass to redirect a subdomain to the
server running on twisted (localhost:8000). That works OK, however, I
would like to set it up similarly to Django using SetHandler and
PythonHandler. I tried setting it up the way I would with Django and
everything works fine except for running the notebook code - when I
hit shift+enter nothing happens. Does anybody know how this would be
done with Apache? Also, would it be possible to, instead of having it
on a subdomain, accessing it like this: example.com/codenode/ and move
the root "/" to "/codenode/"?

Thank you

Alex Clemesha

unread,
Aug 28, 2009, 2:44:06 PM8/28/09
to codenod...@googlegroups.com
On Fri, Aug 28, 2009 at 10:33 AM, theo<theoj...@gmail.com> wrote:
>
> First of all, I would like to say how pleased I am with codenode; I
> have been searching for a web-based programming tool for a while.
Great!


It
> was hard getting started - not installing, but using it: I couldn't
> find any documentation online. Lukily, I stumbled upon http://knoboo.com/demos/
> which finally told me how to run the script! (shift+enter)
Oh my, I'll say that this is a pretty bad "bug". We need to make it way more
obvious how to get started. I'll be (re)-adding the "help" tab back into the
interface very soon (I'm working on making all the documentation work
with Sphinx).

What was the very first thing you did to figure out how to run
some code? Do you have any suggestions on how to make getting
starting way more painless?



>
> So far I have used Apache's ProxyPass to redirect a subdomain to the
> server running on twisted (localhost:8000). That works OK, however, I
> would like to set it up similarly to Django using SetHandler and
> PythonHandler. I tried setting it up the way I would with Django and
> everything works fine except for running the notebook code - when I
> hit shift+enter nothing happens. Does anybody know how this would be
> done with Apache?
This should be very possible, but there could be some type of bug.

So just to understand correctly what you are trying to do, you
are running Django off Apache (not Twisted WSGI, which is the default).

Actually what could be the problem is that there are a couple key
http resource (namely, "/asyncnotebook/the_notebook_guid/*) that
are not Django views, they are Twisted Resources, and there could
be a problem with apache proxying them. I or someone else will
actually try do this, get it working, and then reply with a solution.



Also, would it be possible to, instead of having it
> on a subdomain, accessing it like this: example.com/codenode/ and move
> the root "/" to "/codenode/"?
Yes, this also should be possible. We'll figure out what the issue is and
put up the solution.


thanks,
Alex



>
> Thank you
> >
>



--
Alex Clemesha
clemesha.org

theo

unread,
Aug 28, 2009, 5:37:57 PM8/28/09
to codenode-devel
As soon as I installed codenode following the instructions I found on
Github, I launched it via twisted and gave it a try. I couldn't figure
out how to get my code to run! After googling for about an hour I
finally found that screen cast, which was excellent for a first time
user - if only I found it sooner! If you had a link to this screen
cast, or better yet, to a written tutorial that walks you through the
basic concepts.

As for changing the root of the site, I think I found a solution:
change django.root and make /static accessible through Apache. Maybe
it could be possible to change the <base> in the <head> of the base
template: <base href="/mycodenode/">

Yes, I am trying to run codenode through Apache with the Django
plugin, instead of Twisted. I have a set-up similar to this:
http://jeffbaier.com/articles/installing-django-on-an-ubuntu-linux-server/

Is there a way to get these Twisted Resources to work with Django and
Apache? How do most people run a codenode server, with Twisted?

Thank you for your help.

On Aug 28, 8:44 pm, Alex Clemesha <cleme...@gmail.com> wrote:
> On Fri, Aug 28, 2009 at 10:33 AM, theo<theojep...@gmail.com> wrote:
>
> > First of all, I would like to say how pleased I am with codenode; I
> > have been searching for a web-based programming tool for a while.
>
> Great!
>
>  It> was hard getting started - not installing, but using it: I couldn't
> > find any documentation online. Lukily, I stumbled uponhttp://knoboo.com/demos/
Message has been deleted

Alex Clemesha

unread,
Aug 31, 2009, 5:19:04 AM8/31/09
to codenod...@googlegroups.com
On Sun, Aug 30, 2009 at 10:34 PM, Theo Jepsen<theoj...@gmail.com> wrote:
> As soon as I installed codenode following the instructions I found on
> Github, I launched it via twisted and gave it a try. I couldn't figure
> out how to get my code to run! After googling for about an hour I
> finally found that screen cast, which was excellent for a first time
> user - if only I found it sooner! If you had a link to this screen
> cast, or better yet, to a written tutorial that walks you through the
> basic concepts.
I've been working on better docs, but hearing that you google'd around
for an hour got me very motivated!
Here they are:
http://codenode.org/docs/
There's still more improvements to be made, but this is a good start.




>
> As for changing the root of the site, I think I found a solution:
> change django.root and make /static accessible through Apache. Maybe
> it could be possible to change the <base> in the <head> of the base
> template: <base href="/mycodenode/">
>
> Yes, I am trying to run codenode through Apache with the Django
> plugin, instead of Twisted. I have a set-up similar to this:
> http://jeffbaier.com/articles/installing-django-on-an-ubuntu-linux-se...

Ok, cool, I see. I'll either go through this setup myself, and add it to
the docs, or, if you feel like it, write up what you did, and I'll add it :-) !




> Is there a way to get these Twisted Resources to work with Django and
> Apache? How do most people run a codenode server, with Twisted?
Yeah, right now with Twisted... in fact Twisted is a pretty darn good webserver
(among other things). For larger User bases the Apache/Nginx solution is
the way to go.



> By the way, how am I supposed to reply to google groups messages, by email
> or on the groups page?
Probably just email the group address is the easiest, but whatever work for
you is fine.


thanks,
Alex




>
> Thank you for your help.
>
> Theo
--
Alex Clemesha
clemesha.org

Theo Jepsen

unread,
Aug 31, 2009, 5:29:35 AM8/31/09
to codenod...@googlegroups.com
I just saw the documentation. Perfect! You got the vital information (or at least for me) in there - Hold down Shift and hit Enter.

You mentioned I should write up the documentation for setting up Apache with Django. However, Codenode doesn't work with this setup yet since, as you said, maybe the Twisted Resources are inaccessible through Apache. As a result, you cannot run the code you write in notebooks, which defeats the purpose of Codenode! Do you have any suggestions as to how I can fix this problem?

Thank you,

Theo

Alex Clemesha

unread,
Aug 31, 2009, 5:38:45 AM8/31/09
to codenod...@googlegroups.com
On Mon, Aug 31, 2009 at 2:29 AM, Theo Jepsen<theoj...@gmail.com> wrote:
> I just saw the documentation. Perfect! You got the vital information (or at
> least for me) in there - Hold down Shift and hit Enter.
:-)


>
> You mentioned I should write up the documentation for setting up Apache with
> Django. However, Codenode doesn't work with this setup yet since, as you
> said, maybe the Twisted Resources are inaccessible through Apache. As a
> result, you cannot run the code you write in notebooks, which defeats the
> purpose of Codenode!
Yes, true, sorry! I'll get to figuring out how to fix this as soon as
I have a chance.

-Alex
--
Alex Clemesha
clemesha.org

Tim Dumol

unread,
Aug 31, 2009, 12:33:32 PM8/31/09
to codenode-devel
Would it not be possible to set up Apache as a proxy to the Twisted
server in the meantime? There are settings in Apache for that.

On Aug 31, 5:38 pm, Alex Clemesha <cleme...@gmail.com> wrote:
> On Mon, Aug 31, 2009 at 2:29 AM, Theo Jepsen<theojep...@gmail.com> wrote:
> > I just saw the documentation. Perfect! You got the vital information (or at
> > least for me) in there - Hold down Shift and hit Enter.
>
> :-)
>
>
>
> > You mentioned I should write up the documentation for setting up Apache with
> > Django. However, Codenode doesn't work with this setup yet since, as you
> > said, maybe the Twisted Resources are inaccessible through Apache. As a
> > result, you cannot run the code you write in notebooks, which defeats the
> > purpose of Codenode!
>
> Yes, true, sorry!  I'll get to figuring out how to fix this as soon as
> I have a chance.
>
> -Alex
>
> Do you have any suggestions as to how I can fix this
>
>
>
> > problem?
>
> > Thank you,
>
> > Theo
>
> > On Mon, Aug 31, 2009 at 11:19 AM, Alex Clemesha <cleme...@gmail.com> wrote:
> >> > On Fri, Aug 28, 2009 at 11:37 PM, theo <theojep...@gmail.com> wrote:
>
> >> >> As soon as I installed codenode following the instructions I found on
> >> >> Github, I launched it via twisted and gave it a try. I couldn't figure
> >> >> out how to get my code to run! After googling for about an hour I
> >> >> finally found that screen cast, which was excellent for a first time
> >> >> user - if only I found it sooner! If you had a link to this screen
> >> >> cast, or better yet, to a written tutorial that walks you through the
> >> >> basic concepts.
>
> >> >> As for changing the root of the site, I think I found a solution:
> >> >> change django.root and make /static accessible through Apache. Maybe
> >> >> it could be possible to change the <base> in the <head> of the base
> >> >> template: <base href="/mycodenode/">
>
> >> >> Yes, I am trying to run codenode through Apache with the Django
> >> >> plugin, instead of Twisted. I have a set-up similar to this:
>
> >> >>http://jeffbaier.com/articles/installing-django-on-an-ubuntu-linux-se...

Theo Jepsen

unread,
Aug 31, 2009, 4:56:38 PM8/31/09
to codenod...@googlegroups.com
Tim,

I appreciate your suggestion.That is the workaround I already found to address the problem:

<VirtualHost *:80>
        ServerName codenode.example.com
        ProxyPass /  http://localhost:8000/
        ProxyPassReverse / http://localhost:8000/
</VirtualHost>

Although this works, I believe it is a dirty solution. I was trying to set it up the way Django recommend it be done with Apache: http://www.djangobook.com/en/2.0/chapter12/

I was also reading about using mod_wsgi to serve a Django application, but I will have to work some more with it before I know whether or not it works with Codenode: http://djangoinproduction.com/wiki/Apache_and_mod_wsgi

Theo

William Stein

unread,
Aug 31, 2009, 5:09:55 PM8/31/09
to codenod...@googlegroups.com
On Mon, Aug 31, 2009 at 1:56 PM, Theo Jepsen <theoj...@gmail.com> wrote:
Tim,

I appreciate your suggestion.That is the workaround I already found to address the problem:

<VirtualHost *:80>
        ServerName codenode.example.com
        ProxyPass /  http://localhost:8000/
        ProxyPassReverse / http://localhost:8000/
</VirtualHost>

Although this works, I believe it is a dirty solution. I was trying to set it up the way Django recommend it be done with Apache: http://www.djangobook.com/en/2.0/chapter12/

That's also exactly what I do with http://sagenb.org, which I run in a virtual machine, but proxy through apache on a real computer.

William
 



--
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org
Reply all
Reply to author
Forward
0 new messages