Kernel
-
uname -a
Distributions
Redhat:
-
cat /etc/redhat-release
Debian:
-
cat /etc/debian_version
SuSE:
-
cat /etc/SuSE-release
Kernel
Distributions
Redhat:
Debian:
SuSE:
Preparations:
Install CentOS with Apache and Mysql.
1. Install ruby enterprise:
2. Create some links:
3. gem install rails -v 2.X.X
Problems:
I’ve got problems with missing Mysql libraries. To fix this:
3.1 Install mysql-devel
3.2 Install mysql-gem
4. Passenger (mod_rails)
4.1 Install Passenger (mod_rails)
4.2 Passenger Apache Module
5. ImageMagick
5.1 Install ImageMagick Libraries
5.2 Install rmagick via gems
Problems:
Parameter –version doesn’t work.
Don’t use the parameter “–version”
Read more about this problem:
http://www.beanlogic.co.uk/2008/8/13/installing-a-specific-verison-of-rmagick
Missing msfonts
Installation of msfonts according to:
http://hi.baidu.com/rainchen/blog/item/089ef7364497de320a55a9a3.html
6. Config of apache and your rails app
For configuration of passenger follow the instructions there
Thats it!
With ssh key pairs you can easier login to your servers.
To generate an ssh key pair you´ll need to run the following line in your terminal:
It will ask you for location and pass phrase. You should accept the default location (~/.ssh/id_dsa.pub). For the pass phrase I usually just press return. Then the private key will have a blank pass phrase and you can login to your servers without a password. Comfort vs. security. Your choice.
After this you need to upload the public key to the server.
To generate an ssh key pair you’ll need to run the following line in your terminal:
Finally login to the server and append the public key to authorized keys:
Make sure that the .ssh folder and the authorized_keys have the right permissions:
After this, you should be able to login to the server and use scp without having to enter a password.
If you login or copy files to your servers a lot, you can setup an alias in ~/.ssh/config (on your local machine):
For your applications in production you should keep some logfiles but delete the older ones to save files space.
The following bash script will do the job.
It will zip all files older than 7 days.
Delete all files older than 30 days.
Folders will be ignored.
I call the script in the crontab like this:
Use fdisk to do the trick:
The output will be something like the following: