I kept getting disconnected from my server while I was working and it was really frustrating me when I’d have to reconnect with ssh, “cd” back into the directory I was working in, and then open all of my VIM buffers after cleaning up all of their confused “.swp” files. Yea, a huge pain in the ass.
Anyway, what I ended up doing is deciding that I really need to get used to using GNU Screen. I’ve used it a couple times before at work, but never got used to it. That’s when I remember that a coworker of mine told me that if I haven’t gotten used to using Screen, that I should try out “tmux” instead. I got excited that I’d be on the cutting edge…
Well, I have a shared hosting setup through site5 (I don’t have the money for a VPS), so naturally when I typed in “tmux” into my ssh terminal session, nothing happened. Wonderful, I was going to have to manually install it without root access.
After numerous pains of running into dependency problems, libraries not being found, and crazy amounts of Google searches later…. I have “tmux” running.
Here’s what I did to make it all happen:
cd ~
mkdir local
mkdir temp
mv tmux-1.5.tar.gz temp
mv libevent-2.0.12-stable.tar.gz temp
cd temp
tar xvfz tmux-1.5.tar.gz
tar xvfz libevent-2.0.12-stable.tar.gz
cd libevent-2.0.12-stable
./configure --prefix=$HOME/local
make
make install
cd ../tmux-1.5
DIR="$HOME/local"
./configure CFLAGS="-I$DIR/include" LDFLAGS="-L$DIR/lib"
make
cp tmux ~/local/bin
export PATH=$HOME/local/bin:$PATH
export LD_LIBRARY_PATH="$HOME/local/lib"
tmux
Woot! It works! Of course, though, you’ll want to add the “export” commands to your “~/.bashrc” file so that you they’re done on login.
Ok, so my terminal might be 10,000 lines more full… but I’ve cleaned up the crap and given you the working results.
I doubt anyone will run into the exact same problems as I did, as it all depends on the setup of your server and what dependencies you already have. Also, this isn’t the best way of going about installing unix tools normally, but I didn’t have root or su capabilities. Anyway, I’m leaving this here in case anyone does run into a similar problem… or at least for archival purposes (I’m not going to remember how to do this, haha).
Hope this helps!