HTML-WebMake
view release on metacpan or search on metacpan
doc/cvshowto.html view on Meta::CPAN
access to your account on the server machine. If this is a problem, it would
probably be better not to set up <a href="cgistart.html">webmake.cgi</a>.
</p>
<p>
When illustrating the commands needed to run this, I'll use my username and my
hostnames. Wherever you see <strong>jm</strong>, replace with your username, wherever you
see <strong>localhost</strong>, replace with your server's hostname, and wherever you see
<strong>/cvsroot</strong>, replace with the path to your CVS repository on the server.
</p>
<a name="CREATING_THE_REPOSITORY"><h1>CREATING THE REPOSITORY</h1></a><p>
First of all, create the repository on the CVS server machine.
</p>
<p>
<pre>
<!--etsafe-->
mkdir /cvsroot;
cvs -d /cvsroot init
<!--/etsafe-->
</pre>
</p>
<a name="SETTING_UP_SSH"><h1>SETTING UP SSH</h1></a><p>
On a client machine, install the SSH client ("ssh"), and install the SSH server
("sshd") on the server machine. Set them up (as described in the ssh
documentation).
</p>
<p>
Next, if you haven't done this before, generate an ssh key pair for yourself
on all machines:
</p>
<p>
<pre>
<!--etsafe-->
ssh-keygen -P "" -N ""
<!--/etsafe-->
</pre>
</p>
<p>
When it asks for the filenames to save the keys in, hit Enter to accept the
defaults.
</p>
<p>
Any machines you plan to run <a href="cgistart.html">webmake.cgi</a> on, you will also need to generate a
key-pair for, so that the user the web server runs CGI scripts as will be able
to communicate without passwords. Here's how (run these as root):
</p>
<p>
<pre>
<!--etsafe-->
mkdir ~apache/.ssh
chmod 700 ~apache/.ssh
chown apache ~apache/.ssh
su apache -s/bin/sh -c 'ssh-keygen -P "" -N ""'
<!--/etsafe-->
</pre>
</p>
<p>
This will generate a public/private key-pair for the web server user. Note
that the user the web server runs as on your UNIX may be different (<strong>httpd</strong>,
<strong>www</strong>, or <strong>nobody</strong> are common usernames for it); in that case replace
<strong>apache</strong> with the correct username.
</p>
<p>
Don't worry; the keys you've set up will not compromise your server's
security, as the SSH daemon will not allow anyone to log in as the web server
user, since they have a no-login shell.
</p>
<a name="SETTING_UP_NO_PASSWORD_LOGINS"><h1>SETTING UP NO-PASSWORD LOGINS</h1></a><p>
This is optional for editing the site by hand using CVS, but if you're using
<a href="cgistart.html">webmake.cgi</a>, it will require that this works.
</p>
<p>
Here's how to set it up for <a href="cgistart.html">webmake.cgi</a>. Get the public key you just
generated for the web user (run this as root):
</p>
<p>
<pre>
<!--etsafe-->
cat ~apache/.ssh/identity.pub
<!--/etsafe-->
</pre>
</p>
<p>
you should get a long stream of gibberish starting with "1024" and ending
with a hostname; that's the public key. Here's mine:
</p>
<p>
<pre>
<!--etsafe-->
1024 35
15059408357788156311432762154619731093579709369085525651528959
33782159340399119075502495847161401527101834823731504521848289
07097066749035812105735673062224184578113153987480874569311840
34611043915547598874334739513173936291615348136113929611666395
3155785517017739076839134463214021324783262900267823081443889
<a href="mailto:apache@mmmkay">apache@mmmkay</a>
<!--/etsafe-->
</pre>
</p>
<p>
On the server, create a file called <code>authorized_keys</code> in your <code>~/.ssh</code>
directory:
</p>
<p>
doc/cvshowto.html view on Meta::CPAN
this example. You should pick a name that makes sense; I typically use the
host name of the site I'm importing.
</p>
<p>
<pre>
<!--etsafe-->
webmake_cvs_import <a href="mailto:jm@localhost">jm@localhost</a>:/cvsroot jmason.org
<!--/etsafe-->
</pre>
</p>
<p>
Assuming this works, move on to <strong>CHECKING OUT THE SITE</strong>, below. (Keep a
copy of the original site tree around just in case!)
</p>
<a name="CHECKING_OUT_THE_SITE"><h1>CHECKING OUT THE SITE</h1></a><p>
On the clients, create a directory for <a href="cgistart.html">webmake.cgi</a> to work in, in the web
server's HTML tree, then check out the CVS tree:
</p>
<p>
<pre>
<!--etsafe-->
mkdir /var/www/html/jmason.org
cd /var/www/html/jmason.org
cvs -d :ext:<a href="mailto:jm@localhost">jm@localhost</a>:/cvsroot checkout jmason.org
<!--/etsafe-->
</pre>
</p>
<p>
<em>Note:</em> cvs checkout has a few idiosyncrasies; notably, the directory you're
checking out must not exist in your filesystem, otherwise it will not populate
it with the CVS data files it requires to do check-ins and updates later.
</p>
<p>
Also, this directory must have the same name it has in the CVS repository
(<strong>jmason.org</strong> in the example above). We don't want that, so move them
nearer:
</p>
<p>
<pre>
<!--etsafe-->
mv jmason.org/* . ; rmdir jmason.org
<!--/etsafe-->
</pre>
</p>
<p>
then, as root,
</p>
<p>
<pre>
<!--etsafe-->
chown -R apache /var/www/html/jmason.org
<!--/etsafe-->
</pre>
</p>
<p>
so that <a href="cgistart.html">webmake.cgi</a> can read and write the files. (You could also chgrp them
to <strong>www</strong> or whatever the web server user uses as its gid, and <strong>chmod -R
g+w</strong> them.)
</p>
<p>
Next, copy the "<a href="cgistart.html">webmake.cgi</a>" script to your web server's cgi-bin directory:
</p>
<p>
<pre>
<!--etsafe-->
cp webmake.cgi /cgi-bin/editsite.cgi
<!--/etsafe-->
</pre>
</p>
<p>
and edit the top of the script. You need to set these variables:
</p>
<p>
<pre>
<!--etsafe-->
$FILE_BASE = '/var/www/html/jmason.org';
<!--/etsafe-->
</pre>
</p>
<p>
Note that if you've adopted the same convention as I use for the module name,
you can use <strong>_<!-- -->
_HOST_<!-- -->
_</strong> as a shortcut in this line to mean the
hostname of the site being edited. This is handy, as it allows you to use the
same CGI script to edit multiple sites, in different virtual servers.
</p>
<p>
Load up <strong><a href="http://localhost/cgi-bin/editsite.cgi">http://localhost/cgi-bin/editsite.cgi</a></strong> in a web browser, and it
should have worked; you should see a list of "sites" (ie. .wmk files) to
choose from.
</p>
<p>
Try clicking on a site, scroll down to the bottom of the page, and click on
the "[Update From CVS]" link. You should see a page of cvs
messages, indicating that the site has been updated from the latest CVS
checked-in version.
</p>
<p>
If this works without errors, you're now set up. Set up as many more clients
as you like!
</p>
( run in 0.488 second using v1.01-cache-2.11-cpan-71847e10f99 )