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)
##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
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 ..
##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 }
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.
Type make and make install. This will add a directory to your Apache source directory under src/modules/php4.
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.
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.