Minimal install of XBMC on Ubuntu Karmic Koala (9.10)

February 9, 2010 · 2 Comments
Filed under: Featured, Karmic Koala, Ubuntu 

Ok, so I have been building a media centre for about a week now, and I have had a lot of trouble getting it setup and working right, but now XBMC has released version 9.11 alpha 1 version of its popular media centre software which is now compatible with Ubuntu 9.10.

After all the trouble I had, I thought I would share with you how I installed it, and got XBMC to boot on load. I am using an ASUS AT3N7A-I with a 1.6 dual core atom processor and NVidia ION chipset, 2GB of ram and a 1TB hard drive. So I will only be showing you how to use the NVidia drivers for linux, but to be honest NVidia driver support for linux is better than ATI support.

First, download the minimal install of Ubuntu Karmic Koala (12.1mb x86 12.2mb x64)

Download either the x86 or x64 version dependent on your hardware.

Once the disk image has downloaded either burn it to CD or use UNetbootin to boot from a USB pen drive.

Reboot the computer you wish to install xbmc on, and boot from the CD or USB pen drive, you may need to change some settings in your bios to boot from CD or USB.

Start the installation, and follow the onscreen instructions to set your language and keyboard layout. Enter a username and password for your main account, for this I entered xbmc.

The installer will ask you what packages to install, scroll down to OpenSSH Server and press SPACE, then press ENTER to continue.

After the installation has completed, your computer will reboot.

When you get to the login screen, login with the username and password you entered.

Once you have logged in we need to add the PPA for XBMC.

sudo nano /etc/apt/sources.list

And these lines to the end.


deb http://ppa.launchpad.net/nvidia-vdpau/ppa/ubuntu karmic main
deb-src http://ppa.launchpad.net/nvidia-vdpau/ppa/ubuntu karmic main
deb http://ppa.launchpad.net/team-xbmc/karmic-ppa/ubuntu karmic main
deb-src http://ppa.launchpad.net/team-xbmc/karmic-ppa/ubuntu karmic main

We will need to add the a key to aptitude to stop it complaining.

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 64234534 40618B66 CEC06767 318C7509 91E7EE5E

Sometimes the key server will return this error:
gpg: keyserver timed out
gpg: keyserver receive failed: keyserver error

A trick I found was to ping the key server address, after it responded try and run the previous command again:

ping keyserver.ubuntu.com

Now we need to update aptitude.

sudo apt-get update

Now we will install the NVidia drivers:

sudo apt-get install nvidia-glx-190

You will need to enter your password again.

Next, we want sound for our media, so we will install some sound drivers.

sudo apt-get install linux-sound-base alsa-base alsa-utils

Your user needs to be added to the sound group.

sudo usermod -a -G audio xbmc

Change xbmc to the username that you entered.

The sound level will be set to zero, to change the volumes we need to enter the sound mixer.

sudo alsamixer

Use you up and down keys and set the volumes to the maximum they will go. Press the right key until you get to IEC958, EC958 D, EC958 1 and press M on each of them to un-mute them.

Press ESC to quit out of the mixer.

To make alsa save the volumes run.

sudo alsactl store 0

Now we can install XBMC.

sudo apt-get install xbmc xbmc-skin-* xbmc-eventclients-* xbmc-scripts-*

This will install xbmc, all the skins and eventclients.

Now X will need to know about your monitor, so run:

sudo nvidia-xconfig

XBMC will need to control power settings of the computer:

sudo apt-get install pm-utils policykit

And give your user access to these power features:

sudo polkit-auth --user xbmc --grant org.freedesktop.hal.power-management.suspend
sudo polkit-auth --user xbmc --grant org.freedesktop.hal.power-management.hibernate
sudo polkit-auth --user xbmc --grant org.freedesktop.hal.power-management.reboot
sudo polkit-auth --user xbmc --grant org.freedesktop.hal.power-management.shutdown
sudo polkit-auth --user xbmc --grant org.freedesktop.hal.power-management.reboot-multiple-sessions
sudo polkit-auth --user xbmc --grant org.freedesktop.hal.power-management.shutdown-multiple-sessions




Again you will have have to change –user xbmc to the username that you entered in the installation.

Now the last thing to do is make XBMC launch at startup.

sudo nano /etc/init/tty1.conf

Change the line

exec /sbin/getty 38400 tty1

To

exec /bin/login -f xbmc < /dev/tty1 > /dev/tty1 2>&1

Next we need to get Ubuntu to clear the screen and start X:

nano ~/.bash_profile

And add these lines to the file:

case "`tty`" in
/dev/tty1) clear && startx &>/dev/null;;
esac

Now we need to tell X to start XBMC:

nano ~/.xsessionrc

Add the lines:

exec xbmc --standalone

This next step is OPTIONAL, to hide all the information about what is being loaded, we shall install a usplash boot screen.

sudo apt-get install usplash libusplash-dev usplash-theme-xbmc-*

Once the splash screen installation has completed we need to select a splash screen:

sudo update-alternatives --config usplash-artwork.so

Enter the number of the splash screen you wish to use, find examples below:

Pulsating Logo
Spinner Black
Spinner Blue
XBMC Logo

All the previews where created by DU-Duke

Next set the screen resolution of your tv in the usplash settings:

sudo nano /etc/usplash.conf

And add these lines:

resx=1920
resy=1080

My TV is 1080p, so the settings above will suite yours if it is full HD, for 720p enter:

resx=1280
resy=720

To make the new splash screen active run:

sudo update-initramfs -u

Now reboot your computer:

sudo reboot

When the computer restarts, you should see the splash screen you selected, and XBMC should boot up.

Now, go into XBMC’s Videos settings and select VDPAU for the render mode (if your graphics card supports it) and edit the Sound settings:

Audio Output: Digital
AC3: Off
DTS: Off
Audio Capable Device: plughw:hdmi
Passthrough Output Device: hdmi
Downmix: On

And that’s it, you should have a fully functional media centre running the latest version of Ubuntu and XBMC.

As this is an alpha version, you will need to perform some updates now and again until the final release is out.

To so this, ssh into your computer and update it:

ssh xbmc@your media centre IP
sudo apt-get upgrade

Now I can’t take all the credit for this, I have collected some information from other sources and put them together from here:

http://xbmc.org/forum/showthread.php?t=53812
http://xbmc.org/forum/showthread.php?t=38804

Thanks to jonassw from XBMC forums, who suggested using the latest version of the NVidia drivers.

Things to do after installing Ubuntu9.10 Karmic Koala

December 30, 2009 · Leave a Comment
Filed under: Featured, Karmic Koala, Ubuntu 
Ubuntu 9.10 Karmic koala will be released in few hours,  after you install karmic or upgrading, you will need to add some softwares, repositories,  you can also make the look of karmic better by adding cairo dock menu for example. You can always add more themes , see this article : Great themes for Ubuntu9.10 Karmic koala Here are things i see are important to do after installing Ubuntu karmic Koala :

1- Add Medibuntu repositories :

Medibuntu is a packaging project dedicated to distributing software that cannot be included in Ubuntu for various reasons, related to geographical variations in legislation regarding intellectual property, security and other issues. by adding Medibuntu repostories you will be able to install many softwares like Google-Earth , opera ,Win32codecs , Msfonts  and more by the normal command :

sudo-apt-get install <software-name>

Click here and Follow the steps to add medibuntu repostories to ubuntu 9.10 karmic Koala in my previous post.

2- Install PlayOnLinux :

PlayOnLinux is a piece of sofware which allows you to easily install and use numerous games and softwares designed to run with Microsoft®’s Windows®.
You can install many windows games like callofduty, doom ,…. Msfonts ,Itune ,Microsoft office 2007 (see our howto install MS office 2007 using playonlinux)

You can install playonlinux from Ubuntu software center

Or by using the command :

sudo apt-get install playonlinux





3- Enchance launch-bar menu in karmic with cairo-dock :

Cairo-Dock is an animated application launch bar for the desktop, comparable to the dock in Mac OS X or Rocket Dock (for Windows).  It is compatible with Compiz, but it can also run without a composite manager . Cairo-Dock can run under GNOME, KDE and XFCE.


Open the terminal and copy and past the command bellow :

sudo -v
echo "deb http://repository.cairo-dock.org/ubuntu $(lsb_release -sc) cairo-dock ## Cairo-Dock-Stable" | sudo tee -a /etc/apt/sources.list 
wget -q http://repository.cairo-dock.org/cairo-dock.gpg -O- | sudo apt-key add -  

Update the installation :

sudo apt-get update  

Now install cairo-dock :

sudo apt-get install cairo-dock cairo-dock-plug-ins

4- Add screenlets to your Desktop :

Screenlets are small owner-drawn applications that can be described as “the virtual representation of things lying/standing around on your desk”. Sticknotes, clocks, rulers, … the possibilities are endless. The goal of the Screenlets base-classes is to simplify the creation of fully themeable mini-apps that each solve basic desktop-work-related needs and generally improve the usability and eye-candy of the modern composited Linux-desktop.

sudo apt-get install screenlets

Read more in our previous article

5- Ubuntu Gaming made easy with PlayDeb

If you are a fun of gaming so is important to add Playdeb repositories to your Karmic koala. Playdeb is a gaming repository for Ubuntu – aimed to provide titles already available on getdeb.net in an easier to install and update format. You can install many games by a simple click

Please see how to add playdeb.net repository in this link : Ubuntu Gaming made easy with PlayDeb

6- Important softwares you must have :

These softwares you can install from Ubuntu software center :

– Vlc : The best media player for Linux it play almast everything , he has many features that you can not find in any other media player , see this article to know more about vlc : Things you didn’t know VLC media player can do


-Vuze : the most popular Bitorrent client :

– Moovida Media center : Moovida is much more than a simple media player… it is a cutting edge media center bringing the best of the internet to your TV screen. Automatically creating your own digital library you can browse from your sofa with a remote control. The elegant and easy to use interface automatically displays artwork and fan art throughtout and gives you access to movie synopsis and artist info.

Install Thunderbird:  the best mail / News client from Mozilla :

– Filezilla the best ftp client for linux :

Pidgin the best messenger client and 30 plugins, you can enjoy chat with freinds using voice and cam :


Openshot video editor : Openshot is a video editor for linux, is one of the best ones existing actually for linux. The news is that now has a PPA this mean easy install for Ubuntu users, but the big news is that the new version come with 30 new effects. See the video demonstration what you can do with Openshot : Install openshot on karmic koala

[How To] Ubuntu 9.10 'Karmic Koala' Libgtk1.2 – Aimbots.net

December 1, 2009 · Leave a Comment
Filed under: Featured, Karmic Koala, Ubuntu 

Originally posted here! ___ Hai, Ever since Ubuntu’s (+all of it’s variants) latest version, 9.10 ‘Karmic Koala‘, was released people seem to be.


Aimbots.net – http://aimbots.net/

Let the ride begin…: Eclipse button problem with Kubuntu 9.10

November 28, 2009 · Leave a Comment
Filed under: Eclipse, Featured, IDE Tools, Ubuntu 
I ran into this issue while installing the Google App Engine… a quick description of the problem is that some buttons in Eclipse were not responding (doing nothing) after I upgraded to Karmic Koala, after checking the log file, network connection settings and some other things that didn’t work I decided to ask the oracle (Google) about it and after a while I found a simple and quick solution here.
Just create an executable file with the following content:
 #!/bin/sh  
 export GDK_NATIVE_WINDOWS=1  
 /opt/eclipse-3.5/eclipse  

Now back to coding 😉

Dual Panel Nautilus For Ubuntu Karmic Koala

November 21, 2009 · Leave a Comment
Filed under: Featured, Karmic Koala, Ubuntu 
The dual panel Nautilus which previously was only available for Ubuntu Jaunty is now available for Ubuntu Karmic Koala. Thanks to the author’s comment, I kept checking to see when Karmic packages were finally available and it didn’t took long until he finally build them.
dual panel nautilus ubuntu karmic
Download dual panel Nautilus for Karmic:

-i386:
libnautilus-extension1_2.28.1-0ubuntu3~hb1~karmic1_i386.deb (59.3 KiB)
nautilus-data_2.28.1-0ubuntu3~hb1~karmic1_all.deb (4.4 MiB)
nautilus_2.28.1-0ubuntu3~hb1~karmic1_i386.deb (1.1 MiB)

-amd64:
libnautilus-extension1_2.28.1-0ubuntu3~hb1~karmic1_amd64.deb (60.4 KiB)
nautilus-data_2.28.1-0ubuntu3~hb1~karmic1_all.deb (4.4 MiB)
nautilus_2.28.1-0ubuntu3~hb1~karmic1_amd64.deb (1.2 MiB)

You can add the PPA instead of just downloading the files, if you wish. You will also find Jaunty packages in the PPA.

Once you install it, restart Nautilus:

killall nautilus && nautilus &

Then press F3 to open the second panel in Nautilus or via the menu.

If you want to start Nautilus by default in dual-panel mode, press Alt + F2, type:

gconf-editor

then navigate to apps/nautilus/preferences and enable the option called start_with_extra_pane.

Why Internet connexion is very slow on Karmic Koala – Solution

November 21, 2009 · Leave a Comment
Filed under: Featured, Ubuntu 

This is One of the big bugs (https://bugs.launchpad.net/ubuntu/+bug/433972) on Ubuntu 9.10 Karmic koala is the slow internet connection, i have a connection of 25Mo/s and even that it take too long to load a page, at the begining i tought that was something wrong with my router or with my wireless card untill i discovered that is a known bug in karmic koala and there are many people fronting th same problem as me. I found a solution somewhere, and has worked for me for the moment. Please try it and report if worked for you also.

1. Right-click on ‘Network Icon’ (located at top-right panel by default) and click on ‘Edit Connections’ to open Network Connections Manager.

Network Manager :


2. Choose the type of connection you have. For this example, in my case “Wireless”, select the connexion (My case Auto unixmen) and click Edit

3- Inside editing ” auto unixmen wireless” click on ‘IPv4 Settings’ tab.


4. Under ‘IPv4 Settings’, change the ‘Method’ to Automatic (DHCP) addresses only.


6. Put these nameserver addresses as your ‘DNS Servers’: 208.67.222.222, 208.67.220.220


7. Click ‘OK’ and reboot your machine. You can then visit http://welcome.opendns.com to confirm you are using OpenDNS. (Need registration)

8. NOTE:

To avoid having your settings get revoked after reboots, or after periods of inactivity you may need to make the following changes via the command line:

$ sudo cp /etc/resolv.conf /etc/resolv.conf.auto
$ gksudo gedit /etc/dhcp3/dhclient.conf
# append the following line to the document
prepend domain-name-servers 208.67.222.222,208.67.220.220;
# save and exit
$ sudo ifdown eth0 && sudo ifup eth0

You may be required to change eth0 to your own network device’s name if it uses a non-standard name.

Links :

Ubuntu 9.10 (Karmic Koala): Popping Audio Fix

November 9, 2009 · Leave a Comment
Filed under: Featured, Karmic Koala, Ubuntu 

It is not much of a secret that the launch of Ubuntu 9.10 aka Karmic Koala has not gone quite as smoothly as Canonical Ltd would have hoped, however developments are slowly being made which are beginning to help rectify some of the most annoying issues associated with the release.

Following all of the responses regarding my previous ‘Ubuntu 9.10 (Karmic Koala): Are You Experiencing Problems?‘ article I thought I would scour the web for fixes that may help out some of our readers.

The first fix I have found relates to a popping noise which is experienced with some Intel HDA (high-definition) audio chipsets, this fix was originally posted on YouTube by a user called “shmalignant“, the fix is pretty simple, rather than explain it myself I have embedded the video below, heres the direct link to the video.

I must just add that although there are no likely problems associated with this fix, if you choose to attempt the fix it is at your own risk (editing this particular .conf file shouldn’t cause problems.

Did this fix work for you?

How to set up Xen in Karmic Koala

November 9, 2009 · Leave a Comment
Filed under: Featured, Karmic Koala, Ubuntu 

What do I have to do to set up xen in Karmic Koala? I have already installed the Ubuntu-xen-desktop package, but I do not locate a kernel suitable for.

Setting up awn in Ubuntu 9.10 Karmic Koala

November 8, 2009 · Leave a Comment
Filed under: Featured, Ubuntu 

I have a problem with Karmic Koala. I installed awn, but when I activate it, it does not work!

It was asking that a windows compositing manager be installed and suggested typing
compiz on the command line. When I typed that, compiz reported that no suitable xorg file was found, no Xgl support and that it is defaulting to the metacity window manager.

It turns out that for my ACER 4520 laptop with Nvidia 7000 card, I have to install hardware acceleration drivers for an Nvidia 7000 card, so that there will be support for Xgl. After installing it, do not fail to activate it. I also installed compiz modules via the graphical synaptic installer.

After this install, requiring a reboot, the awn dock now displays as it should.

Install Ruby on Rails on Ubuntu Karmic Koala 9.10

November 8, 2009 · Leave a Comment
Filed under: Featured, Ruby on Rails, Ubuntu 

If you’re running Ubuntu 9.10 and want to install Ruby on Rails I’ve put together a quick tutorial for you. Not tremendously much has changed since the last tutorial for Jaunty Jackalope. Unicorn is out and while I think it’s nifty, I’m going to wait a little while before playing with it. For now my money is still on Phusion Passenger as being the right tool for the job. If all that seems fine, let’s get to the details.

Step 1: As usual, the first thing we’ll want to do is make sure your version of Ubuntu is up to date.:

sudo apt-get update
sudo apt-get dist-upgrade

If you see this warning it means we have a little more work to do.

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
 LANGUAGE = (unset),
 LC_ALL = (unset),
 LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Let’s go ahead and set your locale now. (I’m using en-US in this example.. feel free to substitute for your region)

sudo locale-gen en_US.UTF-8
sudo /usr/sbin/update-locale LANG=en_US.UTF-8

Step 2: We’ll be installing some software that needs to be built so we’ll need to get packages required for compiling. With Ubuntu, you can type this single command and get everything you need:

sudo apt-get install build-essential

Step 3: Once you’ve got the tools, it’s time to install MySQL and Ruby. If you’re using SQLite you may not need all this stuff. Otherwise, just copy and paste this command into your terminal if you’re in a hurry. As of Karmic Koala, we’re using MySQL 5.1:

sudo apt-get install ruby ri rdoc mysql-server libmysql-ruby ruby1.8-dev irb1.8 libdbd-mysql-perl libdbi-perl libmysql-ruby1.8 libmysqlclient15off libnet-daemon-perl libplrpc-perl libreadline-ruby1.8 libruby1.8 mysql-client-5.1 mysql-common mysql-server-5.1 rdoc1.8 ri1.8 ruby1.8 irb libopenssl-ruby libopenssl-ruby1.8 libhtml-template-perl mysql-server-core-5.1 libmysqlclient16 libreadline5 psmisc

If you hadn’t previously installed MySQL you’ll be asked to set a root password. You don’t have to, of course (it will bug you no fewer than 3 times if you opt not to) but I strongly recommend it. You’ll need this password when you populate your rails config/database.yml file so be sure not to forget it.

Step 4: Grab the latest ruby gems and install them. As always be sure to check rubyforge.org to make sure you’re grabbing the latest one. As of this writing it’s 1.3.5 but it never hurts to confirm.

wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
tar xvzf rubygems-1.3.5.tgz
cd rubygems-1.3.5
sudo ruby setup.rb

Once it’s done you can remove the .tgz file and erase the rubygems-1.3.5 directory too.

Step 5: On the command line, type gem -v. if you get this message we need to make some symlinks:

The program 'gem' can be found in the following packages:
 * rubygems1.8
 * rubygems1.9
Try: sudo apt-get install
-bash: gem: command not found

Let’s create those symlinks now:

sudo ln -s /usr/bin/gem1.8 /usr/local/bin/gem
sudo ln -s /usr/bin/ruby1.8 /usr/local/bin/ruby
sudo ln -s /usr/bin/rdoc1.8 /usr/local/bin/rdoc
sudo ln -s /usr/bin/ri1.8 /usr/local/bin/ri
sudo ln -s /usr/bin/irb1.8 /usr/local/bin/irb

Step 6: Install Ruby on Rails! You can leave off the –no-rdoc and –no-ri switches if you’re on a machine with plenty of ram. But just in case you’ve got a more modest setup (say 256MB or less) I’d just use the following:

sudo gem install rails --no-rdoc --no-ri

If you’re just doing local development then you are basically done. You may want to install additional gems. If you want to deploy Ruby on Rails onto a server then it’s time to setup Nginx and Phusion.

Step 7: As I mentioned earlier, Unicorn may be the new hotness but I’m going to wait a while before I put my customers on that stack. The folks responsible for Phusion Passenger(Hongli Lai & Ninh Bui) are incredibly smart and I think they’ll look at Unicorn and make some improvements to Phusion to eek out even more performance. The short of it is that I’m still a big believer in Phusion so I’m going to install it for production and recommend that you do too:

sudo apt-get install libc6 libpcre3 libpcre3-dev libpcrecpp0 libssl0.9.8 libssl-dev zlib1g zlib1g-dev lsb-base

Step 8: We’re going to create a directory for your application. In anticipation of Capistrano, let’s put it in /var/www/myapp/current. Swap out the myapp with anything you like.

sudo mkdir -p /var/www/myapp/current

If you’ve got an existing Rails application, it doesn’t hurt to populate that directory now. Just make sure that the root to the public directory is /var/www/myapp/current/public. Don’t forget to chown it for www-data:

sudo chown -R www-data:www-data /var/www/myapp/current/

Step 9: Now it’s time to install Phusion Passenger and let it do it’s magic.

sudo gem install passenger
sudo passenger-install-nginx-module

At this point you’ll be greeted with two options. The first will allow Passenger to do all the work while the second, for advanced users, allows you to point Phusion to your pre-installed Nginx. We’re going to make life easy on ourselves and choose option 1. I’d also recommend keeping the default path (/opt/nginx).

The Nginx configuration file (nginx.conf) file is in /opt/nginx/conf/ They’ve done you the favor of adding the lines you need to get going. Defining the configuration file is beyond the scope of this tutorial, but I’ve included a sample file which you can download. This file assumes your application is in /var/www/myapp/current.

Sample nginx.conf file for Ruby on Rails, Nginx, Phusion Passenger.

Step 10: Time to make some Nginx tweaks for Ubuntu/Debian. If you’re used to running nginx as installed by Debian or Ubuntu then you might notice that you’ve lost the familiar way to start and stop nginx. Gone is /etc/init.d/nginx stop and /etc/init.d/nginx/start. To get it back, copy (or download) this into a file called nginx in /etc/init.d/ (as root)

#! /bin/sh

### BEGIN INIT INFO
# Provides:          nginx
# Required-Start:    $all
# Required-Stop:     $all
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts the nginx web server
# Description:       starts nginx using start-stop-daemon
### END INIT INFO

PATH=/opt/nginx/sbin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/opt/nginx/sbin/nginx
NAME=nginx
DESC=nginx

test -x $DAEMON || exit 0

# Include nginx defaults if available
if [ -f /etc/default/nginx ] ; then
        . /etc/default/nginx
fi

set -e

case "$1" in
  start)
        echo -n "Starting $DESC: "
        start-stop-daemon --start --quiet --pidfile /opt/nginx/logs/$NAME.pid \
                --exec $DAEMON -- $DAEMON_OPTS
        echo "$NAME."
        ;;
  stop)
        echo -n "Stopping $DESC: "
        start-stop-daemon --stop --quiet --pidfile /opt/nginx/logs/$NAME.pid \
                --exec $DAEMON
        echo "$NAME."
        ;;
  restart|force-reload)
        echo -n "Restarting $DESC: "
        start-stop-daemon --stop --quiet --pidfile \
                /opt/nginx/logs/$NAME.pid --exec $DAEMON
        sleep 1
        start-stop-daemon --start --quiet --pidfile \
                /opt/nginx/logs/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
        echo "$NAME."
        ;;
  reload)
          echo -n "Reloading $DESC configuration: "
          start-stop-daemon --stop --signal HUP --quiet --pidfile     /opt/nginx/logs/$NAME.pid \
              --exec $DAEMON
          echo "$NAME."
          ;;
      *)
            N=/etc/init.d/$NAME
            echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
            exit 1
            ;;
    esac

    exit 0

Next, let’s set the permissions and make nginx load on a reboot:

sudo chmod +x /etc/init.d/nginx
sudo /usr/sbin/update-rc.d -f nginx defaults

Now you should be able to start and stop nginx using the command you’re used to:

sudo /etc/init.d/nginx start

Bonus steps In case it’s not already installed, let’s grab the perquisites and then install the mysql gem. This will improve performance on your webserver:

sudo apt-get install libmysqlclient-dev
sudo gem install mysql --no-rdoc --no-ri

You should also look into using a helper for deployment. I still use Capistrano but there are alternatives such as Vlad the Deployer, Puppet and others. I will also recommend that if you go with Capistrano that you check out the capistrano-ext gem which allows you to do multi-stage deployments.

Troubleshooting If things didn’t go smoothly, here are some things to check:

1. There’s an error log for nginx in /opt/nginx/logs/ Try looking to see if you get any hints there.

2. If you see a 403 forbidden error, make sure you have permissions set correctly. I’m running Nginx as www-data and I’ve set the group/user owners of my rails app to match using the chown -R www-data:www-data command. It doesn’t hurt to confirm it.

3. Try running your rails app in development mode using the standard script/server. If it doesn’t work there then it obviously won’t work in production mode either

For help, you should check out the great railsforum or Mailing list front-end.

Next Page »