문서의 선택한 두 판 사이의 차이를 보여줍니다.
— |
application:apache:suphp [2015/10/29 01:44] (현재) starlits 만듦 |
||
---|---|---|---|
줄 1: | 줄 1: | ||
+ | ====== Howto install suphp for apache2 on ubuntu ====== | ||
+ | ===== ubuntu package install ===== | ||
+ | - apt를 이용하여 패키지를 받는다. < | ||
+ | apt-get install libapache2-mod-suphp suphp-common libapache2-mod-php5 php5-mysql | ||
+ | </ | ||
+ | |||
+ | ===== / | ||
+ | - suphp 설정파일(/ | ||
+ | [global] | ||
+ | ;Path to logfile | ||
+ | logfile=/ | ||
+ | |||
+ | ;Loglevel | ||
+ | loglevel=info | ||
+ | |||
+ | ;User Apache is running as | ||
+ | webserver_user=www-data | ||
+ | |||
+ | ;Path all scripts have to be in | ||
+ | ; | ||
+ | docroot=/ | ||
+ | |||
+ | ;Path to chroot() to before executing script | ||
+ | ; | ||
+ | |||
+ | ; Security options | ||
+ | allow_file_group_writeable=false | ||
+ | allow_file_others_writeable=false | ||
+ | allow_directory_group_writeable=false | ||
+ | allow_directory_others_writeable=false | ||
+ | |||
+ | ;Check wheter script is within DOCUMENT_ROOT | ||
+ | check_vhost_docroot=true | ||
+ | |||
+ | ;Send minor error messages to browser | ||
+ | errors_to_browser=false | ||
+ | |||
+ | ;PATH environment variable | ||
+ | env_path=/ | ||
+ | |||
+ | ;Umask to set, specify in octal notation | ||
+ | ;umask=0077 | ||
+ | umask=0022 | ||
+ | |||
+ | ; Minimum UID | ||
+ | min_uid=100 | ||
+ | |||
+ | ; Minimum GID | ||
+ | min_gid=100 | ||
+ | |||
+ | [handlers] | ||
+ | ;Handler for php-scripts | ||
+ | application/ | ||
+ | |||
+ | ;Handler for CGI-scripts | ||
+ | x-suphp-cgi=" | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== / | ||
+ | - php5 모듈을 중지시킨다. < | ||
+ | - suphp 모듈을 활성화시킨다. < | ||
+ | - apache2의 suphp.conf 설정을 한다. < | ||
+ | < | ||
+ | < | ||
+ | SetHandler application/ | ||
+ | </ | ||
+ | suPHP_AddHandler application/ | ||
+ | |||
+ | < | ||
+ | suPHP_Engine on | ||
+ | </ | ||
+ | |||
+ | # By default, disable suPHP for debian packaged web applications as files | ||
+ | # are owned by root and cannot be executed by suPHP because of min_uid. | ||
+ | < | ||
+ | suPHP_Engine off | ||
+ | </ | ||
+ | |||
+ | # # Use a specific php config file (a dir which contains a php.ini file) | ||
+ | # | ||
+ | suPHP_ConfigPath / | ||
+ | # # Tells mod_suphp NOT to handle requests with the type < | ||
+ | # | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== / | ||
+ | - apache2 설정파일인 suphp.conf 에 있는 php.ini 를 만들어 준다. < | ||
+ | # cd / | ||
+ | # mkdir suphp | ||
+ | # cd suphp | ||
+ | # cp ../php.ini | ||
+ | </ | ||
+ | - <?php 이외에 <? 도 적용이 되도록 short_open_tag를 활성화시켜준다. < | ||
+ | # vi / | ||
+ | ... | ||
+ | ; starlits@adminschool.net | ||
+ | short_open_tag = On | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | ===== / | ||
+ | - virtual host 설정을 한다. < | ||
+ | < | ||
+ | ServerName adminschool.net | ||
+ | ServerAdmin webmaster@adminshcool.net | ||
+ | DocumentRoot / | ||
+ | < | ||
+ | Require all granted | ||
+ | </ | ||
+ | < | ||
+ | suPHP_Engine on | ||
+ | </ | ||
+ | ErrorLog / | ||
+ | CustomLog / | ||
+ | </ | ||
+ | |||
+ | </ |