Firefox Install Amazon EC2 Instance [64-bit]
cd /usr/src/
mkdir downloads && cd downloads
wget ftp://ftp.muug.mb.ca/mirror/centos/5/os/x86_64/CentOS/atk-1.12.2-1.fc6.x86_64.rpm
wget ftp://ftp.muug.mb.ca/mirror/centos/5/os/x86_64/CentOS/atk-devel-1.12.2-1.fc6.x86_64.rpm
wget ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/5.0/linux-x86_64/en-US/firefox-5.0.tar.bz2
wget http://ftp.gnome.org/pub/gnome/sources/gtk+/2.10/gtk+-2.10.14.tar.gz
yum install xorg-x11-server-Xvfb
tar xvf gtk+-2.10.14.tar.gz
tar xvf firefox-5.0.tar.bz2
mv firefox/ /opt/
rpm -Uvh *.rpm
rm -f *.rpm
rm -f firefox-5.0.tar.bz2
rm -f gtk+-2.10.14.tar.gz
cd gtk+-2.10.14/
./configure
make
make install
Before doing the steps below make sure, the library files specified are present int he given location:
[root@production-web downloads]# ll /usr/local/lib/libgdk-x11-2.0.so.0
lrwxrwxrwx 1 root root 27 Feb 9 08:24 /usr/local/lib/libgdk-x11-2.0.so.0 -> libgdk-x11-2.0.so.0.1000.14
If the files are not presentinthe above location, then find them:
[root@production-web gtk+-2.10.14]# find / -iname libgdk-x11-2.0.so.0
/usr/src/downloads/gtk+-2.10.14/gdk/.libs/libgdk-x11-2.0.so.0
ln -s /usr/local/lib/libgdk-x11-2.0.so.0 /opt/firefox/libgdk-x11-2.0.so.0
ln -s /usr/local/lib/libgdk_pixbuf-2.0.so.0 /opt/firefox/libgdk_pixbuf-2.0.so.0
ln -s /usr/local/lib/libgtk-x11-2.0.so.0 /opt/firefox/libgtk-x11-2.0.so.0
echo $DISPLAY
If it returns no display number, thendo the below steps, else specify the number from the output in the executing command:
vi /etc/environment
Enter the below text:
export DISPLAY=:0.0
Check the same by running command:
echo $DISPLAY
Output should look like:
[root@production-web downloads]# echo $DISPLAY
:0.0
Make sure Xvfb is installed properly by running:
Xvfb :1 -screen 0 1024x768x24 &
[root@production-web ec2-user]# Xvfb :1 -screen 0 1024x768x24 &
[1] 4249
[root@production-web ec2-user]# SELinux: Disabled on system, not enabling in X server
[root@production-web ec2-user]# ps aux|grep -i xvf
root 4249 0.6 0.0 56168 7424 pts/3 S 08:40 0:00 Xvfb :1 -screen 0 1024x768x24
root 4252 0.0 0.0 103268 856 pts/3 S+ 08:40 0:00 grep -i xvf
Make sure firefox is installed properly by running:
[root@production-web ec2-user]# /opt/firefox/firefox
Error: cannot open display: :0.0
If it returns any other error apart from the above, then you have to troubleshoot it & then try to get firefox up & running again.
Primary credit: http://osipov.posterous.com/install-mozilla-firefox-on-amazon-ec2-instanc