Direkt zum Hauptbereich

debian 6 vserver - a new installation due to centOS update problem - my steps

My centOS vserver broke down after a "yum update" and even the centOS community forum could not give an answer within 24h.
In my books that is poor for the almighty and stable centOS.

Bare in mind that I am just a normal user of linux, no professional and definitely no expert when it comes to server, but I can read, try and share my findings:

debian 6 installation steps via ssh

secure your server:

  1. adduser foobar for security purposes 
  2. change /etc/sshd/sshd_conf to PermitRootLogin no
  3. now you can login as foobar and change to root via su -
  4. visudo for sudo command permissions
  5. and put this at the bottom: foobar   ALL=(ALL) ALL

change hostname

  1. change hostname in /etc/hostname and in /etc/hosts
  2. reboot

login via rsa key rather than password

  1. locally do ssh-keygen
  2. ssh-copy-id -i foobar@hostname...
  3. ssh now works without passwords but with keys (for easy deployment)

install ruby and rails via rvm

  1. login as root
  2. always good to have: sudo apt-get install build-essential
  3. multiuser: \curl -L https://get.rvm.io | sudo bash -s stable --ruby --rails
  4. adduser foobar rvm
  5. I did a source /usr/local/rvm/scripts/rvm with all users
  6. and a logout/login and test with rvm -v revealed a working installatio

apache phusion passenger

  1. su -
  2. gem install passenger
  3. passenger-install-apache2-module
  4. the gem told me to do:
  5. apt-get install libcurl4-openssl-dev
  6. apt-get install apache2-threaded-dev
  7. and now another passenger-install-apache2-module worked
  8. put the first Load.... line into /etc/apache2/mods-available/passenger.load
  9. the second two lines in /etc/apache2/mods-available/passenger.conf
  10. run a2enmod passenger
  11. /etc/init.d/apache2 restart

set up a virtual host and test passenger

  1. create a rails app in /var/www with e.g. rails new mysite
  2. create a site as conf file in /etc/apache2/sites-available/mysite
  3. put virtual host data in it /etc/apache2/sites-available/mysite
  4. a2ensite mysite
  5. /etc/init.d/apache2 reload
  6. point your browser to it and look if passenger runs (errors asite, just passenger)

nodeJS (my passenger error with mysite test app)

  1. try sudo apt-get install node otherwise:
  2. sudo apt-get install python g++ make checkinstall
  3. wget http://nodejs.org/dist/node-latest.tar.gz
  4. tar -xzvf node-latest.tar.gz  && cd node-v*
  5. ./configure
  6. checkinstall #(remove the "v" in front of the version number in the dialog)
  7. sudo dpkg -i node_*
  8. change user and try node -v
  9. in my case also mysite test app worked then
  10.  

git

  1. apt-get install git

get postgresql

  1. go to postgresql wiki page for apt

 create new databases with utf8 enconding

  1. su -
  2. su postgres
  3. do these steps (source):
    UPDATE pg_database SET datistemplate=FALSE WHERE datname='template1';
    
    DROP DATABASE template1;
    
    CREATE DATABASE template1 WITH owner=postgres template=template0 encoding='UTF8';
    
    UPDATE pg_database SET datistemplate=TRUE WHERE datname='template1'; 
  4. create a new user with create database access: createuser -dP gitnedab
  5. give that user a database: createdb -O newusername databasename

For now I will stop this installation tutorial with the advise to do a restart of your server and see if all your settings and services work after that.

My last trial with centOS ended after a reboot did not work, but happend days later because I never bothered checking - never again!

Have fun!!!

Nico

PS: apt-get install phppgadmin
getting 403 error? got to /etc/apache2/conf.d/phppgadmin
and change to allow from all

Kommentare

Beliebte Posts aus diesem Blog

Stream your media to your DLNA device e.g. tv with miniDLNA on a linux machine

Recently we bought a Sony Bravia LED TV with the possibility to receive streams. It can read DLNA, which is not much, so dont fall for the certificate. DLNA means it can read MPEG-I/II and some other normal stuff. Luckily the Sony Bravia can read mkv and x256 and some other codecs. And this is something the sells people and adverbs dont tell you, so be warned not to trust the DLNA-Certificate too much, the device has to decode the media in the end. Anyway i set up miniDLNA on my laptop and now I am able to stream my media to the television. Although the process did not go that well. The problem was miniDLNA was breaking down all the time. And checking it by reading the logs etc revealed permission issues. I had to start miniDLNA as the user my files belonged to. BUT I did not use the user setting in the minidlna.conf instead I just started the daemon as the user. I could have done this with a startup script, but there were some issues with the network being set up at the sam...

Virtuelles Wasser?!

In den letzten Tagen habe ich immer mal wieder etwas mit Rails programmiert und werde mich ebenso heute dem neuen Auftrag "multiple file upload" kümmern. Und weil vieles "Versuch-Irrtum" ist, gucke ich auf dem zweiten Monitor immer Reportagen. Letztens kam mir "Der große Haushaltscheck" unter die Finger: ARD Mediathek "Der große Haushaltscheck" In der Sendung vom 11.3.2013 ging es um unser Trinkwasser. Jedem sollte klar sein, dass Plastikflaschen nicht die erste Wahl sind, weil man nicht darauf vertrauen kann, dass der Hersteller wirklich "gutes" Plastik nahm (BPA, Phtalate, Benzol, Xylol usw.), aber das interessante waren die genannten Zahlen in puncto virtuellem Wasser bzw. Wassersparen. Wasser sparen an und für sich ist ja gut, nur heisst das nicht, dass wir weniger die Klospühlung benutzen sollten, sondern dass wir uns Gedanken machen über das "virtuelle Wasser". Unsere Kanalisation ist eine Schwemm-Kanalisatio...