2009년 4월 17일 금요일

Terminal 명령어

자판으로 글쇠입력이 빠른사람은 터미널만큼 편리한도구도 없다.(?)
아이콘찾아다닐필요없이, 명령어만입력하면 일을 척척하니깐....
프로그램설정내용을바꾸기위해편집기로설정파일을 불러와 수정을 해야할때..
우분투는 기본적인편집기로 gedit을 사용한다. 프로그램설정내용을 바꾸려면.
최고권위자의 권위가 필요하기때문에, sudo 를 앞에넣어주고 gedit으로 수정한
파일을 연다...
---------------------------------------------------------
sudo gedit 파일경로/파일이름

이후 gedit이 실행되며, 설정파일을 편집한후저장할수있게 된다.
---------------------------------------------------------
비교적자주쓰는명령어와 도움말
mv --help

mv라는 명령어에 대해 도움말을 표시해준다.
---------------------------------------------------------
sudo apt-get install 프로그램꾸러미
sudo apt-get remove 프로그램꾸러미

프로그램을 설치제거하는 명령어...
---------------------------------------------------------
sudo apt-get update
sudo apt-get upgrade
sudo apt-get full-upgrade
sudo apt-get safe-upgrade
sudo apt-get dist-update

update는 저장소에서 이전보다 개선된꾸러미가 나왔나를 확인하는 명령
upgrade는 컴퓨터에 설치된 꾸러미중에 새로개선된 내용이 있으면 저장소에서 가져다가 설치하란 명령
dist-upgrade는 컴퓨터에 설치된 꾸러미는 아니지만, 우분투 필요한 추가꾸러미를 가져다가 설치하라는 명령.
---------------------------------------------------------
ls -ls
ls -al

ls는 list의 약자, 옵션으로 -ls를 더해주면 파일에대한 상세한정보를 보여줌
-al 옵션은 숨겨진 파일도 보여준다.
---------------------------------------------------------
mv 파일명1 파일명2
cp  파일명1 파일명2

파일명1을 지우고 파일명2로옮김, 파일명1을 복사해 파일명2로저장..
---------------------------------------------------------
mv -r 디렉토리1 디렉토리2

디렉토리1의 내용을 디렉토리2로 옮김, 원본은 지워지며, 디렉토리2가 없다면 새로만들어짐..cp에도 비슷하게 적용
---------------------------------------------------------
chmod

파일이나 디렉토리에 대한 읽기(r),쓰기(w),실행하기(x)소유권을 변경할때 씀, ls -ls로 파일이름을 보면
파일명에 drwx-xr-x하는 식으로 내용일 출력되는데 이것은 파일의 소유권을 표시한것, rwx권한이 주어져야.
파일을 마음대로 처리할 수 있음.
---------------------------------------------------------
lsb_release -a

컴퓨터에 설치된 우분투 판번호 확인
---------------------------------------------------------
date

오늘날짜와 현재시간 출력
---------------------------------------------------------
cal

이번달 달력출력
---------------------------------------------------------
df
df -h

디스크사용량출력
-h 옵션을 더하면 MB 으로 표시 해준다.
---------------------------------------------------------
du 디렉토리명

해당 디렉토리의 디스크사용량출력..
---------------------------------------------------------
mc
sudo apt-get install mc

mc 는 MS-DOS 같이 생긴.. (MS 식으로 설명하자면... 탐색기다...)

APM 설치 - Compile

수동으로 Compile 해서 Apache2+PHP5+MySQL 설치방법

http://www.bin-co.com/blog/2008/09/compile-install-lamp-linux-apache-mysql-php-server-from-source/

아니면

http://inmte.com/blog//blog/compile-and-install-a-lamplinuxapachemysqlphp-server-from-source/

참고 해보세요... 아주 쉽게 설명 있습니다..

APM 설치 - yum 이용

CentOS 에서 LAMP 설치..

Yum 을 사용해 설치시..

Apache2+PHP 설치
sudo yum groupinstall "Web Server"

아파치 시작
sudo /etc/init.d/httpd start

에러 메시지
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

Apache Config 수정
sudo nano /etc/httpd/conf/httpd.conf

Line 265 에
#ServerName www.example.com:80

호스트이름으로 바꿔야한다... (그리구 #을 지우고..)
ServerName demo

그리구 아파치 다시 시작
sudo /etc/init.d/httpd restart

서버 제시작할시 Apache를 자동시작하게 추가
sudo /sbin/chkconfig httpd on

확인 방법
sudo /sbin/chkconfig --list httpd

예를 들자면
team1ab @ centos ~ $ sudo /sbin/chkconfig httpd on
team1ab @ centos ~ $ sudo /sbin/chkconfig --list httpd
httpd              0:off    1:off    2:on    3:on    4:on    5:on    6:off


MySQL 설치

sudo yum groupinstall "MySQL Database"

MySQL 시작
sudo /etc/init.d/mysqld start

시작하면. (에러 메시지)
team1ab @ centos ~ $ sudo /etc/init.d/mysqld start
Initializing MySQL database:  Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h centos password 'new-password'
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
                                                                     [  OK  ]
Starting MySQL:                                             [  OK  ]

MySQL Root 비번 설정
sudo /usr/bin/mysqladmin -u root password 'new-password'

Note. "new-password" 에 본인이 비번 설정해준것으로 로그인.

예를 들면
sudo /usr/bin/mysqladmin -u root password 'abcdef'

MySQL 에 접속해보자
mysql -u root -p

예를 들면.
team1ab @ centos ~ $ mysql -u root -p
Enter password:

하면 비밀번호를 입력해주고 Enter, 해주면 저 메시지가 나온다.. 그럼 설치가 된것이다...
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.45 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

종료할때는 >> \q << 해주면된다...

MySQL를 서버 재시작시 자동으로 실행하구 싶으면.
sudo /sbin/chkconfig mysqld on

해주고 확인시.
sudo /sbin/chkconfig --list mysqld

예를 들면.
team1ab @ centos ~ $ sudo /sbin/chkconfig mysqld on
team1ab @ centos ~ $ sudo /sbin/chkconfig --list mysqld
mysqld             0:off    1:off    2:on    3:on    4:on    5:on    6:off

그럼 설치 끝이다...
이제 잘사용해보세요...

그냥... 쉽게 기본만 설치할시..
Apache2+PHP5+MySQL5
sudo yum install httpd mod_ssl php-common php-gd php-mcrypt php-pear php-pecl-memcache php-mhash php-mysql php-xml mysql-server mysql mysql-devel

설정은 똑같이 위에 것들을 따라 하시면 됩니다.

2009년 4월 11일 토요일

bashrc 설정

#Prompt Property
#0 = 기본값
#1 = 볼드체
#4 = 밑줄
#5 = 점멸
#7 = 역상

#Prompt Color Code
#31 = 빨강, 32 = 초록, 33 = 오렌지, 34 = 파랑,
#35 = 자주, 36 = 청록, 37 = 회색,
#90 = 진회색, 91 = 연빨강, 92 = 연두, 93 = 노랑,
#94 = 연한 파랑, 95 = 연한 자주, 96 = 하늘색
#
#40 = 검정 배경, 41 = 빨강 배경, 42 = 초록 배경,
#43 = 오렌지 배경, 44 = 파랑 배경, 45 = 자주 배경,
#46 = 청록 배경, 47 = 회색 배경,
#100 = 진회색 배경, 101 = 연한 빨강 배경, 102 = 연두 배경,
#103 = 노랑 배경, 104 = 연한 파랑 배경, 105 = 연한 자주 배경,
#106 = 하늘색 배경

예를 들면.
export PS1='\[\033[01;94m\]\u\[\033[0;33m\] @ \[\033[1;31m\]\h \[\033[01;33m\]\W \$ \[\033[00m\]'

이렇게 나올꺼다...

\u = 유저 이름을 말하는거다...
@ = @ 을 표시 해주는거구...
\h = 호스트 이름이다...
\W = 지금 어디에 있는지 표시 해준다...

알아서 마추어보면서... 해야한다...

2009년 4월 1일 수요일

SCIM 한영키 설정하기

Ubuntu 에서 SCIM 에서 한영키가 안먹힐때가 있습니다...

그럴때는...
sudo gedit ~/.Xmodmap

그 문서 안에...
keycode 108 = Hangul
keycode 105 = Hangul_Hanja

저기 위에 있는 108, 105 는

xev로 한영키, 한자키 값 확인하시고

바꿔주시면 됩니다...

그리구 Xsession 을 다시 시작해주세요..
터미널에,
sudo killall nautillus && sudo killall gnome-panel

아니면,
그냥 Ctrl+Alt+BackSpace 하시면 됩니다..