Cygwin

Get that Linux feeling - on Windows!

This is the home of the Cygwin project



Cygwin is:

  • a collection of tools which provide a Linux look and feel environment for Windows.

  • a DLL (cygwin1.dll) which acts as a Linux API layer providing substantial Linux API functionality.




http://www.cygwin.com/


에서 설치 파일을 다운로드 한 후 ftp mirro는 ftp.daum.net을 목록에서 선택 하면 된다.



편의상 설치파일은 첨부 합니다.



CYGWIN setup.exe






http://www.vmware.com에 가입 후 vmware player를 다운로드 합니다.

다운로드 받은 경로로 이동하여 아래의 예처럼 입력하면 인스톨러가 실행됨.

bash ./VMware-Player-3.1.4-385536.x86_64.bundle

출처 : http://funnymins.tistory.com/133

1. 파일 링크의 개념

i-node는 파일의 생성과 동시에 임의로 부여되며,  번호확인은 ls -i 로 확인할 수 있다. 또한  리눅스에서는 모든 디바이스나 디렉토리를 파일개념으로 인식하기 때문에 전부 inode를 부여받는다.  만약 inode가 같은 파일이 있다면 파일 이름이 다르더라도 이 파일은 같은 파일이 된다.

[하드 링크]

하드 링크는 일반 파일을 링크할 때 주로 이용하며옵션없이 ln 명령으로 링크시키면 된다. 생성된 링크 파일은 원래 파일의 inode(index node라 하며 파일에 대한 정보가 저장된 레코드)를 그대로 참조하기에 원 파일이 지워져도 아무런 문제가 되지 않는다.
[심볼릭 링크 - ln -s 명령으로 링크]

심볼릭 링크는 주로 디렉토리를 링크할 때 사용한다원 파일이 삭제되면 실제 데이터 블럭을 참조하던 inode도 삭제되어심볼릭 링크된 파일은 의미가 없어진다

2. ln 명령어
[option]
   -s : 심볼릭링크(소프트링크)를 생성한다. 만약 이 옵션이 없으면 하드링크가 생성된다.
   -v : 링크를 만드는 정보를 자세히 출력한다. 

[예제]
# ln -s /directory/* linkdir : /directory/디렉토리 안의 모든 파일의 링크 파일을 linkdir 디렉토리에 생성
# ln -s ./sourcefile ./linkfile : 링크생성
# ls -ld linkfile : 링크확인
# unlink(또는 rm) linkfile : 링크해제
/etc/xinetd.d 라는 디렉토리를 자주간다면 현재 나의 홈디렉토리에 링크해보자.
ln -s /etc/xinetd.d xx => /etc/xinetd.d라는 디렉토리를 현재 디렉토리의 xx라는 것으로 링크한다. ls xx 하면 ls /etc/xinetd.d의 내용과 동일한 내용이 나타나고 또한 cd xx하면 그 디렉토리안으로 들어간 것과 같다.


Usage: ln [OPTION]... [-T] TARGET LINK_NAME   (1st form)
  or:  ln [OPTION]... TARGET                  (2nd form)
  or:  ln [OPTION]... TARGET... DIRECTORY     (3rd form)
  or:  ln [OPTION]... -t DIRECTORY TARGET...  (4th form)
In the 1st form, create a link to TARGET with the name LINK_NAME.
In the 2nd form, create a link to TARGET in the current directory.
In the 3rd and 4th forms, create links to each TARGET in DIRECTORY.
Create hard links by default, symbolic links with --symbolic.
When creating hard links, each TARGET must exist.

긴 옵션에서 꼭 필요한 인수는 짧은 옵션에도 꼭 필요합니다.
      --backup[=CONTROL]      make a backup of each existing destination file
  -b                          like --backup but does not accept an argument
  -d, -F, --directory         allow the superuser to attempt to hard link
                                directories (note: will probably fail due to
                                system restrictions, even for the superuser)
  -f, --force                 remove existing destination files
  -n, --no-dereference        treat destination that is a symlink to a
                                directory as if it were a normal file
  -i, --interactive           prompt whether to remove destinations
  -s, --symbolic              make symbolic links instead of hard links
  -S, --suffix=SUFFIX         override the usual backup suffix
  -t, --target-directory=DIRECTORY  specify the DIRECTORY in which to create
                                the links
  -T, --no-target-directory   treat LINK_NAME as a normal file
  -v, --verbose               print name of each file before linking
      --help     이 도움말을 표시하고 끝냅니다
      --version  버전 정보를 출력하고 끝냅니다

The backup suffix is `~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.
The version control method may be selected via the --backup option or through
the VERSION_CONTROL environment variable.  Here are the values:

  none, off       never make backups (even if --backup is given)
  numbered, t     make numbered backups
  existing, nil   numbered if numbered backups exist, simple otherwise
  simple, never   always make simple backups

[ 개념 ]
리눅스에서 링크의 종류로는 질문하신 심볼릭링크와 하드링크가 있습니다.

1. 심볼릭링크는 어떤 파일을 가리키고 있는 파일을 뜻 합니다.
test.txt 라는 파일이 있을 때...

ln -s test.txt hello.txt

위와 같은 명령을 이용해서 hello.txt 라는 파일을 만들게 됩니다. 하지만 hello.txt 라는 파일은 이름만 존재 할 뿐 내용은 아무것도 없다고 생각하시면 됩니다. 이 파일은 단지 test.txt 파일을 가리키고 있을 뿐이고 hello.txt 파일을 호출하게 되면 test.txt 파일로 연결을 해주는 역활을 합니다.
이런 심볼릭 링크의 경우 원본(test.txt) 파일을 삭제 하게 되면 hello.txt 파일은 무용지물이 되고 만답니다.

2. 하드링크는 하드에 저장되어 있는 어떤 자료에 이름을 여러개 부여한다고 생각하시면 됩니다. 간단한 예로...위와 같이 test.txt 파일을 저장했습니다. 그리고...

ln test.txt hello.txt

위와 같이 -s 옵션을 빼고 링크명령을 내리게 되면 hello.txt 파일이 생성이 됩니다.
하지만 이경우는 위의 심볼릭 링크와 조금 다릅니다. 위에서는 hello.txt 파일이 test.txt 파일을 가리키고 있었지만 이번에는 hello.txt 라는 파일명은 test.txt 의 또 다른 이름이 되는 것입니다. 이런 경우 원본인 test.txt 파일을 지우더라도 hello.txt 파일은 내용을 간직하고 있답니다.

위의 내용을 확실히 이해하시려면 하드에 파일이 저장되는 방식을 조금 공부하시면 많은 도움이 되실 겁니다. 저장방식을 간략히 설명드리면....

어떤 파일 test.txt 를 저장하게 되면...하드드라이브의 어떤 부분에 test.txt 내용을 기록하게 됩니다. 그리고 그 위치정보를 헤더에 저장을 하는 것이구요. 즉 test.txt 라는 이름은 단지 헤더에 있는 위치정보만을 가지고 있게 됩니다. 우리가 test.txt 파일을 콜하게 되면 이 파일이 가지고 있는 위치정보를 이용해서 하드에서 내용을 찾아 사용하게 되는 것입니다.

이제 위에 링크를 생각해 보세요. 하드링크는 이 위치정보를 가지고 있는 이름을 여러개 생성한다고 생각하면 됩니다. 그렇기 때문에 어떤 하나를 지우더라도 하드에서 내용을 찾아 갈수 있는 것입니다.
하지만 심볼릭링크는 위치정보를 가지고 있는 파일명을 또 한번 다른 이름으로 연결을 시키는 것입니다. 그렇기 때문에 원본 파일을 삭제 하게 되면 심볼릭링크 파일들은 위치정보가 없기 때문에 무용지물이 된다는 것입니다.

음 위에 간단히 설명을 하긴 했는데 도움이 되었는지 모르겠네요.
그럼 즐거운 하루되세요.  

출처 : http://www.jopenbusiness.com/mediawiki/index.php/PhpMyAdmin


Linux용 설치 가이드

설치전 사전 준비 사항

phpMyAdmin 설치

Ubuntu Server에서 phpMyAdmin을 설치 한다.

  • phpmyadmin 3.1.2 설치
apt-get install phpmyadmin
sudo /etc/init.d/apache2 restart
  • vi /etc/apache2/apache2.conf
  • 맨 마지막 라인에 아래 사항을 추가
  • Apache에 mod_rewrite가 활성화되어 있을 경우 추가할 필요가 없음
#--- Enable PHPMyAdmin
Include /etc/phpmyadmin/apache.conf
  • 설치 정보
  • 설치 폴더 : /usr/share/phpmyadmin/
  • 환경 폴더 : /etc/phpmyadmin/
  • 작업 폴더 : /var/lib/phpmyadmin/
  • 서비스 폴더 : /var/www/phpmyadmin/

CentOS용 설치 가이드

설치전 사전 준비 사항

  • MySQL 설치
  • Apache HTTP Server 설치
  • PHP 설치

phpMyAdmin 설치

  • PHP Extensions을 설치 한다.
yum -y install php-mbstring
yum -y install php-mcrypt


  • /var/www/html/phpmyadmin에 압축 파일에 있는 파일을 복사한다.


  • /var/www/html/phpmyadmin/config.sample.inc.php 파일을 config.inc.php로 복사한후 아래와 같이 수정 한다.
//--- 쿠키를 위한 hash로 아무 문자나 채워준다.
$cfg['blowfish_secret'] = 'lfkjdiikdf78fejlkre893864';


sudu apt-get install php5-gd

 아파치 재시작
출처 : http://www.sysbug.com/renew/bbs/board/view.php?brdCode=board_tech&no=12

작성자 : 김용복 (ruo91@naver.com) - 2009-09-09 PM 8:11 ( 최근 수정 2009-10-24 PM 9:20 )
- 원제목 : LAMP 설치 (Linux Apache, MySQL, PHP 설치 )
- 환 경 : Linux  ( Tested CentOS-5.3, Ubuntu-8.04-LTS )
- 버   전 : Apache-2.2.14, MySQL-5.1.40, PHP-5.2.11

리눅스에서 Apache, MySQL, PHP 설치 방법입니다.
본 글은 소스 설치 기준으로 하며 Build 디렉토리는 "/usr/local/src/" 으로 하고
기본 Install 디렉토리는 "/usr/local/" 로 합니다.

0. Build에 필요한 패키지 설치
레드헷 계열 ( RedHat, CentOS, Fedora ) 
[root@ruo91 ~]# yum install -y gcc gcc-c++ ncurses-devel libtool

데비안 계열 ( Debian, Ubuntu )
[root@ruo91 ~]# sudo apt-get install gcc build-essential libncurses5-dev libtool

1. LAMP에 필요한 라이브러리 설치

- zlib 설치 ( 압축 관련 라이브러리 )
http://www.zlib.net )
[root@ruo91 ~]# mkdir /usr/local/src
[root@ruo91 ~]# cd /usr/local/src
[root@ruo91 ~]# wget http://www.zlib.net/zlib-1.2.3.tar.gz
[root@ruo91 ~]# tar xzvf zlib-1.2.3.tar.gz
[root@ruo91 ~]# cd zlib-1.2.3
[root@ruo91 ~]# ./configure
[root@ruo91 ~]# make && make install && cd .. && rm -rf zlib*

- libpng 설치 ( png 포멧 지원 라이브러리 )
ftp://ftp.simplesystems.org/pub/libpng/png/src )
[root@ruo91 ~]# wget ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.2.40.tar.gz
[root@ruo91 ~]# tar xzvf libpng-1.2.40.tar.gz
[root@ruo91 ~]# cd libpng-1.2.40
[root@ruo91 ~]# make -f scripts/makefile.linux ZLIBLIB=../../lib ZLIBINC=../../include
[root@ruo91 ~]# make -f scripts/makefile.linux install && cd .. && rm -rf libpng*

- jpeg 설치 ( jpeg 포멧 지원 라이브러리 )
http://www.ijg.org/files )
[root@ruo91 ~]# wget http://www.ijg.org/files/jpegsrc.v7.tar.gz
[root@ruo91 ~]# tar xzvf jpegsrc.v7.tar.gz
[root@ruo91 ~]# cd jpeg-7
[root@ruo91 ~]# ./configure
[root@ruo91 ~]# make && make install && cd .. && rm -rf jpeg*

- freetype2 설치 ( 글자 그릴때 사용되는 라이브러리 )
http://ftp.twaren.net/Unix/NonGNU/freetype )
[root@ruo91 ~]# wget http://ftp.twaren.net/Unix/NonGNU/freetype/freetype-2.3.9.tar.gz
[root@ruo91 ~]# tar xzvf freetype-2.3.9.tar.gz
[root@ruo91 ~]# cd freetype-2.3.9/builds/unix
[root@ruo91 ~]# ./configure
[root@ruo91 ~]# cd ../../ && make && make install && cd .. && rm -rf freetype*

- libiconv 설치 ( 문자 변환 지원 라이브러리 )
http://ftp.gnu.org/pub/gnu/libiconv )
[root@ruo91 ~]# wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.tar.gz
[root@ruo91 ~]# tar xzvf libiconv-1.13.tar.gz
[root@ruo91 ~]# cd libiconv-1.13
[root@ruo91 ~]# ./configure
[root@ruo91 ~]# make && make install && cd .. && rm -rf libiconv*

- libxml2 설치 ( XML 지원 라이브러리 )
ftp://xmlsoft.org/libxml2 )
[root@ruo91 ~]# wget ftp://xmlsoft.org/libxml2/libxml2-2.7.3.tar.gz
[root@ruo91 ~]# tar xzvf libxml2-2.7.3.tar.gz
[root@ruo91 ~]# cd libxml2-2.7.3
[root@ruo91 ~]# ./configure 
--with-html --with-http --with-pattern --with-push --with-reader 
--with-regexps --with-threads --with-writer  --with-modules 
--with-zlib=/usr/local/include --with-iconv=/usr/local/include
[root@ruo91 ~]# make && make install && cd .. && rm -rf libxml*

- expat 설치 ( fontconfig 의존성 라이브러리 )
http://sourceforge.net/projects/expat )
[root@ruo91 ~]# wget http://downloads.sourceforge.net/project/expat/expat/2.0.1/expat-2.0.1.tar.gz
[root@ruo91 ~]# tar xzvf expat-2.0.1.tar.gz
[root@ruo91 ~]# cd expat-2.0.1
[root@ruo91 ~]# ./configure
[root@ruo91 ~]# make && make install && cd .. && rm -rf expat*

- fontconfig 설치 ( XML 폰트 패턴중 알맞는 폰트를 사용자에게 보여주는.. )
http://fontconfig.org/release )
[root@ruo91 ~]# wget http://fontconfig.org/release/fontconfig-2.7.3.tar.gz
[root@ruo91 ~]# tar xzvf fontconfig-2.7.3.tar.gz
[root@ruo91 ~]# cd fontconfig-2.7.3
[root@ruo91 ~]# ./configure --with-expat=/usr/local/include
[root@ruo91 ~]# make && make install && cd .. && rm -rf fontconfig*

- gd 설치 ( 그래픽 관련 라이브러리 )
http://www.libgd.org/Downloads )
[root@ruo91 ~]# wget http://www.libgd.org/releases/gd-2.0.35.tar.gz
[root@ruo91 ~]# tar xzvf gd-2.0.35.tar.gz
[root@ruo91 ~]# cd gd-2.0.35
[root@ruo91 ~]# automake && autoconf
[root@ruo91 ~]# ./configure 
--with-png=/usr/local/include 
--with-jpeg=/usr/local/include 
--with-freetype=/usr/local/include 
--with-fontconfig=/usr/local/include 
--with-libiconv-prefix=/usr/local/include
[root@ruo91 ~]# make && make install && cd .. && rm -rf gd*

- Bz2 설치 ( Bzip2 압축 관련 라이브러리 )
http://www.bzip.org/downloads.html )
[root@ruo91 ~]# wget http://www.bzip.org/1.0.5/bzip2-1.0.5.tar.gz
[root@ruo91 ~]# tar xzvf bzip2-1.0.5.tar.gz
[root@ruo91 ~]# cd bzip2-1.0.5
[root@ruo91 ~]# make && make install && cd .. && rm -rf bzip*

2. Apache 설치 http://mirror.apache-kr.org/httpd )
[root@ruo91 ~]# cd /usr/local/src
[root@ruo91 ~]# wget http://mirror.apache-kr.org/httpd/httpd-2.2.14.tar.gz
[root@ruo91 ~]# tar xzvf httpd-2.2.14.tar.gz
[root@ruo91 ~]# cd httpd-2.2.14
[root@ruo91 ~]# ./configure --prefix=/usr/local/apache2 
--enable-mods-shared=most --enable-so --with-mpm=worker --with-z=/usr/local/include
[root@ruo91 ~]# make && make install && cd ..

3. MySQL 설치 ( ftp://ftp.iij.ad.jp/pub/db/mysql/Downloads/ )
[root@ruo91 ~]# wget ftp://ftp.iij.ad.jp/pub/db/mysql/Downloads/MySQL-5.1/mysql-5.1.40.tar.gz
[root@ruo91 ~]# tar xzvf mysql-5.1.40.tar.gz
[root@ruo91 ~]# cd mysql-5.1.40
[root@ruo91 ~]# ./configure --prefix=/usr/local/mysql 
--with-charset=euckr --with-tcp-port=3306 --with-mysqld-user=mysql
[root@ruo91 ~]# make && make install && cd ..

4. PHP 설치 ( http://kr.php.net/downloads.php )
[root@ruo91 ~]# wget http://kr.php.net/distributions/php-5.2.11.tar.gz
[root@ruo91 ~]# tar xzvf php-5.2.11.tar.gz
[root@ruo91 ~]# cd php-5.2.11
[root@ruo91 ~]# cat > install.sh
#!/bin/sh
./configure --prefix=/usr/local/php5 
--with-gd=/usr/local 
--with-zlib-dir=/usr/local/include 
--with-bz2=/usr/local/include 
--with-png-dir=/usr/local/include 
--with-jpeg-dir=/usr/local/include 
--with-iconv-dir=/use/local/include 
--with-libxml-dir=/usr/local/include 
--with-freetype-dir=/usr/local/include 
--with-libexpat-dir=/usr/local/include 
--with-apxs2=/usr/local/apache2/bin/apxs 
--with-exec-dir=/usr/local/apache2/bin 
--with-config-file-path=/usr/local/apache2/conf 
--with-mysql=/usr/local/mysql 
--enable-zip --enable-sockets --enable-gd-native-ttf 
--enable-zend-multibyte
[root@ruo91 ~]# chmod +x install.sh
[root@ruo91 ~]# ./install.sh
[root@ruo91 ~]# make && make install
[root@ruo91 ~]# cp php.ini-dist /usr/local/apache2/conf/php.ini
[root@ruo91 ~]# cd .. && rm -rf *.tar.gz

5. 설정

- MySQL 설정

MySQL 를 실행 할 계정 생성
[root@ruo91 ~]# groupadd mysql
[root@ruo91 ~]# useradd -g mysql -s /bin/false mysql
[root@ruo91 ~]# mkdir /usr/local/mysql/var
[root@ruo91 ~]# chown -R mysql.mysql /usr/local/mysql/var

MySQL DB 설치
[root@ruo91 ~]# /usr/local/mysql/bin/mysql_install_db --user=mysql

MySQL 서비스 관련 심볼링크 생성
[root@ruo91 ~]# ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql
[root@ruo91 ~]# ln -s /usr/local/mysql/bin/mysqladmin /usr/bin/mysqladmin
[root@ruo91 ~]# ln -s /usr/local/mysql/bin/mysqldump /usr/bin/mysqldump
[root@ruo91 ~]# ln -s /usr/local/mysql/bin/mysqlshow /usr/bin/mysqlshow

MySQL 설정 파일 복사
[root@ruo91 ~]# cd /usr/local/mysql/share/mysql
[root@ruo91 ~]# cp -p my-medium.cnf /etc/my.cnf

MySQL 실행 스크립트 복사
[root@ruo91 ~]# cd /usr/local/mysql/share/mysql
[root@ruo91 ~]# cp -p mysql.server /etc/rc.d/init.d/mysqld

MySQL 데몬 시작
[root@ruo91 ~]# /etc/rc.d/init.d/mysqld start
Starting MySQL..[  OK  ]

MySQL 루트 비밀번호 설정
[root@ruo91 ~]# mysqladmin -u root password '비밀번호'


MySQL 사용자 계정 추가
[root@ruo91 ~]# mysql -u root -p
mysql> 
GRANT ALL ON blog.* TO '사용자ID'@'localhost' IDENTIFIED BY '비밀번호' WITH GRANT OPTION;

MySQL 데이터베이스 생성
mysql> CREATE DATABASE blog;
mysql> flush privileges;
mysql> exit

- Apache 설정
[root@ruo91 ~]# vi /usr/local/apache2/conf/httpd.conf

httpd.conf 내용중 필요한 것들을 수정/추가
#
# 서버 디렉토리
ServerRoot "/usr/local/apache2"
#
# 서버 관리자의 이메일
ServerAdmin ruo91@naver.com
#
# 서버 이름을 지정
ServerName www.yongbok.net:80
#
# 웹서버로 사용할 포트
Listen 80
#
# 웹서버를 apache 라는 사용자와 그룹으로 실행
User apache
Group apache
#
# 기본 인덱스 파일 지정
<IfModule dir_module>
    DirectoryIndex index.htm index.html index.php
</IfModule>
#
# PHP 를 사용하기 위한 옵션 추가
<IfModule mod_php3.c>
 AddType application/x-httpd-php3 .php3 .htm .html
 AddType application/x-httpd-php3-source .php3s
</IfModule>
<IfModule mod_php4.c>
 AddType application/x-httpd-php .php .htm .html
 AddType application/x-httpd-php-source .phps
</IfModule>
<IfModule mod_php5.c>
 AddType application/x-httpd-php .php .htm .html
 AddType application/x-httpd-php-source .phps
</IfModule>

아파치 시작
[root@ruo91 ~]# /usr/local/apache2/bin/apachectl start

아파치 데몬 확인
[root@ruo91 ~]# ps -aux | grep httpd
root     16315  0.0  0.8  20584  8652 ?        Ss   04:19   0:00 /usr/local/apache2/bin/httpd -k start
apache   16316  0.0  0.7  20584  7956 ?        S    04:19   0:00 /usr/local/apache2/bin/httpd -k start
apache   16317  0.0  0.7  20584  7956 ?        S    04:19   0:00 /usr/local/apache2/bin/httpd -k start
apache   16318  0.0  0.7  20584  7956 ?        S    04:19   0:00 /usr/local/apache2/bin/httpd -k start
apache   16319  0.0  0.7  20584  7956 ?        S    04:19   0:00 /usr/local/apache2/bin/httpd -k start
apache   16320  0.0  0.7  20584  7956 ?        S    04:19   0:00 /usr/local/apache2/bin/httpd -k start

PHP 작동 여부 확인
[root@ruo91 ~]# echo '<?php phpinfo(); ?>' > /usr/local/apache2/htdocs/phpinfo.php
출처 : http://www.jopenbusiness.com/mediawiki/index.php/OpenSSH#Ubuntu.EC.9A.A9_.EC.84.A4.EC.B9.98_.EA.B0.80.EC.9D.B4.EB.93.9C

 

Ubuntu Server 8.10에서 OpenSSH를 사용한다.

  • OpenSSH 설치
  • sudo apt-get install ssh
  • vi /etc/ssh/sshd_config에서 보안 설정을 한다.
  • 보안상 22번 접속 Port를 다른 Port로 변경 : Port 22
  • 방화벽을 사용할 경우, 방화벽 설치 이후 관련 port를 열어 주어야 한다.
  • ufw allow 22/tcp
  • 설치 정보
  • 설치 폴더 :
  • 환경 폴더 : /etc/ssh/
  • 기동 종료 : /etc/init.d/ssh restart, start, stop
  • 서비스 확인 : ps -ef | grep ssh
  • 로그 정보 :
  • 윈도우용 다중 접속 프로그램인 mRemote 또는 putty로 접속 하세요.
  • "ifconfig -a" 명령을 사용하면 Ubuntu Server의 IP 주소를 확인할 수 있다.
  • putty로 접속시 한글을 정상적으로 사용하려면 "창" -> "변환" 메뉴에서 문자셋을 UTF-8로 지정한다.
  • 참고 문헌 : OpenSSH, Ubuntu Server를 보안 환경에서 접속 (SSH2 Protocol 사용)

+ Recent posts