Introduction
Here is an installation guide for mosh 1.2.
You can run these commands individually, or you can paste them into a shell script and run it as
| bash -e build_mosh-1.2.sh | tee build_mosh-1.2.log
|
Either way, you will want to run it in a screen session.
In order to use mosh, you will need to get an open-ports IP address and have a port opened. The following instructions refer to this IP address as EXTERNAL_IP and the port as EXTERNAL_PORT.
After installation on WebFaction, you must also install mosh locally (on Ubuntu, apt-get install mosh).
Once mosh is available on both your local machine and on WebFaction, you can connect from your local machine using something like this:
| WF_USERNAME=my_user
EXTERNAL_IP=123.123.123.123
EXTERNAL_PORT=5555
mosh -p ${EXTERNAL_PORT} --server=/home/${WF_USERNAME}/bin/mosh-server "${WF_USERNAME}@${EXTERNAL_IP}"
|
It may be convenient to place this into a script on your local machine to connect with significantly less typing.
Installation Procedure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67 | # set up standard build environment
mkdir -p $HOME/src $HOME/tmp
export TMPDIR="$HOME/tmp"
export PATH="$HOME/bin:$PATH"
export C_INCLUDE_PATH="$HOME/include:$C_INCLUDE_PATH"
export LIBRARY_PATH="$HOME/lib:$LIBRARY_PATH"
export LD_LIBRARY_PATH="$HOME/lib:$LD_LIBRARY_PATH"
export CPPFLAGS="-I$HOME/include $CPPFLAGS"
export LDFLAGS="-L$HOME/lib $LDFLAGS"
export PKG_CONFIG_PATH="$HOME/lib/pkgconfig"
mkdir -p $HOME/lib/${PYTHON}
export PYTHON=python2.7
mkdir -p $HOME/lib/perl5
export PERL5LIB="$HOME/lib/perl5"
export CFLAGS="-O2 -pipe"
# fix lib64
if [ ! -L "$HOME/lib64" ]; then ln -s $HOME/lib $HOME/lib64; fi
###########################################################
# protobuf 2.4.1
# original: http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.bz2
###########################################################
cd $HOME/src
wget 'http://mirror.ryansanden.com/mosh-1.2/protobuf-2.4.1.tar.bz2'
tar -xjf protobuf-2.4.1.tar.bz2
cd protobuf-2.4.1
./configure --prefix=$HOME
make
make install
###########################################################
# IO-Tty Perl module
# original: http://search.cpan.org/CPAN/authors/id/R/RG/RGIERSIG/IO-Tty-1.02.tar.gz
###########################################################
cd $HOME/src
wget 'http://mirror.ryansanden.com/mosh-1.2/IO-Tty-1.02.tar.gz'
tar -xzf IO-Tty-1.02.tar.gz
cd IO-Tty-1.02
perl Makefile.PL INSTALL_BASE=$HOME
make
make install
###########################################################
# mosh 1.2
# original: https://github.com/downloads/keithw/mosh/mosh-1.2.tar.gz
###########################################################
cd $HOME/src
wget 'http://mirror.ryansanden.com/mosh-1.2/mosh-1.2.tar.gz'
tar -xzf mosh-1.2.tar.gz
cd mosh-1.2
./configure --prefix=$HOME
make
make install
# make wrapper
cd $HOME/bin
mv mosh-server mosh-server.bin
cat << "EOF" > mosh-server
#!/bin/bash
export PATH="$HOME/bin:$PATH"
export LD_LIBRARY_PATH="$HOME/lib:$LD_LIBRARY_PATH"
exec $HOME/bin/mosh-server.bin $@
EOF
chmod 755 mosh-server
|
answered
May 03 '12 at 04:28
ryans ♦♦
2841●1●4●20
Any plans to install mosh on all servers by default? That would help a lot!
Not likely in the foreseeable future. Mosh is useful but not yet often requested, and even if available system-wide, a support ticket is still necessary to have the associated port opened in the firewall.