====== Frequently Asked Questions ======
===== How do I get my Rails app onto my Brightbox? =====
There are a number of ways, the easiest is to use our [[docs:thebrightboxgemv2|Brightbox Capistrano recipes]].
===== How do I get root access on my Brightbox? =====
Login over [[docs:Ssh|SSH]] as the ''rails'' user and run commands using the ''sudo'' tool, which asks for your ''rails'' user password and then runs the command as root:
sudo /etc/init.d/apache restart
We recommend running each command you need using the ''sudo'' command, but if you need to get a root shell to run a number of commands, just run the ''bash'' command with ''sudo''
sudo bash
===== I don't like sudo, how can I login directly as root using ssh? =====
See the [[docs:Ssh#direct_root_access|SSH support page]] for more information on setting up an ssh key for direct root access.
===== How do I reboot my Brightbox? =====
Run the following command via ssh to restart your Brightbox machine:
sudo shutdown -r now
**Note**: We’ll soon have a web-based account admin area where you’ll also be able to reboot your Brightbox machines.
===== Why does my Brightbox have two network interfaces? =====
Each Brightbox comes with two virtual network interfaces each one on a separate physical network segment. ''eth0'' is Internet facing and carries your web and remote access traffic. ''eth1'' is a private network and is used to access local services, such as the MySQL and backup servers. Having these separate helps with security and performance. The [[docs:BrightboxNetwork|Brightbox Network]] page has more details.
===== How do I access the database servers? =====
Dedicated MySQL services are available with all Brightbox hosting packages. The [[docs:MySQLCluster#access|MySQL Cluster]] page has more information on configuring your Rails app to use them.
===== I can't access a certain port on my Brightbox! =====
All Brightboxes are protected by our firewall with only a limited set of ports open. If you require additional ports to be opened for your Brightbox, please submit a request with the [[docs:HelpDesk|Help Desk]]. The [[docs:BrightboxNetwork#firewall| Brightbox Network]] page has more information about the firewalls.
===== How can I send email from my Brightbox? =====
All Brightboxes have access to a [[docs:smtprelay|dedicated smtp relay]].
===== How can I schedule rake tasks to run regularly? =====
You can configure the [[docs:cron|Cron daemon]] to run any commands you like whenever you like.
===== Can I run PHP on my Brightbox? =====
By default PHP isn't supported, but you can easily install it. See the [[docs:php|PHP documentation]] for more details.
===== Can I access or restart my Brightbox via the control panel? =====
Coming soon.
===== My Rails app won't restart properly =====
The most common cause of this is stale Mongrel pid files. You just need to delete the stale mongrel pid files from the log directory.
Stop your app using the [[docs:thebrightboxgem#capistrano_tasks|stop_mongrel_cluster]] task.
[[docs:ssh|ssh]] into your Brightbox and run the command:
rm /home/rails/myappname/current/log/*.pid
Then start up your app again using the [[docs:thebrightboxgem#capistrano_tasks|start_mongrel_cluster]] task.
===== Why do I see six mongrel_rails instances on the process list? I only started two! =====
Mongrel is partially threaded. It has one thread to manage inbound http connections, one thread to run the Rails application and a third thread to handle large file uploads so that the main Rails thread doesn't block.
What you are seeing on the process list is all these threads due to the way that Linux implements threading (by using 'process cloning'). If you run 'ps uxf' you will see the way the mongrel threads are linked to each other in two distinct sets of three.
So yes it is correct, when you start a mongrel you'll get three processes.
===== I've added my public key to the authorized_keys file but I still get asked for the password =====
SSH is incredibly fussy about file permissions and file ownership. Make sure that you have [[docs:ssh#installing_a_new_ssh_key | followed the instructions]] about installing a new public key.
Check that
* you have put the key in ''~/.ssh/authorized_keys''. Note the 'z' and plural 'keys'.
* all the files are owned by the user.
* the file permissions on the ''~/.ssh'' directory are set correctly (no group or other write).
* the file permissions on the home directory ''~'' are set correctly. (no group or other write).
* that you have specified the name of the key on the ''ssh'' command line with the -i option if you are not using the default key name.
* that you have put your key in your agent with ''ssh-add'' and are using the correct Agent forwarding option (-A on Ubuntu) if you are logging in with another machine as the gateway.
===== I've tried upgrading Rubygems, but my machine has hung =====
If you're running Rubygems less than v1.2.0 you may experience problems installing gems. This is because old versions of rubygems tried to keep an entire index locally and that index is now too big for 256Mb (and even some 512Mb) machines to cope with.
In this case you will not be able to update rubygems using the usual ''gem update --system'' and you will need to upgrade by hand.
* First download the rubygems tar file by hand from the Rubyforge website into a suitable temporary directory.
wget http://rubyforge.org/frs/download.php/38646/rubygems-1.2.0.tgz
tar xvf rubygems-1.2.0.tgz
cd rubygems-1.2.0
* Then run the setup program via sudo.
sudo ruby setup.rb