서버 설정 · 5 min read · Sep 21, 2025

완벽한 서버 - OpenSUSE 11.3 x86_64 [ISPConfig 2] - 페이지 5

11 Apache/PHP5/Ruby/Python/WebDAV

이제 PHP5와 함께 Apache를 설치합니다:

yast2 -i apache2 apache2-devel apache2-mod_perl apache2-mod_php5 apache2-prefork perl-HTML-Parser perl-HTML-Tagset perl-Tie-IxHash perl-URI perl-libwww-perl php5 php5-devel zlib zlib-devel

그런 다음 몇 가지 PHP5 모듈을 설치합니다:

yast2 -i php5-bcmath php5-bz2 php5-calendar php5-ctype php5-curl php5-dom php5-ftp php5-gd php5-gettext php5-gmp php5-iconv php5-imap php5-ldap php5-mbstring php5-mcrypt php5-mysql php5-odbc php5-openssl php5-pcntl php5-pgsql php5-posix php5-shmop php5-snmp php5-soap php5-sockets php5-sqlite php5-sysvsem php5-tokenizer php5-wddx php5-xmlrpc php5-xsl php5-zlib php5-exif php5-fastcgi php5-pear php5-sysvmsg php5-sysvshm ImageMagick curl

다음으로 /etc/apache2/httpd.conf를 편집합니다:

vi /etc/apache2/httpd.conf

그리고 DirectoryIndex를 다음으로 변경합니다:

| [...] DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php5 index.php4 index.php3 index.pl index.html.var index.aspx default.aspx [...] |

Apache 모듈을 재작성할 수 있도록 활성화합니다:

a2enmod rewrite 

/etc/sysconfig/apache2를 편집하고 APACHE_SERVER_FLAGS 줄에 SSL을 추가합니다:

vi /etc/sysconfig/apache2

| [...] APACHE_SERVER_FLAGS="SSL" [...] |

이제 시스템을 구성하여 부팅 시 Apache를 시작합니다:

chkconfig --add apache2

그런 다음 실행합니다:

SuSEconfig
/etc/init.d/apache2 start

11.1 PHP 및 Perl 전역 비활성화

(이 서버에 ISPConfig를 설치할 계획이 없다면 이 섹션을 건너뛰십시오!)

ISPConfig에서는 웹사이트별로 PHP 및 Perl을 구성할 수 있습니다. 즉, 어떤 웹사이트가 PHP 및 Perl 스크립트를 실행할 수 있고 어떤 웹사이트가 실행할 수 없는지를 지정할 수 있습니다. PHP와 Perl이 전역적으로 비활성화되어야만 이 기능이 작동할 수 있습니다. 그렇지 않으면 모든 웹사이트가 ISPConfig에서 지정한 것과 관계없이 PHP/Perl 스크립트를 실행할 수 있습니다.

PHP와 Perl을 전역적으로 비활성화하려면 /etc/mime.types를 편집하고 application/x-perl 및 application/x-php 줄을 주석 처리합니다:

vi /etc/mime.types

| [...] #application/x-perl pl pm al perl #application/x-php php php3 php4 [...] |

그런 다음 /etc/apache2/conf.d/php5.conf를 편집하고 모든 AddHandler 줄을 주석 처리합니다:

vi /etc/apache2/conf.d/php5.conf

| #AddHandler application/x-httpd-php .php4 #AddHandler application/x-httpd-php .php5 #AddHandler application/x-httpd-php .php #AddHandler application/x-httpd-php-source .php4s #AddHandler application/x-httpd-php-source .php5s #AddHandler application/x-httpd-php-source .phps DirectoryIndex index.php4 DirectoryIndex index.php5 DirectoryIndex index.php |

그 후 Apache를 재시작합니다:

/etc/init.d/apache2 restart

11.2 mod_ruby

OpenSUSE 11.3에는 mod_ruby 패키지가 없으므로 수동으로 컴파일해야 합니다. 먼저 필수 패키지를 설치합니다:

yast2 -i apache2-devel ruby ruby-devel

그 후 mod_ruby를 다음과 같이 빌드합니다:

cd /tmp
wget http://modruby.net/archive/mod_ruby-1.3.0.tar.gz
tar zxvf mod_ruby-1.3.0.tar.gz
cd mod_ruby-1.3.0/
./configure.rb –with-apr-includes=/usr/include/apr-1
make
make install

mod_ruby를 활성화하려면 다음을 실행합니다…

a2enmod ruby 

… 그리고 Apache를 재시작합니다:

/etc/init.d/apache2 restart

11.3 mod_python

mod_python을 설치하려면 다음을 실행합니다:

yast2 -i apache2-mod_python

mod_python을 활성화하려면 다음을 실행합니다…

a2enmod python 

… 그리고 Apache를 재시작합니다:

/etc/init.d/apache2 restart

11.4 WebDAV

WebDAV 모듈을 활성화합니다…

a2enmod dav
a2enmod dav_fs
a2enmod dav_lock

… 그리고 Apache를 재시작합니다:

/etc/init.d/apache2 restart

12 Proftpd

vsftpd 대신 ProFTPd를 사용하고 싶습니다. 이는 SUSE의 기본 FTP 서버이며, 제가 이 서버에 설치할 제어판 소프트웨어(ISPConfig)가 OpenSUSE 11.3에서 ProFTPd와 더 잘 작동하기 때문입니다. ProFTPd에 대한 OpenSUSE 패키지가 없기 때문에 수동으로 컴파일해야 합니다.

먼저 몇 가지 필수 패키지를 설치합니다:

yast2 -i libcap libcap-devel

그런 다음 ProFTPd를 다음과 같이 빌드합니다:

cd /tmp/
wget –passive-ftp ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.3a.tar.gz
tar xvfz proftpd-1.3.3a.tar.gz
cd proftpd-1.3.3a/
./configure –sysconfdir=/etc
make
make install
cd ..
rm -fr proftpd-1.3.3a*

이제 /etc/init.d/proftpd 파일을 생성합니다:

vi /etc/init.d/proftpd

| #! /bin/sh # Copyright (c) 2000-2001 SuSE GmbH Nuernberg, Germany. # All rights reserved. # # Original author: Marius Tomaschewski <[email protected]> # # Slightly modified in 2003 for use with SuSE Linux 8.1, # by http://www.learnlinux.co.uk/ # # Slightly modified in 2005 for use with SuSE Linux 9.2, # by Falko Timme # # /etc/init.d/proftpd # ### BEGIN INIT INFO # Provides: proftpd # Required-Start: $network $remote_fs $syslog $named # Required-Stop: # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Description: Starts ProFTPD server ### END INIT INFO # Determine the base and follow a runlevel link name. base=${0##*/} link=${base#*[SK][0-9][0-9]} # Force execution if not called by a runlevel directory. test $link = $base && START_PROFTPD=yes # Modified by learnlinux.co.uk test "$START_PROFTPD" = yes || exit 0 # Modified by learnlinux.co.uk # Return values acc. to LSB for all commands but # status (see below): # # 0 - success # 1 - generic or unspecified error # 2 - invalid or excess argument(s) # 3 - unimplemented feature (e.g. "reload") # 4 - insufficient privilege # 5 - program is not installed # 6 - program is not configured # 7 - program is not running proftpd_cfg="/etc/proftpd.conf" proftpd_bin="/usr/local/sbin/proftpd" proftpd_pid="/usr/local/var/proftpd.pid" [ -r $proftpd_cfg ] || exit 6 [ -x $proftpd_bin ] || exit 5 # Source status functions . /etc/rc.status # First reset status of this service rc_reset case "$1" in start) echo -n "Starting ProFTPD Server: " test -f /etc/shutmsg && rm -f /etc/shutmsg /sbin/startproc $proftpd_bin rc_status -v ;; stop) echo -n "Shutting down ProFTPD Server: " test -x /usr/local/sbin/ftpshut && /usr/local/sbin/ftpshut now && sleep 1 /sbin/killproc -TERM $proftpd_bin test -f /etc/shutmsg && rm -f /etc/shutmsg rc_status -v ;; restart) ## If first returns OK call the second, if first or ## second command fails, set echo return value. $0 stop $0 start rc_status ;; try-restart) ## Stop the service and if this succeeds (i.e. the ## service was running before), start it again. ## Note: not (yet) part of LSB (as of 0.7.5) $0 status >/dev/null && $0 restart rc_status ;; reload|force-reload) ## Exclusive possibility: Some services must be stopped ## and started to force a new load of the configuration. echo -n "Reload ProFTPD Server: " /sbin/killproc -HUP $proftpd_bin rc_status -v ;; status) # Status has a slightly different for the status command: # 0 - service running # 1 - service dead, but /var/run/ pid file exists # 2 - service dead, but /var/lock/ lock file exists # 3 - service not running echo -n "Checking for ProFTPD Server: " checkproc $proftpd_bin rc_status -v ;; probe) ## Optional: Probe for the necessity of a reload, ## give out the argument which is required for a reload. [ $proftpd_cfg -nt $proftpd_pid ] && echo reload ;; *) echo "Usage: $0 {start|stop|status|restart|reload|try-restart|probe}" exit 1 ;; esac # Set an exit status. rc_exit |

그런 다음 실행합니다:

chmod 755 /etc/init.d/proftpd
chkconfig –add proftpd

ProFTPd를 시작합니다:

/etc/init.d/proftpd start

다음과 같은 오류가 발생하면…

ProFTPD 서버 시작: - 치명적: UseIPv6: UseIPv6 지시문을 사용하려면 /etc/proftpd.conf의 14번째 줄에서 IPv6 지원(–enable-ipv6)이 필요합니다.
startproc: /usr/local/sbin/proftpd의 부모의 종료 상태: 1

… /etc/proftpd.conf를 열고 UseIPv6 줄을 주석 처리하거나 제거합니다:

vi /etc/proftpd.conf 

| [...] # 기본적으로 IPv6 지원을 사용하지 않습니다. #UseIPv6 off [...] |

보안상의 이유로 /etc/proftpd.conf에 다음 줄을 추가할 수 있습니다:

vi /etc/proftpd.conf

| [...] DefaultRoot ~ IdentLookups off ServerIdent on "FTP Server ready." [...] |

ftp 사용자가 CHMOD을 허용하도록 다음 줄을 주석 처리해야 합니다:

| [...] # 기본적으로 SITE CHMOD 사용 금지 # # DenyAll # [...] |

그리고 ProFTPd를 재시작합니다:

/etc/init.d/proftpd restart
Share: X/Twitter LinkedIn

새 게시물을 받은 편지함에서 받기

스팸은 없습니다. 언제든지 구독 해지 가능합니다.