리눅스 설치 후 랜카드 문제


text mode로 Fedora 9을 설치한 후
remote에서ssh로 접속하려는데 문제 발생

확인해보니 eth0이 UP되어 있지도 않고,
UP을 한 이후에도, 인터넷이 되지않는 문제를 겪은관계로
꼼수 부려서 해결.. >_<

/etc/rc.local 를 수정
ifconfig eth0 up #부팅시 eth0이 up안되는경우
/etc/rc.d/init.d/network restart

두줄을 추가해주면 문제없이 eth0가 액티브 되며, 인터넷을 사용
가능하게 됩니다. >_<
크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by gwlee

2008/10/15 09:26 2008/10/15 09:26
Response
0 Trackbacks , 0 Comments
RSS :
http://thegreatgoodplace.com/tt/study/rss/response/59

Trackback URL : http://thegreatgoodplace.com/tt/study/trackback/59

Leave a comment

리눅스에서 HDD 추가


출처: 슈퍼유저

일단 물리적으로 하드를 리눅스 머신에 연결시켜줍니다.
부팅 후 /etc/fstab를 확인하여 현재 mount되어져 있는 장치를 확인합니다.

그후, /var/dmesg를 확인하여 새로 mount할 하드를 확인합니다.
 E-IDE의 경우 hd*로 시작되며,
 SATA의 경우 sd*로 시작됩니다.

dmesg로 확인한 하드를 fdisk로 파티션 생성을 하고 포맷합니다.



p 명령어는 파티션 현재 파티션 정보를 보는 명령어입니다.


n 명령어를 사용하여 파티션을 생성하고,
p(primary로) -> 1 -> 크기지정 default 1 입력(Full로 잡을시, 디폴트가 Full) -> 엔터
w로 마무리

파티션 생성후 파일 시스템을 만들어 줍니다.
ext3: mke2fs -j /dev/hdb

파일시스템 생성 후,  새로운 하드를 mount할 폴더 생성 및 mount를 해줍니다.
mkdir home2
mount -t ext3 /dev/sdb /home2

mount로  제대로 mount되었는지 확인.

마지막으로 부팅시 자동으로 마운트되게 /etc/fstab를 수정해준다.



마지막에 존재하는 두 숫자의 의미를 정확하게 모름
상당히 중요한 숫자로 보임 함부로 수정하지 말것.!!
예제에서 나온것과 같이 1 2혹은 0 2로 할 것.

만약 /etc/fstab을 수정하기 겁나는 경우 mount -t ext3 /dev/sdb /home2 명령어를
/etc/rc.local 에 추가하여 부팅할 때 mount되게끔 하는 방법이 존재한다. >_<

더 보기..




크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by gwlee

2008/10/15 05:27 2008/10/15 05:27
Response
0 Trackbacks , 0 Comments
RSS :
http://thegreatgoodplace.com/tt/study/rss/response/58

Trackback URL : http://thegreatgoodplace.com/tt/study/trackback/58

Leave a comment

For loop

리눅스의 shell에서 for 문 돌리기

for ((  i = 0 ;  i <= 5;  i++  ))
do
echo "Welcome $i times"
done

i를 0에서 5까지 출력.

 

크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by gwlee

2008/10/12 22:50 2008/10/12 22:50
Response
0 Trackbacks , 0 Comments
RSS :
http://thegreatgoodplace.com/tt/study/rss/response/57

Trackback URL : http://thegreatgoodplace.com/tt/study/trackback/57

Leave a comment

VNC 리눅스 설정



VNC 설정에 대해서 너무나 잘 설명되어져 있는 블로그 글
리눅스에서 VNC 설정하다가 포기하려는 찰나.. ㅋ
혜성과 같이 구글에서 검색되는 센스.. ㅋㅋ

  * root 권한의 X를 설정한다.

1. 일단 vncserver를 설치 한다.

  # yum install vnc-server

2. 우리가 건드려야 할 파일은 다음과 같다.

/etc/sysconfig/vncservers
/root/.vnc/xstartup

먼저 첫번째 파일은 수정한다.

#vi /etc/sysconfig/vncservers


다음과 같은 화면을 볼 수 있다.

- 첫번째 VNCSERVERS="1:root" 란 Display 번호를 매기는 것이다.

- 두번째 VNCSERVERARGS[1]="-geometry 1280x800 -nolisten tcp -nohttpd"

설정을 통해 해상도와 연결방식에 대해 설정한다.
3.root 밑에 .vnc 디렉토리를 생성한다
# mkdir ~/.vnc 

4. Password를 정한다.

# vncpasswd

5. X를 띄우자!

윈도우나 리눅스에서 vncserver  에 접속을 하게되면 회색 화면만 볼 수 있다.

이걸로 해서는 결국 ssh접속이나 다를바 없다.(사실 더 불편하다.)

# vi ~/.vnc/xstartup



다음과 같은 화면을 볼 수 있다.

5,6 번째 줄의 주석을 제거하여

unset SESSION_MANAGER

exec /etc/X11/xinit/xinitrc

가 작동하도록 하자.

6. 방화벽 설정
일반적으로 리눅스를 설치하면 방화벽이 설치되어 있다.
vncserver의 경우 5901 포트를 사용하기 때문에 이 포트만 열어 준다면
아무런 문제 없이 원격 접속이 가능하다.

시스템 -> 관리 -> 방화벽
을 실행 시키자.
사용자 삽입 이미지

위와 같은 화면을 볼 수 있다. 왼쪽 사이드 메뉴에서 두번째 그 외의 포트 를 선택, 오른쪽의 추가를 선택한다.
사용자 삽입 이미지

위와 같이 나오는데 사용자 정의 에 체크를 하면 직접 포트 번호를 입력 할 수 있게 된다.
5901 번 포트(vncserver는 기본적으로 5900번 대의 포트를 사용한다. 기본 포트 + 디스 플레이 번호를 포트 번호로 사용하므로 5901 번이 된다.)를 입력하고 확인을 누른 후 아래 그림과 같이 적용을 누르면 포트번호가 허용이 되도록 설정되어 진다.
사용자 삽입 이미지

7. vncserver를 띄운다.

띄우는 방법은 보통 2가지가 있다.

# vncserver :1

# service vncserver start


위에 방식은 1024x768 고정 사이즈로만 나온다.

아래 방식은 설정한 해상도로 나온다.



8. 다음과 같은 화면을 볼 수 있다.~!

vncviewer를 이용하여

IP주소:1 (1은 /etc/sysconfig/vncservers 에서 설정한 Display Number)


위의 화면은 모니터 + 노트북 으로 듀얼로 구성된 상태이다.

크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by gwlee

2008/09/27 22:29 2008/09/27 22:29
Response
0 Trackbacks , 0 Comments
RSS :
http://thegreatgoodplace.com/tt/study/rss/response/56

Trackback URL : http://thegreatgoodplace.com/tt/study/trackback/56

Leave a comment

SSH 포트 변경


/etc/ssh/sshd_config

Port [숫자]
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
앞의 #제거할 것!!

/etc/services
# 21 is registered to ftp, but also used by fsp
ftp             21/tcp
ftp             21/udp          fsp fspd
ssh             [숫자]/tcp                                # SSH Remote Login Protocol
ssh             [숫자]/udp                                # SSH Remote Login Protocol
telnet          23/tcp
telnet          23/udp

위의 작업을 마치면
/etc/rc.d/init.d/sshd restart
크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by gwlee

2008/08/31 18:09 2008/08/31 18:09
Response
0 Trackbacks , 0 Comments
RSS :
http://thegreatgoodplace.com/tt/study/rss/response/49

Trackback URL : http://thegreatgoodplace.com/tt/study/trackback/49

Leave a comment

리눅스에서 분할 압축

가끔씩 Cygwin을 써서 압축 할 때
용량 큰 파일 때문에 애매했을 때... ㅋ 그냥 임의로 폴더를 나눠서 묶어 줬는데..
이런 방법이 있을 줄이야.. ㅠ.ㅜ

분할 압축 할 때,

tar czvf - test/* | split -b 100m - test.tar.gz

tar cvf - test/* | split -b 100m - test.tar


cat test.tar.gz* | gzip -d - | tar xvf -

cat test.tar* | gzip -d - | tar xvf -


분할 압축 한것 해제 할 때,

상당히 유용하게 쓸 것 같아서 포스팅 해놈.. ㅋㅋㅋㅋ


출처: http://qaos.com/article.php?sid=2194
크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by gwlee

2008/08/25 02:37 2008/08/25 02:37
Response
0 Trackbacks , 0 Comments
RSS :
http://thegreatgoodplace.com/tt/study/rss/response/46

Trackback URL : http://thegreatgoodplace.com/tt/study/trackback/46

Leave a comment

xargs command

bash: /bin/mv: Argument list too long
이 에러 녀속에 대한 솔루션.. ㅠ.ㅜ 이제서야... ㅋ

find ./ -name "*" | xargs tar cvf tar.tar

xargs라는 녀석 하나면 만사 ok~!! 땡쓰~ ㅎㅎ

-써본결과... 사용할 줄 몰라서인지... 압축한 파일들의 갯수가 안맛았슴당.. ㅠ.ㅜ
  쳇... ㅡ.-a 고로 이거 이제 안쓸렵니다.. ㅎㅎ
크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by gwlee

2008/08/25 02:27 2008/08/25 02:27
Response
0 Trackbacks , 0 Comments
RSS :
http://thegreatgoodplace.com/tt/study/rss/response/38

Trackback URL : http://thegreatgoodplace.com/tt/study/trackback/38

Leave a comment

Mac에서 Web서버 도전기 (1)

Mac에서 web server 설치 및 구동

Apache2.2
Tomcat 6.x

Tomcat에서만 파일하나 만져주는 것으로 설치 끝!!
[#M_tomcat-users.xml 내용|닫기|
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
  <role rolename="tomcat"/>
  <role rolename="manager"/>
  <role rolename="admin"/>
  <user username="tomcat" password="XXXX" roles="tomcat"/>
  <user username="admin" password="XXXX" roles="admin,manager"/>
</tomcat-users>

_M#]
http://localhost:8080/manager/html 에 접속하기전에 먼저 위의 파일 내용을 입력해주소
재부팅하는 센스~ ㅎㅎ 모 이파이를 masage하기 전에 실행시켜도 tomcat만 재실행 해주고
하면 문제 없음.

TOMCAT_PATH/start.sh <서비스 시작
TOMCAT_PATH/shutdownsh < 서비스 중지
M$의 경우 bat을 실행

아... Mac OS X에는 Apache 1.3이 이미 깔려있는 상태..
지우기가 까다롭다고 하시네요.. 음... phpschool에 있는 글을 보고...
다시 설치해보고자 준비중입니다.. ㅋ ^-^

크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by gwlee

2008/08/25 02:17 2008/08/25 02:17
Response
0 Trackbacks , 0 Comments
RSS :
http://thegreatgoodplace.com/tt/study/rss/response/33

Trackback URL : http://thegreatgoodplace.com/tt/study/trackback/33

Leave a comment

Mac에서 Web서버 도전기 (2)

본 주인장은 그냥 XAMPP를 사용했답니다.
요녀석대로 따라가다가.. 중간에 configuration안돼서리..;;
uninstall하고.. ㅋ
-근데.. 그 이후로.. MS Office 2004 for Mac이 실행안된다는.. ㅠ.ㅜ


출처: phpschool

source 설치시 uninstall 방법
make clean
make distclean
이렇게 제거 가능 출처: 블루사랑

##curl 설치(Linux wget)
tar zxvf curl-7.14.0.tar.gz
cd curl-7.14.0
./configure --prefix=/usr
make
make install
cd ..


##expat 설치
curl -O http://nchc.dl.sourceforge.net/sourceforge/expat/expat-2.0.1.tar.gz
tar zxvf expat-2.0.1.tar.gz
cd expat-2.0.1
./configure --prefix=/usr -mandir=/usr/share/man
make
make install
cd ..


##zlib 설치
curl -O http://www.zlib.net/zlib-1.2.3.tar.gz
tar zxvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure --prefix=/usr --shared
make
make install
cd ..



##libpng설치
curl -O ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.2.24.tar.gz
tar zxvf libpng-1.0.27.tar.gz
cd libpng-1.0.27
cp scripts/makefile.darwin Makefile
vi Makefile
=> 변경내용 시작
# Where the zlib library and include files are located
ZLIBLIB=/usr/local/lib
ZLIBINC=/usr/local/include
#ZLIBLIB=../zlib
#ZLIBINC=../zlib
=>변경내용 완료

./configure
make
make install


##libjpeg 설치
curl -O ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz
ln -s `which glibtool` ./libtool
export MACOSX_DEPLOYMENT_TARGET=10.4
./configure --prefix=/usr --enable-shared
make
make install



##freetype설치
curl -O http://download.savannah.gnu.org/releases/freetype/freetype-2.3.5.tar.gz
tar zxvf freetype-2.3.5.tar.gz
cd freetype-2.3.5
vi include/freetype/config/ftoption.h
#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER => 주석 삭제

./configure
make
make install



##gd설치
curl -O http://www.libgd.org/releases/gd-2.0.35.tar.gz
tar zxvf gd-2.0.35.tar.gz
cd gd-2.0.35
./configure
make
make install
./gdtest test/gdtest.png
./gdtestft /Library/Fonts/Zapfino.dfont
open test/*.jpg
cd ..



##fastCGI설치
curl -O http://www.fastcgi.com/dist/fcgi-2.4.0.tar.gz
tar zxvf fcgi-2.4.0.tar.gz
cd fcgi-2.4.0
./configure --prefix=/usr/local
make && make install
cd ..



##pcre설치
curl -O ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.3.tar.gz
tar zxvf pcre-7.3.tar.gz
cd pcre-7.3
./configure --prefix=/usr/local
make && make install
cd ..



##lighttpd 설치
curl -O http://www.lighttpd.net/download/lighttpd-1.4.17.tar.gz
tar zxvf lighttpd-1.4.17.tar.gz
cd lighttpd-1.4.17
./configure --prefix=/usr/local --with-pcre=/usr/local
make && make install
cd ..



##mysql설치
tar zxvf mysql-5.0.45.tar.gz
unlink /usr/local/mysql
./configure --prefix=/usr/local/mysql
--with-unix-socket-path=/usr/local/mysql/run/mysql_socket
--with-mysqld-user=mysql --with-comment --localstatedir=/Volumes/extends/MYSQL/data
--with-charset=euckr
--with-extra-charsets=all
make
make install
chown -R mysql.mysql /usr/local/mysql/
chown -R mysql.mysql /Volumes/extends/MYSQL
mysql_install_db
ls -al /Volumes/extends/MYSQL/data/


*** mysql auto start 등록
cp -rf /usr/local/src/mysql-5.0.45/support-files/MacOSX/MySQLCOM /Library/StartupItems/MySQLCOM/
cp -rf /usr/local/src/mysql-5.0.45/support-files/MacOSX/StartupParameters.plist /Library/StartupItems/MySQLCOM/
cp -rf /usr/local/src/mysql-5.0.45/support-files /usr/local/mysql/
chown -R mysql.mysql /usr/local/mysql/
chmod +x /usr/local/mysql/support-files/mysql.server
/Library/StartupItems/MySQLCOM/MySQLCOM start ==> start/stop 확인
** mysql auto start 등록 확인(다른설정 부분 임의로 수정하지 마시오!!
vi /etc/hostconfig => MYSQLCOM=-YES-



##apache 설치
curl -O http://ftp.kaist.ac.kr/pub/Apache/httpd/httpd-2.2.4.tar.gz
tar zxvf httpd-2.2.4.tar.gz
cd httpd-2.2.4
./configure --prefix=/usr/local/apache2 --enable-rewrite--enable-proxy --enable-proxy-balancer --enable-proxy-http--enable-mods-shared=all
make
make install



##php 설치
tar zxvf php-5.2.4.tar.gz
cd php-5.2.4
./configure --prefix=/usr --mandir=/usr/share/man--infodir=/usr/share/info --sysconfdir=/etc --enable-cgi --enable-cli--enable-dbx --enable-exif --enable-ftp --enable-mbstring--enable-sockets --enable-wddx --enable-xslt --enable-yp--with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/etc--with-curl --with-expat --with-freetype --with-gd --with-iodbc--with-jpeg --with-kerberos --with-mysql=/usr/local/mysql--with-mysqli=/usr/local/mysql/bin/mysql_config --with-png --with-xml--with-xmlrpc --with-zlib --enable-sysvshm=yes --enable-sysvsem=yes--enable-debug=no --enable-track-vars=yes --enable-bcmath--enable-mbstr-enc-trans --enable-mbregex --with-socket --enable-pcntl--with-iconv --with-ttf --enable-gd-native-ttf --enable-gd-imgstrttf--enable-memory-limit --enable-calendar
make
make install
php -v

** apache auto start
## OSX에 기본적으로 apache 1.3이 인스톨 되어 있다. 그러나 지우기가 여간 까다로운게 아니다. 그러므로
## MYSQLCOM을 이용하여 새로운 서비스를 만들고 이를 auto start로 등록하자(HTTPCOM으로 함)^^
** HTTPCOM 생성
mkdir /Library/StartupItems/HTTPCOM
vi HTTPCOM
if [ -z $1 ] ; then
        echo "Usage: $0 [start|stop|restart] "
        exit 1
fi
# Source the common setup functions for startup scripts
test -r /etc/rc.common || exit 1
. /etc/rc.common

SCRIPT="/usr/local/apache/bin/apachectl"

StartService ()
{
        if [ "${HTTPCOM:=-NO-}" = "-YES-" ] ; then
                ConsoleMessage "Starting HTTPD"
                $SCRIPT start > /dev/null 2>&1
        fi
}

StopService ()
{
        ConsoleMessage "Stopping HTTPD"
        $SCRIPT stop > /dev/null 2>&1
}
RestartService ()
{
        ConsoleMessage "Restarting HTTPD"
        $SCRIPT restart > /dev/null 2>&1
}

if test -x $SCRIPT ; then
        RunService "$1"
else
        ConsoleMessage "Could not find HTTPD!"
fi
==> 내용 끝
chmod +x HTTPCOM

vi StartupParameters.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Description</key>
        <string>http-2.2.4</string>
        <key>OrderPreference</key>
        <string>None</string>
        <key>Provides</key>
        <array>
                <string>Apache</string>
        </array>
        <key>Uses</key>
        <array>
                <string>Network</string>
                <string>Resolver</string>
        </array>
        </dict>
</plist>
==> 내용 끝
## HTTPCOM등록
vi /etc/hostconfig
HTTPCOM=-YES- 끝에 추가
주의) WEBSERVER=-NO- 로 되어 있어야 한다. 안그럼 포트충돌 납니다 ㅎㅎㅎ

크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by gwlee

2008/08/25 02:15 2008/08/25 02:15
Response
0 Trackbacks , 0 Comments
RSS :
http://thegreatgoodplace.com/tt/study/rss/response/31

Trackback URL : http://thegreatgoodplace.com/tt/study/trackback/31

Leave a comment

Mac OsX에 PHP 설치

출처: php.undmedlibrary.org

Compiling for OS X Server

Mac OS X Server install
  1. Get the latest distributions of Apache and PHP.
  2. Untar them, and run the configure program on Apache like so.

    ./configure --exec-prefix=/usr \
    --localstatedir=/var \
    --mandir=/usr/share/man \
    --libexecdir=/System/Library/Apache/Modules \
    --iconsdir=/System/Library/Apache/Icons \
    --includedir=/System/Library/Frameworks/Apache.framework/Versions/1.3/Headers \
    --enable-shared=max \
    --enable-module=most \
    --target=apache

  3. If you want the compiler to do some optimization, you may also want to add this line:

    setenv OPTIM=-O2

  4. Next, go to the PHP 4 source directory and configure it.

    ./configure --prefix=/usr \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --mandir=/usr/share/man \
    --with-xml \
    --with-apache=/src/apache_1.3.12

    If you have any other additions (MySQL, GD, etc.), be sure to add them here. For the --with-apache string, put in the path to your apache source directory, for example /src/apache_1.3.12.
  5. Type make and make install. This will add a directory to your Apache source directory under src/modules/php4.
  6. Now, reconfigure Apache to build in PHP 4.

    ./configure --exec-prefix=/usr \
    --localstatedir=/var \
    --mandir=/usr/share/man \
    --libexecdir=/System/Library/Apache/Modules \
    --iconsdir=/System/Library/Apache/Icons \
    --includedir=/System/Library/Frameworks/Apache.framework/Versions/1.3/Headers \
    --enable-shared=max \
    --enable-module=most \
    --target=apache \
    --activate-module=src/modules/php4/libphp4.a

    You may get a message telling you that libmodphp4.a is out of date. If so, go to the src/modules/php4 directory inside your Apache source directory and run this command: ranlib libmodphp4.a. Then go back to the root of the Apache source directory and run the above configure command again. That'll bring the link table up to date. Run make and make install again.
  7. Copy and rename the php.ini-dist file to your bin directory from your PHP 4 source directory: cp php.ini-dist /usr/local/bin/php.ini or (if your don't have a local directory) cp php.ini-dist /usr/bin/php.ini.

크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by gwlee

2008/08/25 02:12 2008/08/25 02:12
Response
0 Trackbacks , 0 Comments
RSS :
http://thegreatgoodplace.com/tt/study/rss/response/28

Trackback URL : http://thegreatgoodplace.com/tt/study/trackback/28

Leave a comment