Useful linux commands to manage a rails application and components

December 5, 2006

Last night I was building out my third server with the help of a linux guru. I just wanted to record useful commands I did while setting up all the components. Note this is on a debian server and may be different for other linux flavors.

Find a process:

# ps aux | grep 

Show all listening processes:

# netstat -apt 

Find what applications are installed on debian:

# dpkg -l 
# dpkg -l | grep 

Migrate a MySQL db:

# mysqldump -u user -p dbase_name > db.dump 


# mysql -u user -p dbase_name < db.dump

Set Apache2 permissions for site directories:
Apache runs under the group www-data. You need to make sure that your sites directory and files can be read by apache.

# chmod 770 ~user/www
# chgrp -R www-data ~user/www

Test Apache2 configuration to recieve more output if it is wrong:

# apache2ctl --configtest

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: