ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 15 Sep 2010 11:28:18 -0500move sage server to host.edu/sage from host.eduhttp://ask.sagemath.org/question/7686/move-sage-server-to-hostedusage-from-hostedu/Dear sage community,
Is there a simple way to move our sage server from https://our.computer.edu:8000 to https://our.computer.edu:8000/sage?
We are running on Centos5.5 if it makes a difference.
Thanks for your time,
TomMon, 13 Sep 2010 12:21:30 -0500http://ask.sagemath.org/question/7686/move-sage-server-to-hostedusage-from-hostedu/Comment by ccanonc for <p>Dear sage community,</p>
<p>Is there a simple way to move our sage server from <a href="https://our.computer.edu:8000">https://our.computer.edu:8000</a> to <a href="https://our.computer.edu:8000/sage">https://our.computer.edu:8000/sage?</a></p>
<p>We are running on Centos5.5 if it makes a difference.</p>
<p>Thanks for your time,
Tom</p>
http://ask.sagemath.org/question/7686/move-sage-server-to-hostedusage-from-hostedu/?comment=22653#post-id-22653Why do you want to move it? Would a redirect from /sage back to the current address be ok?Mon, 13 Sep 2010 12:40:25 -0500http://ask.sagemath.org/question/7686/move-sage-server-to-hostedusage-from-hostedu/?comment=22653#post-id-22653Comment by tom for <p>Dear sage community,</p>
<p>Is there a simple way to move our sage server from <a href="https://our.computer.edu:8000">https://our.computer.edu:8000</a> to <a href="https://our.computer.edu:8000/sage">https://our.computer.edu:8000/sage?</a></p>
<p>We are running on Centos5.5 if it makes a difference.</p>
<p>Thanks for your time,
Tom</p>
http://ask.sagemath.org/question/7686/move-sage-server-to-hostedusage-from-hostedu/?comment=22652#post-id-22652We would like to move sage so that we can have other served applications at the same web site. For example we want a mercurial repository url http://our.computer.edu/hg
We are flexible if you can think of alternate ways of doing this.
Mon, 13 Sep 2010 15:09:09 -0500http://ask.sagemath.org/question/7686/move-sage-server-to-hostedusage-from-hostedu/?comment=22652#post-id-22652Answer by Mitesh Patel for <p>Dear sage community,</p>
<p>Is there a simple way to move our sage server from <a href="https://our.computer.edu:8000">https://our.computer.edu:8000</a> to <a href="https://our.computer.edu:8000/sage">https://our.computer.edu:8000/sage?</a></p>
<p>We are running on Centos5.5 if it makes a difference.</p>
<p>Thanks for your time,
Tom</p>
http://ask.sagemath.org/question/7686/move-sage-server-to-hostedusage-from-hostedu/?answer=11649#post-id-11649You may be able to use [Apache's][1] ` ` [`mod_proxy`][2] and [`VirtualHost`s][3] to solve your problem. I suggest looking at ProxyPass, ProxyPassReverse, ProxyPreserveHost, and maybe also [`mod_rewrite`'s][4] rewriting directives.
A small example: I appended
<VirtualHost *>
ProxyPreserveHost On
ProxyPass / http://localhost:8000/
ProxyPassReverse / http://localhost:8000/
<Location /hg/>
</Location>
</VirtualHost>
to `/etc/httpd/conf/httpd.conf` on my Fedora 12 machine. Then, I (re)started Apache with `service http restart` and *separately* ran `hg serve` in a local Mercurial repository. With this setup, I could access the repository at `http://localhost/hg/`.
You could also try this with a notebook server started with `interface='localhost'`. In this case, the `ProxyPreserveHost` directive is important --- it will fix the problem described at [#8205][5].
However, I don't how well this works with secure servers and URLs. You may need to tweak the configuration further. Please let us know!
[1]: http://httpd.apache.org/
[2]: http://httpd.apache.org/docs/current/mod/mod_proxy.html
[3]: http://httpd.apache.org/docs/current/vhosts/
[4]: http://httpd.apache.org/docs/current/mod/mod_rewrite.html
[5]: http://trac.sagemath.org/sage_trac/ticket/8205Mon, 13 Sep 2010 15:33:50 -0500http://ask.sagemath.org/question/7686/move-sage-server-to-hostedusage-from-hostedu/?answer=11649#post-id-11649Comment by tom for <p>You may be able to use <a href="http://httpd.apache.org/">Apache's</a> <code></code> <a href="http://httpd.apache.org/docs/current/mod/mod_proxy.html"><code>mod_proxy</code></a> and <a href="http://httpd.apache.org/docs/current/vhosts/"><code>VirtualHost</code>s</a> to solve your problem. I suggest looking at ProxyPass, ProxyPassReverse, ProxyPreserveHost, and maybe also <a href="http://httpd.apache.org/docs/current/mod/mod_rewrite.html"><code>mod_rewrite</code>'s</a> rewriting directives.</p>
<p>A small example: I appended</p>
<pre><code><VirtualHost *>
ProxyPreserveHost On
ProxyPass / http://localhost:8000/
ProxyPassReverse / http://localhost:8000/
<Location /hg/>
</Location>
</VirtualHost>
</code></pre>
<p>to <code>/etc/httpd/conf/httpd.conf</code> on my Fedora 12 machine. Then, I (re)started Apache with <code>service http restart</code> and <em>separately</em> ran <code>hg serve</code> in a local Mercurial repository. With this setup, I could access the repository at <code>http://localhost/hg/</code>.</p>
<p>You could also try this with a notebook server started with <code>interface='localhost'</code>. In this case, the <code>ProxyPreserveHost</code> directive is important --- it will fix the problem described at <a href="http://trac.sagemath.org/sage_trac/ticket/8205">#8205</a>.</p>
<p>However, I don't how well this works with secure servers and URLs. You may need to tweak the configuration further. Please let us know!</p>
http://ask.sagemath.org/question/7686/move-sage-server-to-hostedusage-from-hostedu/?comment=22651#post-id-22651We are serving the web pages in the normal way with saged started with a command like
/sbin/service saged start
Can sage also run under apache? Is there a URL for a recipe for this?Mon, 13 Sep 2010 15:48:14 -0500http://ask.sagemath.org/question/7686/move-sage-server-to-hostedusage-from-hostedu/?comment=22651#post-id-22651Answer by tom for <p>Dear sage community,</p>
<p>Is there a simple way to move our sage server from <a href="https://our.computer.edu:8000">https://our.computer.edu:8000</a> to <a href="https://our.computer.edu:8000/sage">https://our.computer.edu:8000/sage?</a></p>
<p>We are running on Centos5.5 if it makes a difference.</p>
<p>Thanks for your time,
Tom</p>
http://ask.sagemath.org/question/7686/move-sage-server-to-hostedusage-from-hostedu/?answer=11655#post-id-11655Success! The saged and apache serving of hg are running together. We did not change anything on the sage server which serves sage through the standard
https://our.computer.edu:8000/ and the hg respositories are visible on http://our.computer.edu/hg
We followed the suggestion of using (actually the default!) VirtualHost settings in apache
<pre><code>
<VirtualHost *>
ServerSignature email
DirectoryIndex index.php index.html index.htm index.shtml
LogLevel warn
HostNameLookups off
</VirtualHost>
</code></pre>
(note we found no proxy... directives were necessary)
and used the usual
ScriptAlias /hg /our/path/to/hgweb.cgi
It took us a while because there are so many little things to check; permissions, and selinux, but finally it worked in this super simple way!Wed, 15 Sep 2010 09:22:53 -0500http://ask.sagemath.org/question/7686/move-sage-server-to-hostedusage-from-hostedu/?answer=11655#post-id-11655Comment by Mitesh Patel for <p>Success! The saged and apache serving of hg are running together. We did not change anything on the sage server which serves sage through the standard
<a href="https://our.computer.edu:8000/">https://our.computer.edu:8000/</a> and the hg respositories are visible on <a href="http://our.computer.edu/hg">http://our.computer.edu/hg</a>
We followed the suggestion of using (actually the default!) VirtualHost settings in apache</p>
<pre><code>
<VirtualHost *>
ServerSignature email
DirectoryIndex index.php index.html index.htm index.shtml
LogLevel warn
HostNameLookups off
</VirtualHost>
</code></pre>
<p>(note we found no proxy... directives were necessary)
and used the usual
ScriptAlias /hg /our/path/to/hgweb.cgi
It took us a while because there are so many little things to check; permissions, and selinux, but finally it worked in this super simple way!</p>
http://ask.sagemath.org/question/7686/move-sage-server-to-hostedusage-from-hostedu/?comment=22646#post-id-22646That's great!Wed, 15 Sep 2010 11:28:18 -0500http://ask.sagemath.org/question/7686/move-sage-server-to-hostedusage-from-hostedu/?comment=22646#post-id-22646Answer by ccanonc for <p>Dear sage community,</p>
<p>Is there a simple way to move our sage server from <a href="https://our.computer.edu:8000">https://our.computer.edu:8000</a> to <a href="https://our.computer.edu:8000/sage">https://our.computer.edu:8000/sage?</a></p>
<p>We are running on Centos5.5 if it makes a difference.</p>
<p>Thanks for your time,
Tom</p>
http://ask.sagemath.org/question/7686/move-sage-server-to-hostedusage-from-hostedu/?answer=11650#post-id-11650Ok, I understand now, Mercurial uses the same default port (8000). I suggest changing the port used for either Sage or Mercurial; whichever is easiest for you. <br>
[http://linux.die.net/man/1/hg][1]
[1]: http://linux.die.net/man/1/hgMon, 13 Sep 2010 16:06:12 -0500http://ask.sagemath.org/question/7686/move-sage-server-to-hostedusage-from-hostedu/?answer=11650#post-id-11650