본문 바로가기
About Computer/서버관리

Ubuntu 10.04.4 LTS 서버 설치 후 했던 작업 리스트 (hostple.net)

by leanu 2013. 7. 10.

Update apt-get update serverlist



Path : /etc/apt/sources.list


Following is for the hostple.net Service User.

eb http://ftp.daum.net//ubuntu/ lucid main restricted

deb-src http://ftp.daum.net//ubuntu/ lucid main restricted

## Major bug fix updates produced after the final release of the

## distribution.

deb http://ftp.daum.net//ubuntu/ lucid-updates main restricted

deb-src http://ftp.daum.net//ubuntu/ lucid-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu

## team, and may not be under a free licence. Please satisfy yourself as to

## your rights to use the software. Also, please note that software in

## universe WILL NOT receive any review or updates from the Ubuntu security

## team.

deb http://ftp.daum.net//ubuntu/ lucid universe

deb-src http://ftp.daum.net//ubuntu/ lucid universe

deb http://ftp.daum.net//ubuntu/ lucid-updates universe

deb-src http://ftp.daum.net//ubuntu/ lucid-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu

## team, and may not be under a free licence. Please satisfy yourself as to

## your rights to use the software. Also, please note that software in

## multiverse WILL NOT receive any review or updates from the Ubuntu

## security team.

deb http://ftp.daum.net//ubuntu/ lucid multiverse

deb-src http://ftp.daum.net//ubuntu/ lucid multiverse

deb http://ftp.daum.net//ubuntu/ lucid-updates multiverse

deb-src http://ftp.daum.net//ubuntu/ lucid-updates multiverse

## Uncomment the following two lines to add software from the \'backports\'

## repository.

## N.B. software from this repository may not have been tested as

## extensively as that contained in the main release, although it includes

## newer versions of some applications which may provide useful features.

## Also, please note that software in backports WILL NOT receive any review

## or updates from the Ubuntu security team.

# deb http://ftp.daum.net/ubuntu/ lucid-backports main restricted universe multiverse

# deb-src http://ftp.daum.net/ubuntu/ lucid-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical\'s

## \'partner\' repository. This software is not part of Ubuntu, but is

## offered by Canonical and the respective vendors as a service to Ubuntu

## users.

# deb http://archive.canonical.com/ubuntu lucid partner

# deb-src http://archive.canonical.com/ubuntu lucid partner

deb http://security.ubuntu.com/ubuntu lucid-security main restricted

deb-src http://security.ubuntu.com/ubuntu lucid-security main restricted

deb http://security.ubuntu.com/ubuntu lucid-security universe

deb-src http://security.ubuntu.com/ubuntu lucid-security universe

deb http://security.ubuntu.com/ubuntu lucid-security multiverse

deb-src http://security.ubuntu.com/ubuntu lucid-security multiverse


After modifying sources.list file, execute "apt-get update"






Set date & time of ubuntu server


$ sudo ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime






Create backup/restore script and register backup schedules to cron



Backup Script

#!/bin/bash

cd /

export Today="finsternis.me-`date '+%Y-%m-%d'`"

tar cvpzf /backup/$Today.tgz --exclude=/proc --exclude=/lost+found --exclude=/backup --exclude=/sys /


Restore Script

#!/bin/bash


if [ $# -eq 1 ]

then

        tar cvpzf $1 -C /

        mkdir /proc

        mkdir /lost+found

        mkdir /mnt

        mkdir /sys

        echo

        echo "========================================================="

        echo "Server Restoring is Finished. Please restart your server"

        echo "========================================================="

        echo

else

        echo "[ Usage ] $0 <backupfile>"

        exit

fi


Register Backup script to cron


$ crontab -e



# m h  dom mon dow   command

33 3 * * 3 /root/backup-server.sh


[분(0-59)] [시(0-23)] [일(1-31)] [월(1-12)] [요일(0-6, 0 = 일요일)] [명령어]






Create Account


$ useradd -G sudo -m -s /bin/bash -b /home [account-id]


Group name could be "admin" or "sudo".




Install Essential Programs


$ sudo apt-get install subversion

$ sudo apt-get install locales



Change Default shell to bash


$ chsh -s /bin/bash


Install Ruby & gem & rails (1.9.3)


$ apt-get install curl

curl -L https://get.rvm.io | bash -s stable

$ vi /etc/group # add all users that will be using rvm to 'rvm' group

$ id

uid=0(root) gid=0(root) groups=0(root),1002(rvm)

$ source /etc/profile.d/rvm.sh

$ rvm requirements

$ rvm install 1.9.3

$ rvm use 1.9.3 --default

$ rvm rubygems current

$ gem install rails


Install redmine (2.3.1)


# Instead of Following commands, refer the instruction of installation in www.redmine.org

$ tar xvfz redmine-2.3.1.tar.gz

$ cd redmine-2.3.1/config

$ cp database.yml.example database.yml

$ vi database.yml        #modify mysql access information

apt-get install libmysqlclient-dev

$ gem install bundler

$ apt-get -y install graphicsmagick-libmagick-dev-compat

$ apt-get install libmagickcore-dev libmagickwand-dev

$ bundle install --without development test

$ rake generate_secret_token

$ RAILS_ENV=production rake db:migrate

$ RAILS_ENV=production rake redmine:load_default_data

$ useradd -m -b /home redmine

$ passwd redmine

$ mkdir -p /redmine/files /redmine/log /redmine/tmp/pdf /redmine/plugin_assets 

$ chown -R redmine:redmine /redmine/

$ chmod -R 755 /redmine/



댓글