레이블이 Linux인 게시물을 표시합니다. 모든 게시물 표시
레이블이 Linux인 게시물을 표시합니다. 모든 게시물 표시

2010년 3월 10일 수요일

웹서버 접속자수 확인하기

[code]ps -ef | grep httpd | wc -l[/code]


쉘상태에서 웹서버와 통신하고있는 사람 수 알아내기

[code]netstat -np|grep -F httpd|awk '{print $5}'|sed 's/:[0-9]*//'|sort -u|wc -l[/code]

iptables 규칙 저장 및 복구하기

iptables 규칙 저장 및 복구하기

방화벽 규칙은 컴퓨터가 켜져있는 동안에만 유효합니다. 만일 시스템이 재부팅되면 규칙이 자동으로 지워지고 재설정됩니다. 따라서 이후에도 똑같이 읽혀지도록 규칙을 저장하시려면 다음 명령을 사용하십시오.


[code]/sbin/service iptables save[/code]


규칙이 /etc/sysconfig/iptables 파일에 저장되어 서비스가 시작되거나 재시작되며 컴퓨터가 재부팅될 때마다 동일하게 적용됩니다.

아파치 Alias 설정

서버 내 모든 계정의 홈페이지에서 공용으로 사용 될 프로그램이 있는데 이것을 모든 계정에 설치하려고 하면 여간 복잡한것이 아니다.

이럴땐 Alias 기능을 사용하면 공용으로 사용될 프로그램을 하나만 설치하고 같은 주소이름을 통해 공유하여 사용 할 수 있다.

예를들어 mysql 관리 프로그램인 phpMyAdmin을 모든 계정에서 http://도메인/phpMyAdmin 이라는 주소로 사용하고자 한다면 아래와 같은 내용을 httpd.conf 설정파일에 추가해 주면 된다.


[code]Alias /phpMyAdmin/ "/usr/local/phpMyAdmin/" Options +ExecCGI -Indexes AllowOverride None Order allow,deny Allow from all [/code]

24시간 이내에 변경된 php 파일 찾기

24시간 이내에 변경된 php 파일을 찾는 명령입니다.

[code]find . -name '*.php' -mtime -1 -print[/code]


php 파일 뿐 아니라 모든 파일을 찾고자 한다면..

[code]find . -mtime -1 -print[/code]

mysql 4.1.x 에서 4.0으로 데이터 이전하기

기존 서버에 쉘 접속후 다음과 같은 명령으로 데이터를 백업받는다.

shell> mysqldump -h localhost -u root -pabc abcdatabase --default-charset=euckr --compatible=mysql40 > abcscript.sql

default-charset=euckr로 인해 에러메세지를 보이는 경우가 있는데 이땐 케릭터셋 옵션을 빼준다.


백업받은 데이터를 옮길 서버에 넣고 데이터를 입력한다.

shell> mysql -h localhost -u abc -ppabc abcdatabase < abcscript.sql

nobody 권한의 php 파일 검색하기

[code]find /home -user nobody | grep "\.php" > test.txt[/code]

기본 케릭터셋 변경하기

$ locale (현재 케릭터셋을 확인한다)

1. sudo apt-get install language-pack-ko
2. sudo locale-gen ko_KR.EUC-KR
3. /etc/environment 파일 내에 LANG="ko_KR.EUC-KR" 추가
4. reboot
5. gdm login시 언어를 EUC-KR 선택
6. /etc/profile 파일 마지막에 LANG="ko_KR.EUC-KR" 추가

우분투에서 필요없는 패키지 자동으로 삭제하기

우분투/데비안에 새로 추가된 기능으로 더 이상 필요없는 패키지가 있으면 이를 한 번에 삭제할 수 있다.

apt-get autoremove

만 실행해주면 불필요한 패키지를 모두 제거해준다.

다른 패키지와 많이 연동된 복잡한 패키지를 삭제한 다음에 이 명령을 함께 쓰는 습관을 들이자.

Ubuntu의 FireFox에서 IE View 설치하기

FireFox에서 IE View를 사용하기 위해선 Internet Explorer가 설치되어 있어야 한다.

그러기 위해서 아래 파일을 설치한다.

sudo apt-get intall wine
sudo apt-get install cabextract

위 파일을 설치했으면 아래 파일을 다운받아 설치한다.
ies4linux-2.99.0.1.tar.gz

적당한 디렉토리에 압축을 푼 후 ies4linux 파일을 실행하면 설치한 IE버전을 묻는 창이 나오고 자동으로 설치가 진행된다.

IE의 설치를 마쳤으면 FireFox에 IE View Lite 를 설치하고 IE 경로를 설정해 주면 된다.
IE의 경로는 ..

/home/사용자아이디/bin/ie6

설정을 마쳤으면 파이어폭스에서 IE View를 사용해보자!! ^^



Apache expires 설정으로 브라우저 캐시

httpd.conf 에 간단히

ExpiresActive On
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"

요렇게 해 주면 js, css, images 는 브라우저 캐시를 이용하게 됩니다.

그러면 한번 불러온 저 파일들은 뒤로,앞으로 이동시에 다시 불러오지 않습니다.
오직 새로고침시에만 다시 불러옵니다.

License : Public Domain
 
 
 
 
파일 다운로드 php 에는

header('Pragma: cache'); // 아파치가 자동으로 no-cache 를 붙이기 때문에 넣었습니다.
header('Cache-Control: max-age=2592000');
header('Expires: '.substr(gmdate('r', strtotime('+1 MONTH')), 0, -5).'GMT');

요렇게 해주면 됩니다.

APM + Library 설치

[APM + Library 설치]
===============================================
Step 0 : 설치할 APM 및 라이브러리 파일들 준비
===============================================
zlib-1.2.3.tar.tar
libpng-1.2.12-no-config.tar.gz
freetype-2.2.1.tar.gz
jpegsrc.v6b.tar.gz
gd-2.0.33.tar.tar
libxml2-2.6.26.tar.gz
libiconv-1.9.2.tar.tar
mysql-5.0.22.tar.tar
httpd-2.2.2.tar.tar
php-5.1.4.tar.gz
ZendOptimizer-3.0.0-linux-glibc21-i386.tar.gz

===============================================
Step 1 : Install Packages
===============================================
1.1 ZLIB 설치 (http://www.gzip.org/zlib/)
http://www.zlib.net/zlib-1.2.3.tar.gz
-----------------------------------------------
#tar xvfz zlib*
#cd zlib*
#./configure
#make
#make install
#cd ..
#rm -rf zlib*
-----------------------------------------------
1.2 LIBPNG 설치 (http://www.libpng.org/pub/png/libpng.html)
http://prdownloads.sourceforge.net/libpng/libpng-1.2.16-no-config.tar.gz?download
-----------------------------------------------
#tar xvfz libpng*
#cd libpng*
#cp scripts/makefile.linux makefile
#make test
#make install
#cd ..
#rm -rf libpng*
-----------------------------------------------
1.3 FREETYPE 설치 (http://freetype.sourceforge.net/)
http://download.savannah.gnu.org/releases/freetype/freetype-2.3.4.tar.gz
http://download.savannah.gnu.org/releases/freetype/freetype-2.2.1.tar.gz
-----------------------------------------------
#tar xvfz freetype*
#cd freetype*
#./configure
#make
#make install
#cd ..
#rm -rf freetype*
-----------------------------------------------
1.4 JPEGSRC 설치 (ftp://ftp.uu.net/graphics/jpeg/)
ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
-----------------------------------------------
#tar xvfz jpegsrc*
#cd jpeg-6b
#./configure --enable-shared --enable-static
#make
#make test
#make install
#make install-lib
#make install-headers
#cd ..
#rm -rf jpegsrc*
-----------------------------------------------
1.5 GD 설치
http://www.boutell.com/gd/http/gd-2.0.9.tar.gz
-----------------------------------------------
#tar xvfz gd*
#cd gd*
#./configure
#make
#make install
#cd ..
#rm -rf gd*
 
(위에서 zlib 를 설치 했음 에도 불구하고 make 실행시 gdtf.c 파일에서 freetype.h 에서 ft2build.h 가 include 되지 못한 에러가 뜨면 /usr/local/include/freetype2/freetype/ 에 ft2build.h 파일을 복사한 후 gdft.c 파일 55라인 include "freetype/freetype.h" 위에 include "freetype/ft2build.h" 라는 구문을 넣어준다.)

-----------------------------------------------
1.6 LIBXML2 설치 (http://xmlsoft.org/downloads.html)
ftp://xmlsoft.org/libxml2/libxml2-2.6.28.tar.gz
-----------------------------------------------
#tar xvfz libxml2*
#cd libxml2*
#./configure
#make
#make install
#cd ..
-----------------------------------------------
1.7 LIBICONV 설치 (http://www.gnu.org/software/libiconv/)
ftp://ftp.kaist.ac.kr/gnu/libiconv/libiconv-1.9.2.tar.gz
http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.11.tar.gz
-----------------------------------------------
#tar xvfz libiconv*
#cd libiconv*
#./configure --prefix=/usr/local
#make
#make install
#ln -s /usr/local/lib/libiconv.so.2 /usr/lib/libiconv.so.2
#cd ..
-----------------------------------------------
 

===============================================
Step 2 : Install APM
===============================================
2.1 MYSQL5 설치
http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.37.tar.gz/from/http://mysql.new21.com/
-----------------------------------------------
#tar xvfz mysql*
#cd mysql*
#
./configure \
--prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data \
--disable-shared --enable-assembler \
--with-thread-safe-client --with-mysqld-user="mysql" \
--with-client-ldflags=-all-static \
--with-mysqld-ldflags=-all-static \
--with-readline --without-debug \
--without-docs --without-bench \
--with-charset=euckr
./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --disable-shared --enable-assembler --with-thread-safe-client --with-mysqld-user="mysql" --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --with-readline --without-debug --without-docs --without-bench --with-charset=euckr
#make
#make install
#/usr/local/mysql/bin/mysql_install_db
#groupadd mysql
#adduser -g mysql mysql
#vi /etc/passwd
 mysql:x:522:523::/home/mysql:/sbin/nologin // nologin 으로 수정
#rm -rf /home/mysql
#chown -R mysql.mysql /usr/local/mysql/data
#cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
#vi /etc/ld.so.conf
 /usr/local/mysql/lib/mysql  // 라이브러리 인식시키기 위해서 추가
#ldconfig
#/usr/local/mysql/bin/mysqld_safe &
#/usr/local/mysql/bin/mysqladmin -u root password "새비밀번호"
-----------------------------------------------
2.2 APACHE2 설치
http://ftp.kaist.ac.kr/pub/Apache/httpd/httpd-2.2.4.tar.gz
-----------------------------------------------
#tar xvfz httpd*
#cd httpd*
#./configure --prefix=/usr/local/apache2 --enable-modules=so --enable-so --enable-rewrite
#make
#make install
-----------------------------------------------
2.3 PHP5 설치 (5.2.x는 에러난다 5.1.6으로!!)
http://kr2.php.net/get/php-5.2.1.tar.gz/from/this/mirror
http://www.rootman.co.kr/NFS2/APM/php-5.1.4.tar.bz2
-----------------------------------------------
#vi /etc/ld.so.conf (라이브러리 인식시키기..)
* 다음라인을 추가
/lib
/usr/lib
/usr/local/lib
/usr/local/mysql/lib/mysql
#ldconfig
#tar xvfz php*
#mv php* /usr/local/php (폴더명을 변경... tar.gz 를 조심...)
#cd /usr/local/php
#
./configure \
--prefix=/usr/local/php \
--with-mysql=/usr/local/mysql \
--with-apxs2=/usr/local/apache2/bin/apxs \
--with-expat-dir=/usr \
--with-zlib-dir \
--with-png-dir=/usr \
--with-jpeg-dir=/usr \
--with-gdbm=/usr \
--with-tiff-dir=/usr \
--with-ttf \
--with-freetype-dir=/usr \
--with-gd \
--with-xml --with-xmlrpc \
--with-iconv=/usr/local \
--with-imap \
--with-imap-ssl \
--with-kerberos \
--with-openssl=/usr \
--with-charset=euc_kr \
--enable-ftp \
--enable-sockets \
--enable-sysvshm=yes \
--enable-sysvsem=yes \
--enable-debug=no \
--enable-track-vars=yes \
--enable-url-fopen-wrapper=yes \
--enable-memory-limit \
--enable-mbstring \
--enable-wddx \
--enable-bcmath  \
--enable-mbstr-enc-trans \
--enable-mbregex \
--enable-exif \
--enable-gd-native-ttf \
--enable-gd-imgstrttf \
--enable-calendar \
--enable-magic-quotes \
--enable-sigchild \
--enable-pcntl  \
./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache2/bin/apxs --with-expat-dir=/usr --with-zlib-dir --with-png-dir=/usr --with-jpeg-dir=/usr --with-gdbm=/usr --with-tiff-dir=/usr --with-ttf --with-freetype-dir=/usr --with-gd --with-xml --with-xmlrpc --with-iconv=/usr/local --with-imap --with-imap-ssl --with-kerberos --with-openssl=/usr --with-charset=euc_kr --enable-ftp --enable-sockets --enable-sysvshm=yes --enable-sysvsem=yes --enable-debug=no --enable-track-vars=yes --enable-url-fopen-wrapper=yes --enable-memory-limit --enable-mbstring --enable-wddx --enable-bcmath  --enable-mbstr-enc-trans --enable-mbregex --enable-exif --enable-gd-native-ttf --enable-gd-imgstrttf --enable-calendar --enable-magic-quotes --enable-sigchild --enable-pcntl
DBA 오류 발생시 아래와 같이
./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache2/bin/apxs --with-expat-dir=/usr --with-zlib-dir --with-png-dir=/usr --with-jpeg-dir=/usr --without-gdbm --with-tiff-dir=/usr --with-ttf --with-freetype-dir=/usr --with-gd --with-xml --with-xmlrpc --with-iconv=/usr/local --with-imap --with-imap-ssl --with-kerberos --with-openssl=/usr --with-charset=euc_kr --enable-ftp --enable-sockets --enable-sysvshm=yes --enable-sysvsem=yes --enable-debug=no --enable-track-vars=yes --enable-url-fopen-wrapper=yes --enable-memory-limit --enable-mbstring --enable-wddx --enable-bcmath  --enable-mbstr-enc-trans --enable-mbregex --enable-exif --enable-gd-native-ttf --enable-gd-imgstrttf --enable-calendar --enable-magic-quotes --enable-sigchild --enable-pcntl
(위와같이 환경 설정시 rfc822.h 를 못 찾고 c-client 패키지의 설치 여부도 물어보는 문제가 발생하면  php 컴파일시 --with-imap 때문에 rfc822.h 를 참조하게 된다. rfc822.h는 일반적으로 imap-devel 패키지에 포함되어 있다.
첫번째는 imap 이 dovecot 로 제공되고 있으므로 dovecot가 설치되어 있는지 확인.
두번째로 rfc822.h 는 libc-client-devel 에도 포함되어 있으므로 libc-client-devel 패키지가 설치가 되어있는지 확인)

#make
#make install
#cp php.ini-dist /usr/local/php/lib/php.ini
-----------------------------------------------
2.4 ZendOptimizer3 설치  <--이건 안해도됨
http://www.rootman.co.kr/NFS2/Zend/ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz
-----------------------------------------------
#tar xvfz Zend*
#cd Zend*
#./install.sh
-----------------------------------------------
 
===============================================
Step 3 : Setting APM
===============================================
3.1 Apache2
-----------------------------------------------
#vi /usr/local/apache2/conf/httpd.conf
CustomLog logs/access_log common << 이 부분을 수정
SetEnvIfNoCase Request_URI (gif|png|jpg|css|js|bmp|jpeg|swf)$ IMAGE=1
CustomLog /usr/local/apache2/logs/access_log common env=!IMAGE
//있는지 확인후 없으면 추가
LoadModule php5_module modules/libphp5.so
// php파일을 웹서버에서 인식하기 위해 아래두줄 추가
AddType application/x-httpd-php .php .html .htm .inc
AddType application/x-httpd-php-source .phps
// 처음페이지로 인식할 파일명설정
DirectoryIndex index.html index.htm index.php
-----------------------------------------------
===============================================
Step 4 : 부팅시 자동 실행
===============================================
4.1 MySQL
-----------------------------------------------
#cp -p /usr/local/mysql/share/mysql/mysql.server /etc/rc.d/init.d/mysqld
#ln -s /etc/rc.d/init.d/mysqld /etc/rc.d/rc3.d/S90mysqld
#/etc/rc.d/init.d/mysqld start
#/etc/rc.d/init.d/mysqld stop
-----------------------------------------------
4.2 Apache
-----------------------------------------------
#ln -s /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd
// run level 3인 경우
#ln -s /etc/rc.d/init.d/httpd /etc/rc.d/rc3.d/S75httpd

아파치가 설치되어 있는 상태에서 PHP의 gd lib만 추가 설치

아파치가 설치되어 있는 상태에서 PHP의 gd lib만 추가 설치하고 싶은경우
php를 다시 설치해주어야 한다.
하지만 추후에는 enable-module=so 를 통해 php.ini파일을 변경해 ext를 추가해줄 수 있다

1. RPM삭제
rpm -e --nodeps zlib
rpm -e --nodeps zlib-devel
rpm -e --nodeps freetype
rpm -e --nodeps freetype-devel
rpm -e --nodeps freetype-utils
rpm -e --nodeps gd
rpm -e --nodeps gd-devel
rpm -e --nodeps libjpeg
rpm -e --nodeps libjpeg-devel
rpm -e --nodeps libpng
rpm -e --nodeps libpng-devel

2. zlib설치(이놈을 설치하지 않으니 gd가 제대로 안깔림)
[다운로드] http://www.gzip.org/zlib/
shell>tar -xvzf zlib-1.2.1.tar.gz
shell>cd zlib-1.2.1
shell>./configure -s // libz.so 동적모듈생성
shell>make
shell>./configure // libz.a 정적모듈생성
shell>make test
shell>make install

shell>cp libz.so* /usr/local/lib

shell>cd /usr/local/lib
shell>rm -rf libz.so
shell>rm -rf libz.so.1
shell>ln -s libz.so.1.2.1 libz.so
shell>ln -s libz.so.1.2.1 libz.so.1

shell>vi /etc/ld.so.conf
/usr/local/lib추가 // 라이브러리 경로 추가

shell>ldconfig // 라이브러리 경로 적용명령

3. libpng설치
[다운로드] ftp://swrinde.nde.swri.edu/pub/png/src
[설치]
shell>tar -xvzf libpng-1.2.5.tar.gz
shell>cd libpng-1.2.5
shell>cp scripts/makefile.linux Makefile
shell>make
shell>make test
shell>make install

4. freetype설치
[다운로드] http://prdownloads.sourceforge.net/freetype/
[설치]
shell>tar -xvzf freetype-2.1.8.tar.gz
shell>cd freetype-2.1.8
shell>./configure
shell>make
shell>make install

5. jpge설치
[다운로드] ftp://ftp.uu.net/graphics/jpeg/
[설치]
shell>tar -xvzf jpegsrc.v6b.tar.gz
shell>cd jpeg-6b
shell>./configure --enable-shared --enable-static
shell>make
shell>make test
shell>make install

6. gd설치
[다운로드] http://www.boutell.com/gd/http/
[설치]
shell>tar xvzf gd-2.0.9.tar.gz
shell>cd gd-2.0.9
shell>./configure
shell>make
shell>make install

7. PHP설치
[다운로드] http://www.php.net/downloads.php
[설치]
shell> ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/php --with-mysql --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-gif-dir=/usr/local --with-zlib-dir=/usr/local --with-gd --with-freetype --with-language=korean --with-charset=euc_kr --with-regex=php --enable-module=so --enable-gd-native-ttf --enable-sockets --disable-debug --with-iconv
shell>make
shell>make install

shell>cp php.ini-dist /usr/local/php/php.ini //with-config-file-path위치로 복사

[Ubuntu] TouchPad 설정하기2

아래에 터치패드를 설정할 수 있는 프로그램을 설치하는것을 보여줬으나 업데이트 이후 프로그램이 설치가 되지 않아 GUI를 사용할수가 없게 되었다. ㅠㅠ


이번엔 수동으로 터치패드를 On/Off 할 수 있는 방법을 알아보자.


참조사이트 : https://help.ubuntu.com/community/SynapticsTouchpad?highlight=%28touchpad%29#head-0987a19d083570b614bbf6648879b7afa18dc480


1. 환경파일 설정


노트북에 터치패드가 있다면 기본적으로 /etc/X11/xorg.conf 파일에 설정이 되어있을 것이다.

없다면 다음 설정을 해주어야 한다.


Section "InputDevice"

        Identifier      "Configured Mouse"

        Driver          "mouse"

        Option          "CorePointer"

        Option          "Device"                "/dev/input/mice"

        Option          "Protocol"              "ExplorerPS/2"

        Option          "ZAxisMapping"          "4 5"

        Option          "Emulate3Buttons"       "true"

EndSection


Section "InputDevice"

        Identifier      "Synaptics Touchpad"

        Driver          "synaptics"

        Option          "SendCoreEvents"        "true"

        Option          "Device"                "/dev/psaux"

        Option          "Protocol"              "auto-dev"

        Option          "HorizScrollDelta"      "0"

        Option          "SHMConfig"             "on"

EndSection



Section "ServerLayout"

        Identifier      "Default Layout"

        Screen          "Default Screen"

        InputDevice     "Generic Keyboard"

        InputDevice     "Configured Mouse"

        InputDevice     "stylus" "SendCoreEvents"

        InputDevice     "cursor" "SendCoreEvents"

        InputDevice     "eraser" "SendCoreEvents"

        InputDevice     "Synaptics Touchpad"

EndSection



위와 같은 설정을 했으면 시스템을 재시작하거나 X윈도우를 재시작한다.


재시작 후 다음 명령으로 터치패드의 작동상태를 확인한다.


synclient -m l터치패드의 움직임이 좌표로 표시될 것이다.



2. 실행명령어 등록


간단히 명령을 실행할 수 있도록 스크립트 파일을 만든다.


/usr/local/bin/tpoff 파일을 생성한다.


cd /usr/local/bin

gksudo gedit tpoff


#!/bin/bash

#


synclient touchpadoff=1



/usr/local/bin/tpon 파일을 생성한다.


gksudo gedit tpon


#!/bin/bash

#


synclient touchpadoff=0



/usr/local/bin/touchpad.py 파일을 생성한다.


gksudo gedit touchpad.py


#!/usr/bin/python

import os

import string



def ReadFile():

myfile = open('/tmp/synclient.tmp', 'rb')

for line in myfile:

TestString(line)

myfile.close()


def TestString(string):

for word in string.split():

if word == "TouchpadOff":

setting = string.split()

ChangeState(setting[2])



def ChangeState(current):

if current == "0":

os.system("synclient touchpadoff=1")

else:

os.system("synclient touchpadoff=0")

os.system("rm /tmp/synclient.tmp")


def Main():

ReadFile()

os.system("synclient -l > /tmp/synclient.tmp")

Main()


파일을 실행할 수 있도록 퍼미션을 변경한다.


sudo chmod 777 tpon tpoff touchpad.py



3. 패스워드를 물어보지 않고 파일을 실행할 수 있도록 설정한다.


sudo visudo


아래 내용을 추가한다.


{user} ALL = NOPASSWD: /usr/local/bin/touchpad.py


{user}에는 자신의 계정을 적고 /etc/sudoers 파일로 저장한다.



4. 이제 모든 설정이 마쳤다.

단축키로 등록하는 방법도 언급되어있으나 프로그램이 설치되지 않아 여기서 마치고 바탕화면이나 패널에 아이콘으로 등록을 하여 클릭만으로 온/오프를 실행할 수 있도록 프로그램을 등록하면 모든 설정은 끝난다.

[Ubuntu] Synaptics Touchpad 설정

1. 터치패드 GUI 설정툴을 설치 한다.

sudo apt-get install gsynaptics


2. /etc/X11/xorg.conf 파일에 아래 내용을 추가한다.

Section "InputDevice"
    Identifier  "Synaptics Touchpad"
    Driver      "synaptics"
    Option        "SendCoreEvents" "true"
    Option        "Device" "/dev/psaux"
    Option        "Protocol" "auto-dev"
    Option        "HorizScrollDelta" "10"
    Option        "GuestMouseOff" "1"
    Option        "SHMConfig"     "true"
EndSection

...(생략)

Section "ServerLayout"
        .....(생략)
        InputDevice     "Synaptics Touchpad"
EndSection

위 내용이 제대로 설정되면 GDM을 재시작 하거나 시스템을 재시작하면 "시스템 > 기본설정 > Touchpad"를 사용하여 터치패드 설정을 조정할 수 있다.

Ubuntu Edgy + Xgl + Beryl

우분투 데퍼에서 Xgl을 사용하기 위해 꽁수를 사용했었는데 간만에 우분투를 사용해 보니 쉬운 방법으로 Xgl을 사용하는 방법이 있네요..

http://wiki.beryl-project.org/index.php/Install/Ubuntu/Edgy/XGL

위 사이트를 참조하여 Xgl 관리프로그램과 테마관리 프로그램까지 모두 설치할 수 있었습니다.

그럼 설치방법을 간단히 알아보도록 하곘습니다.

본인은 Nvidia GeForce 7800GT 그래픽 카드를 사용하므로 ATI  설정에 관한 부분은 생략하도록 하겠습니다.

ATI 사용자 분은 위 사이트를 참조해 주세요 ^^;;


1. 우선 자신의 그래픽카드가 3D기능을 지원하는지 알아보아야 합니다.

  $ glxinfo | grep direct

위 명령 사용시 다음과 같은 메세지가 나온다면 3D기능을 지원하는 그래픽카드입니다.

  direct rendering: Yes


2. compiz, compiz-gnome 나 gset-compiz 프로그램이 설치되어 있다면 제거합니다.

  $ sudo apt-get remove compiz compiz-gnome gset-compiz


3. 프로그램을 받을 수 있도록 소스트리에 아래 사이트를 추가합니다. AMD64 컴퓨터 기준입니다.

  $ sudo gedit /etc/apt/sources.list

deb http://ubuntu.beryl-project.org/ edgy main-edgy main-edgy-amd64

더 많은 미러 사이트를 등록할 수 있습니다.

deb http://www.beerorkid.com/compiz edgy main-edgy
deb http://media.blutkind.org/xgl/ edgy main-edgy
deb http://compiz-mirror.lupine.me.uk/ edgy main-edgy
deb http://ubuntu.compiz.net/ edgy main-edgy
deb http://beryl.xglusers.de/ edgy main-edgy main-edgy-amd64

4. 키값을 설치 후 시냅택 목록을 업데이트 합니다.

  $ wget http://ubuntu.beryl-project.org/quinn.key.asc --quiet -O - | sudo apt-key add -
  $ sudo apt-get update


5. Xgl 관련 프로그램과 테마를 설치합니다.

  $ sudo apt-get install xserver-xgl
  $ sudo apt-get install beryl emerald-themes


6. 필요한 프로그램 설치는 이제 끝났고 설정만 남았습니다.
시작 세션에 Xgl을 등록 할 수 있도록 합니다.

  $ sudo gedit /usr/local/bin/startxgl.sh

위 파일을 열어 다음 내용을 넣고 저장합니다.

#!/bin/sh
beryl-manager
sleep 4
exec gnome-session

파일에 실행권한을 줍니다.

  $ sudo chmod a+x /usr/local/bin/startxgl.sh

/usr/share/xsessions/xgl.desktop 파일을 생성하고 다음 내용을 넣습니다.

[Desktop Entry]
Encoding=UTF-8
Name=Xgl
Exec=/usr/local/bin/startxgl.sh
Icon=
Type=Application


7. 로그인시 Xgl이 실행 할 수 있도록 수정합니다.

  $ sudo gedit /etc/gdm/gdm.conf-custom

젤 아랫줄에 다음 내용을 추가합니다.

0=Xgl
[server-Xgl]
name=Xgl server
command=/usr/bin/Xgl :0 -fullscreen -ac -accel glx:pbuffer -accel xv:fbo
flexible=true


8. 새션 시작시 자동으로 Beryl이 시작되도록 합니다.

  $ sudo gedit /usr/local/bin/start_beryl.sh

아래 내용을 넣고 저장합니다.

#!/bin/bash
#
# Start beryl-manager within gnome-session
#
if [ `ps -A -o comm | grep -c '^Xgl$'` == "1" ]; then
       DISPLAY=:1 beryl-manager
       DISPLAY=:1 beryl-xgl
else echo "${0}: Error: beryl-manager not launched. Xgl not running?"
fi

위에 생성된 파일에 실행권한을 줍니다.

  $ sudo chmod a+x /usr/local/bin/start_beryl.sh

그놈 메뉴에서 시스템 > 기본설정 > 세션을 열어 시작프로그램을 등록합니다.

  /usr/local/bin/start_beryl.sh



9. 이제 모든 설정이 완료되었습니다.
컴퓨터를 리부팅 하거나 윈도우세션을 재시작하여 새션 선택에서 Xgl을 선택한 후 로그인을 하면 Xgl이 바로 실행 될 것입니다.
그리고 트레이아이콘 영역에는 빨간색 다이아몬드 모양의 베릴 관리자가 실행되어 있을 것입니다.
베릴 관리자에서 Xgl설정이나 테마등륵 선택하실 수 있습니다.


그럼 Xgl을 맘껏 사용해 보세요 ^^


이상 허접 사용기였습니다.

우분투에서 Flash Player 사용하기

리눅스용 플래쉬 플레이어 인스톨버전을 다운받는다.

http://labs.adobe.com/downloads/flashplayer9.html

압축 풀면   ***.so( 공유 라이브러리)  가 나온다.

그것을 자신의 설치된 모질라 플러그인에 덮어 씌우면 된다.

보통 자신의 홈 디렉토리에 .mozilla/plugins  에 있당

그리고 파폭을 재 시작 하면 볼 수 있음~

Apache에서 SSL서버의 설치

Apache에서 SSL서버의 설치

Apache서버에서의 SSL서버의 구성은 OpenSSL과 Apache가 필요하며, 개인의 신상정보가 Web을 이용하여 전송됨으로 Apache 서버에 mod_ssl을 설치하거나 Apache + mod_SSL의 형태로 Apache서버를 설치하여 Browser와의 통신시 sniffing되지 않도록 하여야 할 것이다.
또한 자동화된 서비스를 위해서 Perl이나 php등이 필요하다. (Perl이나 PHP는 module로 설치해도 좋으며 CGI형태로 실행해도 상관이 없으나 보안을 위한 부분을 생각해보고 설치하는것이 좋을것 같다.) 인증을 요구하는 Client등의 관리를 위하여 MySQL등을 설치하는 것도 좋을것 같다. 그리고 mod_ssl의 INSTALL화일을 살펴보면 선택적으로 설치하는 화일이 있는데(mm같은것) 이것들도 필요하면 같이 설치할 수 있다.

1. OpenSSL의 설치

OpenSSL은 SSLeay를 기반으로한 공개용 암호화 라이브러리이다. 미국에서 상용으로 개발된 RSA 알고리듬을 완벽하게 호환하면서, 미국 밖에서도 사용 가능한 프리웨어이다. OpenSSL은 다음에서 구할 수 있다.
$ lynx ftp://ftp.openssl.org/source/openssl-0.9.6.tar.gz
$ gzip -d -c openssl-0.9.6.tar.gz | tar xvf -
기본적인 설치 방법은 인터넷상의 다른 패키지들처럼 다음과 같이하여 설치할수 있다.
$ ./config
$ make
$ make install

config에서 prefix를 주지 않았을 때에는 /usr/local/ssl디랙토리에 설치가 되니 다른 디랙토리에 설치를 하고자 한다면 다음과 같이 한다.
$ ./config --prefix=/usr/local \
--openssldir=/usr/local/openssl
이렇게 하면 OpenSSL의 실행화일은 /usr/local/bin에 설치되고 Certificate Service를 위한 화일들은 /usr/local/openssl아래의 디랙토리에 생성된다.
make를 실행하면 OpenSSL라이브러리(libcrypto.a와 libssl.a)와 실행화일 (openssl)이 생성되고, 라이브러리는 make를 실행한 디랙토리에, OpenSSL실행화일은 apps디랙토리에 생성된다. make를 실행하는 도중 에러가 생기면, 에러메세지를 살펴보아야 한다. 대부분 OpenSSL의 문제가 아니라고 하며, 정말로 OpenSSL의 문제라고 판단된다면 make report명령을 이용하여 출력된 내용을 openssl-bugs@openssl.org에 송신한다.
다음은 make test를 실행하여 OpenSSL이 정상적으로 동작하는지 확인한다. 실패한 내용이 있다면, CFLAGS등을 수정하고 "make clean; make"명령을 이용하여 다시 컴파일한후 make test를 실행해 본다.
모든 시험이 정상적으로 성공한다면, make install명령어를 이용하여 설치디렉토리(/usr/local/ssl이나 /usr/local/bin, /usr/local/openssl등)에 실행화일과 도움말 화일, 환경설정화일등을 설치한다. 여기까지 별 문제 없이 실행되었다면, SSL서버를 실행하기 위한 기본적인 준비는 완료된 것이다. 다음은 OpenSSL을 이용한 SSL서버운용을 위한 키생성과 환경설정을 실시한다.

2. Apache + mod_ssl + PHP4 의 설치

일반적인 Apache 와 php의 설치 방법에 큰 차이는 없으니, 여기에서는 순서만 기술하고 넘어 가도록 한다. 또한 이 내용은 mod_ssl의 INSTALL화일에 설명이 되어 있으므로 그것을 읽어보는 것이 정확할 것이다. mod_ssl은 버젼별로 Apache와 연결이 됨으로 자신이 설치하는 Apache버젼과 일치하는 mod_ssl을 설치하여야 한다. 이는 mod_ssl의 화일명을 보면 알 수가 있는데, "mod_ssl-자신버젼-아파치버젼"의 형태로 되어있다.
$ lynx http://httpd.apache.org/dist/apache_1.3.19.tar.gz
$ lynx ftp://ftp.modssl.org/source/mod_ssl-2.8.1-1.3.19.tar.gz
$ gzip -d -c apache_1.3.19.tar.gz | tar xvf -
$ gzip -d -c mod_ssl-2.8.1-1.3.19.tar.gz | tar xvf -
화일의 다운로드와 압축풀기가 끝나면 mod-ssl부터 설정을 한다.
1) mod-ssl 설정


    $ cd mod_ssl-2.8.1-1.3.19
    $ ./configure \
    --with-apache=../apache_1.3.19 \
    --with-ssl=/usr/local/ssl \
    --prefix=/usr/local/apache

2) PHP 설정

OpenSSL과 MySQL, 그리고 아파치서버를 사용가능하도록 PHP를 설정한 후 컴파일 한다.

    $ cd ../php-4.1.x
    ./configure --with-apache=../apache_1.3.x \
    --with-mysql \
    --enable-memory-limit=yes \
    --enable-debug=no
    $ make
    $ make install

3) Apache Server 설치

OpenSSL, MySQL, ModSSL, PHP의 설정이 끝났으면, 모든 기능을 아파치서버와 컴파일한다.

    $ cd ../apache_1.3.x
    ./configure --prefix=/usr/local/apache \
    --enable-module=ssl \
    --activate-module=src/modules/php4/libphp4.a \
    --enable-module=php4
    $ make
    $ make certificate
    $ make install
4) Apache 설정변경 및 구동

  • Apache 서버의 conf/httpd.conf 화일의 다음 항목을 찾아 옵션을 다음과 같이 변경한다. 받은 인증서의 -----BEGIN CERTIFICATE----- and -----END CERTIFICATE-----에 해당하는 부분을 mycert.crt로 저장하고 다음 옵션을 변경한다
    SSLCertificateFile /path/conf/ssl.crt/mycert.crt
    SSLCertificateKeyFile /path/conf/ssl.key/mycert.key
  • mycert.key는 CSR을 생성할 때 생기는 개인키로서, Thawte의 무료 CSR생성기를 통하여 CSR을 생성하셨다면, 메일로 보내졌으며, 대부분 Apache 인스톨과정에서 make certificate를 통해 생성된 개인키는 conf/ssl.key 디렉토리 아래에 저장이 된다
  • 아파치 SSL을 구동시킵니다 apache/bin/apachectl startssl
상기의 컴파일 과정을 거쳐서 생성된 Apache서버는 apachectl start명령을 이용하여 실행을 하게 되면 일반 Apache서버와 동일한 기능을 하게 되고 apachectl startssl 명령을 이용하면 mod_ssl을 이용한 https프로토콜을 사용할수 있게 된다. Client에서 사용법은 url에 "https://server/path/"라고 적게되며, 이때 Server와 Client간의 암호화 방법에 대한 협상이 이루어 지게 되고 이후에 Server와 Client간의 자료는 암호화 되어 전송이 됨으로, sniffer를 이용한 방법으로는 자료를 훔쳐볼수 없게 된다.

3. 관련 URL

ProFtp에서 계정 상위 디렉토리 제한하기

ProFtp 사용시 사용자 계정 디렉토리에서 상위 디렉토리로 이동하지 못하도록 제한하려면 다음 설정 파일을 조정한다.


proftpd.conf 파일에서 다음 주석을 해제하고 그룹명을 알맞게 조절한다.

#DefaultRoot                    ~       !groupname

디렉토리 사용 용량 확인하기

du -sh

-s 옵션은 전체 용량을 한번에 보여준다.
-h 옵션은 용량을 알아보기 쉽도록 M, G 등으로 표시해준다.

MySQL 4.x.x 에서 mysql.sock 에러 복구방법

[root@localhost bin] mysqld_safe --user=root &

[root@localhost bin] mysqld_safe &


뒤에 반드시 &를 붙여준다.