<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Joe Maller &#187; wget</title>
	<atom:link href="http://joemaller.com/tag/wget/feed/" rel="self" type="application/rss+xml" />
	<link>http://joemaller.com</link>
	<description>.com</description>
	<lastBuildDate>Tue, 15 May 2012 03:40:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to install Subversion on a shared host</title>
		<link>http://joemaller.com/881/how-to-install-subversion-on-a-shared-host/</link>
		<comments>http://joemaller.com/881/how-to-install-subversion-on-a-shared-host/#comments</comments>
		<pubDate>Wed, 30 Jan 2008 04:04:43 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[64 bit]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[liquidweb]]></category>
		<category><![CDATA[shared hosting]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://joemaller.com/2008/01/29/how-to-install-subversion-on-a-shared-host/</guid>
		<description><![CDATA[I&#8217;ve hosted this site and several others LiquidWeb&#8217;s shared servers for probably eight years. They are without question, the most dependable host I&#8217;ve ever used. [see update] But LiquidWeb doesn&#8217;t offer Subversion. And I will no longer do web work without it. For some time I&#8217;d been considering leaving LiquidWeb because the lack of svn [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve hosted this site and several others <a href="http://www.liquidweb.com/">LiquidWeb&#8217;s shared servers</a> for probably eight years. They are without question, the most dependable host I&#8217;ve ever used. <em>[<a href="http://joemaller.com/881/how-to-install-subversion-on-a-shared-host/#lwupdate">see update</a>]</em></p>
<p>But LiquidWeb doesn&#8217;t offer <a href="http://subversion.tigris.org/">Subversion</a>. And I will no longer do web work without it.</p>
<p>For some time I&#8217;d been considering leaving LiquidWeb because the lack of svn was now hindering work on my own sites. For the same reason, I&#8217;ve had to pass them over several times when clients asked for hosting recommendations. Then the other night, I stumbled across a discussion about installing Subversion on a shared host. Why didn&#8217;t I  try that years ago? </p>
<p><span id="more-881"></span></p>
<h3>Installation Instructions</h3>
<p>These instructions assume basic proficiency with the Unix command line. Note that the goal is to install the SVN client, plan on hosting your repositories somewhere else.</p>
<p>Connect to  your account with ssh and create a working directory, mine&#8217;s called _src:</p>
<pre><code>cd
mkdir _src
cd _src</code></pre>
<p>Next, use <a href="http://linux.die.net/man/1/wget">wget</a> to pull down the subversion sources. You could also use curl, but wget does the same with less typing. Choose a version from this <a href="http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=260&#038;expandFolder=74">list of Subversion sources</a>. The parallel &#8220;subversion-deps&#8221; download includes all dependent sources required to build Subversion.</p>
<pre><code>wget http://subversion.tigris.org/downloads/subversion-1.4.6.tar.gz
wget http://subversion.tigris.org/downloads/subversion-deps-1.4.6.tar.gz</code></pre>
<p>Next, untar the sources and dive into the directory:</p>
<pre><code>tar -xzvf subversion-1.4.6.tar.gz
tar -xzvf subversion-deps-1.4.6.tar.gz
cd subversion-1.4.6</code></pre>
<h3>One step, maybe (32-bit?)</h3>
<p>At this point, depending on your server configuration, you might be able to install with the following two commands:</p>
<pre><code>./configure --prefix=$HOME --without-berkeley-db \
     --with-ssl --with-editor=/usr/bin/vim \
     --without-apxs --without-apache
make &amp;&amp; make install</code></pre>
<p>That worked on some servers but not others, I spent many hours clumsily trying to figure out why. I found that the build process was linking to external libraries instead of the ones in subversion-deps, despite the configure directives.</p>
<p>On the 64-bit server (x86_64) this was a big problem, even though everything worked normally on two 32-bit (i686/i386) servers.  Check server architecture with either <code>arch</code>, <code>uname -a</code> or <code>cat /proc/cpuinfo</code>. The solution for 64-bit machines is to build the three main components beforehand and then tell Subversion where to find them.</p>
<h3>Build them, use them  (64-bit?)</h3>
<p>The following commands systematically build each of the three shared libraries from the Subversion-deps sources. This should guarantee that the files Subversion links to will be compatible. In each step, we explicitly enable compilation of shared libraries and prefix the files into our home directory. This looks worse than it is.</p>
<p>Build <a href="http://apr.apache.org/">apr</a>, apr-util and <a href="http://www.webdav.org/neon/">neon</a>, in that order:</p>
<pre><code>cd apr
./configure --enable-shared --prefix=$HOME
make &amp;&amp; make install

cd ../apr-util
./configure --enable-shared --prefix=$HOME \
     --with-expat=builtin --with-apr=$HOME \
     --without-berkeley-db
make &amp;&amp; make install

cd ../neon
./configure --enable-shared --prefix=$HOME \
     --with-libs=$HOME --with-ssl
make &amp;&amp; make install</code></pre>
<p>With those out of the way, we can now configure and build Subversion. According to the notes in Subversion&#8217;s configure file, the <code>--with-ssl</code> flag is not necessary since it&#8217;s just passed to neon and we already built neon.  <code>--without-apxs</code> and <code>--without-apache</code> prevent Subversion from trying to install its Apache modules. Remember to point to the libraries we just built (in $HOME): (note: you may need to add the <code>--without-serf</code> flag as well, <a href="#comment-50835">see this comment</a>)</p>
<pre><code>cd ../
./configure --prefix=$HOME --without-berkeley-db \
     --with-editor=/usr/bin/vim --with-apr=$HOME \
     --with-apr-util=$HOME --with-neon=$HOME \
     --without-apxs --without-apache
make &amp;&amp; make install</code></pre>
<p>Subversion should now be installed! It&#8217;s likely you already have <code>:~/bin</code> in your user $PATH, if so, you can try it out right away:</p>
<pre><code>svn --version

   svn, version 1.4.6 (r28521)
      compiled Jan 29 2008, 11:05:47</code></pre>
<p>So far, I&#8217;ve run this against two LiquidWeb shared accounts, one LiquidWeb CPanel container on a VPS and a <a href="http://www.hostmatters.com/">HostingMatters</a> shared account running JailShell. After some limited testing accessing different repositories with https and svn+ssh, everything seems to be working.</p>
<p>Now I just need to figure out where to put my repositories, here are some free Subversion hosts I&#8217;ve used or are considering:</p>
<ul>
<li><a href="http://www.beanstalkapp.com/pricing.html">Beanstalk</a> 20 MB free</li>
<li><a href="http://www.assembla.com">Assembla</a> 500 MB free?! really?</li>
<li><a href='http://unfuddle.com/home'>Unfuddle</a> 15 MB free</li>
<li><a href="http://code.google.com/hosting/">Google Code</a> 100 MB free, must be open source</li>
</ul>
<p>Two other sites which aren&#8217;t free, but I&#8217;m keeping in mind for the future: <a href="http://wush.net/">Wush</a> and  <a href="http://www.projectlocker.com/scenario/startup">Project Locker</a>.</p>
<h3>The getting there was the hardest part</h3>
<p>While I was finally able to streamline this down to a fairly simple process, it was not easy to get there.  I don&#8217;t do much compiling from source, so I&#8217;m very clumsy about troubleshooting. If any of these steps can be simplified, please leave a note.</p>
<pre><code>Here are some of the errors I saw along the way:
/usr/lib/libexpat.so: could not read symbols: File in wrong format
/usr/lib/libexpat.so: could not read symbols: Invalid operation
/home/joe/_src/subversion-1.4.6/neon/src/.libs/libneon.a: could not read symbols: Bad value </code></pre>
<p>The first two errors indicate that the build had grabbed the 32-bit libexpat from /usr/lib instead of the 64-bit version from /usr/lib64. However, redirecting to the 64-bit libraries introduced other problems such as the libneon.a bad value error. As mentioned above, what I needed to do was pull libraries from the subverson-deps code. To use those, I needed to compile each one first. </p>
<h3>Resources:</h3>
<ul>
<li><a href="http://svn.collab.net/repos/svn/trunk/INSTALL">Subversion&#8217;s INSTALL file</a></li>
<li>./configure -help</li>
<li><a href="http://pastie.caboo.se/99618">These commands</a>, from <a href="http://forum.activereload.net/forums/8/topics/241#post_934">this original post</a> almost worked.</li>
<li><a href='http://www.apdz.com/phpbb/viewtopic.php?t=369&#038;;sid=cbd15a9447f96cf9eb5000c4efb1b167'>Installing Mephisto and Subversion on a Shared Host</a>, first inkling this was possible</li>
<li>similar problem with with <a href="http://svn.haxx.se/users/archive-2005-05/0284.shtml">/usr/lib instead of /usr/lib64.</a></li>
<li><a href="http://www.linuxquestions.org/questions/showthread.php?t=563541">GATTAGA&#8217;s post</a> was the first clue about working around the libexpat problem.</li>
<li><a href="http://www.svnforum.org/2017/viewtopic.php?t=1940&#038;;sid=1d48a79776ec72bfbb719b91beb274ba">SVNforum: libneon.a: could not read symbols: Bad value</a> This was the post that gave me the final bit of information I needed</li>
</ul>
<p><strong>Related:</strong> <a href="http://joemaller.com/2008/08/13/how-to-install-git-on-a-shared-host/">How to install Git on a shared host</a></p>
<p><strong id="lwupdate">Update, November 2010:</strong> Sometime this year Liquid Web disallowed compiler access.  I now host my sites at <a href="http://www.webfaction.com/signup?affiliate=joemaller">WebFaction</a> and <a href="http://www.a2hosting.com/1482.html">A2 Hosting</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://joemaller.com/881/how-to-install-subversion-on-a-shared-host/feed/</wfw:commentRss>
		<slash:comments>58</slash:comments>
		</item>
		<item>
		<title></title>
		<link>http://joemaller.com/146/146/</link>
		<comments>http://joemaller.com/146/146/#comments</comments>
		<pubDate>Mon, 29 Apr 2002 08:04:28 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[misc.]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://joemaller.com/wp.php/?p=146</guid>
		<description><![CDATA[Sunday was a Unix day, which might seem impressive except that I really don&#8217;t know what I&#8217;m doing. Had I known what I&#8217;m doing, duplicating one remote directory (this web site, all several hundred megs of it) into another remote directory (a new server) would take about five minutes. Instead it took me about 20 [...]]]></description>
			<content:encoded><![CDATA[<p>
Sunday was a Unix day, which might seem impressive except that I really don&#8217;t know what I&#8217;m doing. Had I known what I&#8217;m doing, duplicating one remote directory (this web site, all several hundred megs of it) into another remote directory (a new server) would take about five minutes. Instead it took me about 20 hours. But I learned a lot.
</p>
<p><P><strong>wget</strong><br />
The server I was pulling from did not have rsync installed and would not let me connect via SSH (secure shell). I could telnet, but that didn&#8217;t help me. Since rsync was out of the question, I found <a href='http://www.wget.org/'>wget</a>, which is often used to mirror sites via ftp. One thing I couldn&#8217;t get to work was to copy directly from the old server to the new one, so I decided to download the whole site to my hard drive and then sync it up to the new server.</P></p>
<p><P>I don&#8217;t have the developer tools installed yet, but thankfully Apple has a pre-compiled package available from the OS X web site: <a href='http://www.apple.com/downloads/macosx/unix_apps_utilities/wget.html'>Wget 1.8.1</a></P></p>
<p>
Wget is very easy to use. The only stumbling block I had was the need to point to my www directory explicitly, wget wouldn&#8217;t follow the symlink (before last night, I didn&#8217;t know what a symlink was. They&#8217;re basically aliases). I found the explicit path by getting info on a file from the server using <a href='http://www.fetchsoftworks.com/'>Fetch</a>. Once I had the path correct, wget worked perfectly with the following command:
</p>
<p>
<code>wget -m --passive-ftp ftp://[user]:[password]@[host][explicit path to root directory]/</code>
</p>
<p>
The commands at the beginning tell wget to mirror (m) and to use passive FTP (&#8211;passive-ftp).
</p>
<p><P><strong>rsync</strong><BR><br />
I first learned about rsync while looking for an open source (free) disk mirroring solution for a file server. At the time, rsync didn&#8217;t support OS X&#8217;s HFS+ filesystem so icons and creator codes weren&#8217;t duplicated. Since then <a href='http://www.macosxlabs.org/'>macosxlabs.org</a> has developed <a href='http://www.macosxlabs.org/rsyncx/rsyncx.html'>RsyncX</a> which I hope to try out soon.</P></p>
<p>
I used rsync for two different things. First, I wanted to back up the site I just downloaded by burning it to a CD. OS X doesn&#8217;t seem to be able to create a disk image from a folder lke OS 9 could do, and the one shareware application which claimed that ability kept returning errors.  I ended up creating a blank CD-master disk image with Disk Copy, then using rsync to duplicate the downloaded folder to the disk image. This is the command I used:
</p>
<p>
<code>rsync -vr [source path, w/o trailing slash] [disk image path]</code>
</p>
<p>
The -vr command tells rsync to be &#8220;verbose&#8221; (v) while duplicating and to recursively copy all directories (r).
</p>
<p>
The other use for rsync was to mirror my local site onto the new remote server.
</p>
<p>
<code>rsync -vtrp -e ssh [local path]/ [user]@host:[remote directory]/</code>
</p>
<p>The additional commands tell rsync to preserve the original file times (t) and permissions (p).
</p>
<p>
A trailing slash on the source path tells rsync copy the files from that directory into the target directory. If there is no trailing slash, the directory itself will be copied and created if necessary.
</p>
<p>
The following examples use a fictional file system which contains:<br />
<BR><BR></p>
<p><strong>sourceDir/</strong><BR></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a.file<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b.file</p>
<p><BR></p>
<p><strong>destinationDir/</strong><BR><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.file<BR><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.file<BR><br />
</P></p>
<p>
These two simplified examples demostrate the effect of the trailing slash:</P></p>
<p><code>rsync /sourceDir /destinationDir/</code><BR><br />
would copy the directory sourceDir into destinationDir resulting in:<br />
<BR><BR><br />
<strong>destinationDir/</strong><BR><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.file<BR><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.file<BR></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>sourceDir/</strong><BR><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a.file<BR><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b.file<BR></p>
<p><code>rsync /sourceDir/ /destinationDir/</code><BR><br />
would sync the contents of sourceDir into destinationDir resulting in:<br />
<BR><BR><br />
<strong>destinationDir/</strong><BR><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.file<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.file<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a.file<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b.file<br />
</P></p>
<p>
My last stumbling block was specifying the target directory correctly. All the examples I could find had the target starting with a slash, but when I tried that, it bounced up to the root of the server (not my local root folder) because I&#8217;m uploading to a directory before switching my domain over. Once I realized that the &#8220;mkdir&#8230;permission denied (1)&#8221; error was a result of trying to create a directory outside of my personal space rsync worked perfectly. After several hours of searching for answers of course.
</p>
<p>
I didn&#8217;t find any one resource which answered all my questions, but the following sites are good places to start. Otherwise, Google is your friend.
</p>
<ul>
<li>The <a href='http://rsync.samba.org/ftp/rsync/rsync.html'>man pages</a> at <a href='http://rsync.samba.org/'>rsync. samba.org</a> are a lot easier to read than the ones in the terminal.</li>
<li><a href='http://perso.club-internet.fr/ffaure/rsync.html'>Rsync tutorial</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://joemaller.com/146/146/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Database Caching 3/10 queries in 0.003 seconds using disk: basic
Object Caching 269/283 objects using disk: basic

Served from: joemaller.com @ 2012-05-24 03:29:44 -->
