[ Server ][ Linux ] MySQL + Apache + PHP + Zend Optimizer 설치 > linux

본문 바로가기
사이트 내 전체검색

linux

[ Server ][ Linux ] MySQL + Apache + PHP + Zend Optimizer 설치

페이지 정보

작성자 웹지기 댓글 0건 조회 10,722회 작성일 18-09-28 17:07

본문

##########################################################
# 문서명 : MySQL + Apache + PHP + Zend Optimizer 설치 #

# 작성자 : 임희 #
# 작성일 : 2003 년 12 월 23 일 (화) 13:00 #
# 수정일 : 2004 년 03 월 05 일 (금) 17:00 (수정) #
# 수정일 : 2005 년 05 월 21 일 (토) 10:00 (수정) #
# 작성서버: KERNEL - 2.4.23 / CPU : P-III 1G / RAM : 256M #
# 수정서버: KERNEL - 2.4.20-8(RH9) / CPU : P-III 800M / RAM : 256M #
# gcc : gcc version 2.95.4 20010319 (prerelease) #
# gcc : gcc version 3.2.2(RH9) #
# 관리 : TEXT/1.5#
########################################################

1. 설치전에...
이 문서의 내용은 작성자가 모은 자료를 바탕으로 설치하면서 경험한 자료를
정리한 문서 입니다.
이 문서가 APM 설치에 도움이 되기를 바라며, 수정하여 사용하셔도 무방합니다.
이 문서를 참고하여 설치하신 후 발생되는 문제에 대해서는 작성자에 책임이 없습니다.

2. 설치 필요 프로그램
- MySQL 4.0.16 :http://www.mysql.org
( 바이너리 말고 소스 를 받으세요.)
- Apache 1.3.33 :http://www.apache.org

( 저는2.x.x 보다 이 1.3.x 를 많이 사용합니다. 2.x.x 도 설치는 같습니다.)
- Apache-devel :http://www.oops.org
( mod_url.c 를 컴파일 할때 필요합니다.)
- PHP 4.3.11 :http://www.php.net

- ZendOptimizer : ZendOptimizer-2.1.0b-Linux_glibc21-i386
- mod_url.c :http://www.oops.org
( 웹 상에서 한글파일을 보기 위한 것. )
( 김정균 님이 만드신 모듈 / 1.3.x , 2.x 용이 있습니다. )


# 설치순서(모든 설치는 파일이 있는 디렉토리에서 실행을 합니다.)
1. IMAP 설치(RPM 설치를 설명합니다)
1.1 확인
- 아래 두 명령으로 imap / imap-devel 이 설치가 되어있지 않으면 설치 합니다.
root # rpm -qi imap
root # rpm -qi imap-devel

1.2 RPM 설치
root # rpm -Uvh imap-2001a-10.i386.rpm
root # rpm -Uvh imap-devel-2001a-10.i386.rpm

2. Apache-devel 설치(1.3.x 와 2.x 동일한 설치 입니다.)
root # rpm -Uvh apache-devel-1.3.28-1.i686.rpm
(document 설치 때문에 에러가 나시면 --force option 을 사용하세요.)
참조 !
- 컴파일시 헤더가 필요해서 설치 하나 없으셔도 컴파일 됩니다.
- 컴파일 에러시 찾아서 설치 해 주세요.

3. MySQL 설치
3.1 압축해제
root # tar xvfz mysql-4.0.16.tar.gz

3.2 설치
root # cd mysql-4.0.16
root # ./configure --prefix=/usr/local/mysql --with-charset=euc_kr \
--localstatedir=/usr/local/mysql/data

!!! 참조
- prefix : MySQL 이 설치될 장소
- with-charset=euc_kr : 언어 설정(한글)
- 에러시 이 설정 삭제후 컴파일
- 언어 지정은 my.cnf 에서 할 수 있음.
- 4.X 에서 약간의 수정이 있은 듯 함.
- localstatedir : DATA 디렉토리 설정
- \ 는 줄 바꿈 표 시 입니다. \ 빼고 쭉 이어서 입력 하시면 됩니다.
root # make : 컴파일
root # make install : 설치

3.3 설정
root # cd /usr/local/mysql/bin : 실행파일 디렉토리 이동
root # ./mysql_install_db : 기본 DB 생성/ !!! 1번만 실행
root # cd ../shared/mysql : 설정파일 디렉토리로 이동
root # cp mysql.server /etc/rc.d/init.d/mysqld : 데몬 실행파일 복사
root # cp my-medium.cnf /etc/my.cnf : 설정파일 복사/시스템에 따라 사용
- 이 부분 부터는 mysql 이라는 사용자가 없을 경우 추가 하는 부분 입니다.
- /etc/passwd 부분에 보면 사용자 확인 가능 합니다.
root # useradd -d /usr/local/mysql -s /bin/false mysql
root # chown -Rf mysql:mysql /usr/local/mysql

3.4 확인
root # /etc/rc.d/init.d/mysqld start
root # /usr/local/mysql/bin/mysql -u root
# 아래의 내용이 보이면 정상 적으로 설치 된 것 입니다.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.0.16-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> quit; -> 빠져 나감.

4. Apache 설치
4.1 압축해제
root # tar xvfz apache_1.3.33.tar.gz

4.2 설치
root # cd apache _1.3.33
root # ./configure --prefix=/usr/local/apache --enable-module=so \
--enable-shared=max

!!! 참조
- prefix : 설치가 될 위치 입니다.
- enable-module=so : 모듈을 사용하기 위한 옵션 입니다.
- enable-shared=max : 모듈을 사용하기 위한 옵션 입니다.
root # make -> 컴파일 합니다.
root # make install -> 설치 합니다.

5. mod_url.c 컴파일
5.1 version 1.3.x 용의 컴파일
root # gcc -fpic -DSHARED_MODULE -I/usr/include/apache -c mod_url.c
root # gcc -shared -o mod_url.so mod_url.o

5.2 version 2.x 용의 컴파일
root # gcc -fpic -DSHARED_MODULE -I/usr/include/httpd -c mod_url.c
root # gcc -shared -o mod_url.so mod_url.o

5.3 생성된 파일 복사
파일 : mod_url.c mod_url.o mod_url.so*
root # cp mod_url.so /usr/local/apache/libexec

6. PHP 설치
6.1 압축해제
root # tar xvfz php-4.3.11.tar.gz

6.2 설치( \ 줄바꿈 표시 입니다. 그냥 죽 이이서 입력하시면 됩니다.)
- 일반적으로 OS 설치시 RPM 으로 설치된 것을 기준으로 컴파일 합니다.
root # cd php-4.3.11
root # ./configure --with-apxs=/usr/local/apache/bin/apxs \
--with-apache-install=/usr/local/apache \
--enable-module=so \
--with-config-file-path=/usr/local/apache/conf \
--disable-debug \
--with-imap=/usr \
--with-mysql=/usr/local/mysql \
--enable-track-vars \
--enable-ftp \
--prefix=/usr/local/php \
--with-gd=/usr \
--with-jpeg-dir=/usr \
--with-zlib-dir=/usr \
--with-png \
--enable-inline-optimization \
--with-xml \
--with-kerberos \
--enable-sockets \
--with-imap-ssl=/usr \
root # make -> 컴파일 합니다.
root # make install -> 설치 합니다.
root # cp php.ini-dist /usr/local/apache/conf/php.ini

!!! 참조
- 각 option 들은 configure --help 하시면 참조 하실 수 있습니다.
- 목적에 맞게 옵션은 설치를 하시면 됩니다.

7. Zend optimizer 설치
7.1 압축해제
root # tar xvfz ZendOptimizer-2[1].1.0b-Linux_glibc21-i386.tar.gz

7.2 설치
root # cd ZendOptimizer-2.1.0b-Linux_glibc21-i386/
root # mkdir /usr/local/Zend
root # cp -Rf * /usr/local/Zend
root # cd /usr/local/Zend
root # ./install-tty : 텔넷으로 로그인시 일반은 ./install.sh
- Welcome to the Zend Optimizer 2.1.0 Installation script!
For more information on this script, see the Installation
section in the Zend Optimizer User Guide.
[To continue, press Enter] [Enter]
Zend Optimizer 2.1.0 Installation script 에 오신것을 환영합니다.
이 스크립트에 대한 더 많은 정보는 Zend Optimizer User Guide 의
Installation 장을 보십시요.
- 라이센스에 대해서 출력 합니다. [ space bar ] 로 넘어 갑니다.
- Do you accept the terms of the license?
Answer (yes or no) [YES]: [Enter]
이 라이센스에 동의 하십니까?
- Specify the location where to install Zend Optimizer [/usr/local/Zend]:
[Enter]
Zend Optimizer 가 설치될 위치를 적어 주세요.
- Confirm the location of your php.ini file [/usr/local/Zend/etc]:
/usr/local/apache/conf [Enter]
당신의 php.ini file 의 위치를 확인해 주세요.
- Are you using Apache web server?
Answer (yes or no) [YES]: [Enter]
Apache web server 를 사용하고 있으세요?
- Specify the Apache bin directory [/usr/local/apache/bin]:
[Enter]
Apache 실행 디렉토리를 적어 알려주세요.
- Installing 4_3_x_comp/TS/ZendOptimizer.so \ [100%]
Your php.ini is relocated to the /usr/local/Zend/etc directory and a
symbolic link from the former place /usr/local/apache/php.ini is created.
Your original php.ini was backed-up to:
/usr/local/apache/php.ini-zend_optimizer.bak
[To continue, press Enter] [Enter]
당신의 php.ini 파일이 /usr/local/Zend/etc directory 로 수정되었고,
/usr/local/apache/php.ini 에는 심볼릭 링크가 생성 되었습니다.
당신의 원본 php.ini 는 /usr/local/apache/php.ini-zend_optimizer.bak
에 백업되어졌습니다.
- The installation was completed successfully.
The Zend Optimizer is ready for use.
You must restart your Web server for the modifications to take effect.
[To continue, press Enter] [Enter]
모든 설정이 성공적으로 완료 되었습니다.
Zend Optimizer 가 사용하도록 준비 되었습니다.
- Restart the Web server now?
Answer (yes or no) [YES]: [Enter]
Web server 를 재시작 하시겠습니까?
- Restarting Apache ...
Apache was successfully restarted.
[To continue, press Enter] [Enter]
Apache 가 성공적으로 재시작 되었습니다.

8. Apache 의 httpd.conf ( /usr/local/apache/conf )
8.1 PHP 설정
root # vi httpd.conf
- AddType application/x-httpd-php .htm .html .php .php3 .php4 .inc 추가
참조!
- 정의 되어진 확장명에 php 코드가 있을 경우 php 언어를 해석 합니다.

8.2 디렉토리 인덱스 설정
-
DirectoryIndex index.html index.htm index.php index.php3 \
index.php4 main.html main.htm intro.html

참조 !
- 필요한 것만 넣으세요.
- 개인적으로 인덱스를 너무 많이 다르게 하셔서 위와 같이 많이 넣었습니다.

8.3 한글 파일 처리를 위한 설정
LoadModule redurl_module libexec/mod_url.so : 추가
AddModule mod_url.c : 추가

CheckURL On


8.4 아파치 재 실행
root # /etc/rc.d/init.d/httpd restart

9. 설정 확인
root # cd /usr/local/apache/htdocs
root # vi test.php
- test.php 내용
phpinfo();
?>
: wq -> vi 에디터 종료
root #
- 웹브라우져에서 서버ip/test.php(ex .http://192.168.0.126/test.php)
- PHP Version [설치버젼] 으로 시작하는 페이지가 보인다면 정상적으로 인스톨 완료
- 소스 혹은 다운로드 받을려고 한다면 설치 절차를 다시 한번 확인.

참조)
2004/02/05(금)
- 개발 라이브러리 에러
lib*** (예. configure: error: libjpeg.(a|so) not found.) 형식의 에러가 나면
lib***-devel-*** 의 개발라이브러리를 설치 해야 함.
레드햇 9 에서 에러가 발생.
redhat 2/3 에 *-devel-*.rpm 모음이 있음.

- GD 에러
PHP 4.3.X 에서 GD 버젼에 따른 에러가 있음. 패치 파일로 패치후 설치 해야 함.
PHP 4.3.11 / GD 2.0.X 에서 설치시 에러 없음 (2005-05-21 수정)

2005/05/21(토)
- ZendOptimization 까지 모두 설정 후 php.ini 에서 allow_url_open = off 로 꼭 수정
zeroboard 등에서 버그 이용해서 해킹 할 수 있음.
- php.ini 에서 register_globals = On 하셔야 zeroboard 에서 에러가 없음.
- mod_url.c 모듈은 없으셔도 일단 서버 설치/사용에는 문제가 없습니다.
- 이 문서가 만들어진 것 좀 되어서 현 시점에서는 프로그램들이 상위 버젼이 출시가 되어 있으니
꼭 최신 상위 버젼으로 다운 로드 받으세요.

2005/06/10(금)
- RedHat 9 설치 하고 PHP GD 연동시 기본적으로 설치가 안되어 에러 나는 경우 있음.
- RH9 CD 에서 gd , gd-devel, libjpeg, libpng, freetype-devel 패키지 설치 해야 함.
- 설치 후 패치버젼 확인해서 upgrade
- source 로 설치시는 각 소스 파일 받아서 configure , make ,make install 로 설치.

[이 게시물은 웹지기님에 의해 2019-03-15 15:38:39 knowledge에서 이동 됨]
추천0 비추천0

댓글목록

등록된 댓글이 없습니다.

Total 103건 1 페이지
  • 102 [ server ][ linux ][ CentOS7 ] nginx 설치 및 방화벽 설정
  • 1) yum 외부저장소에 nginx 추가(nginx 관련사항이 없으니 추가해줘야 함) >> vi /etc/yum.repos.d/nginx.repo nginx.repo 파일 내용( CentOS7 기준 - 버젼별로 다를 수 있으니 다른버젼은 공식사이트 이용 ) [nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/7/$basearch/ gpgcheck=0 enabled=1 2) nginx ...
  • 웹지기 02-04 6012 0 0 댓글 0
  • 101 [ server ][ linux ] cmd 이용 shell 접속 ( cmd ssh )방법 ( 윈도우에서 cm…
  • 쉘접속 프로그램이 있으면 좋은데, cmd에서 그냥 접속하고 싶다면, 윈도우라면 cmd를 이용해서 접속을 하면 되고, 리눅스라면 cmd라인에서 바로 명령을 입력하면 된다. # telnet 192.168.0.1 { port } 일반적으로 이런식으로 접속을 하면 된다. ssh로 접속을 하고 싶다면 # ssh -p { port } { 계정 }@192.168.0.1 이런식으로 접속을 하면 된다.
  • 웹지기 06-08 11272 0 0 댓글 0
  • 100 [ server ][ linux ][ gitlab ] 원격 저장소 url 변경
  • # git remote -v # origin http://gitlab.com/sample/sample.git (fetch) # origin http://gitlab.com/sample/sample.git (push) 확인을 해본 다음 다음의 명령어로 변경이 가능하다 # git remote set-url origin ssh://git@gitlab.com/sample/sample.git 다시 확인을 해보면 # git remo...
  • 웹지기 06-01 8388 0 0 댓글 0
  • 99 [ server ][ linux ] CentOS7 certbot certificates 오류 ttribute…
  • # certbot certificates 이런명령을 내렸는데 오류가 발생햇다 yum update하면서 무언가 문제가 발생한것 같다. An unexpected error occurred: AttributeError: 'module' object has no attribute 'TLSSNI01' Please see the logfile '/tmp/tmpV1KtqF/log' for more details. # yum update pyth...
  • 웹지기 03-12 7981 0 0 댓글 0
  • 96 [ Server ][ Linux ] CentOS7 firewall ( 방화벽 ) 관리
  • 방화벽 실행 여부 확인 # firewall-cmd --state #running 방화벽 다시 로드 # firewall-cmd --reload #success 존 ( zone ) 목록 출력 # firewall-cmd --get-zones #block dmz drop external home internal public trusted work 존 ( zone ) 기본존을 출력 # firewall...
  • 웹지기 12-24 7179 0 0 댓글 0
  • 95 [ Server ][ Linux ] CentOS7 라우팅 설정 ( vpn 연결 )
  • 장비의 구조도는 위와 같은 장비의 구조에서 한개의 회선은 기본인터넷(eno1)을 연결하는 회선이고 다른하나의 회선은 vpn연결(eno2)을 위한 회선이다 이러한 경우 default를 하나로 설정하고 다른 하나는 route를 통해 vpn회선을 연결한다. eno1번의 랜설정은 default로 설정되며 다음처럼 설정 ip 192.168.0.2 prefix 24 gw 192.168.0.1 eno2번의 랜설정은 ip 192.168.10.2 p...
  • 웹지기 12-18 6907 0 0 댓글 0
  • 94 [ Server ][ Linux ] CentOS7 네트워크 설정
  • 네트워크에 관련된 파일이 있는 곳으로 가서 확인해본다. # cd /etc/sysconfig/network-scripts # ll 현재 설정을 확인 할 수 있다. # route # ip address # netstat 네트워크 재시작 service network restart
  • 웹지기 12-17 5496 0 0 댓글 0
  • 93 [ Server ][ Linux ] CentOS7 telnet 설치 및 테스트
  • 설치 확인 # telnet #bash: telnet: command not found 이렇게 뜨면 텔넷이 설치가 안되어 있는 것이다. 설치해 주자 # yum -y install telnet # ....................................... #Installed: #telnet.x86_64 1:0.17-64.el7 #Complete! 정상 설치 되면 위처럼 뜬다. 실행해 보자 ...
  • 웹지기 12-17 9744 0 0 댓글 0
  • 92 [ Server ][ Linux ] CentOS7 콘쉘 ( ksh ) 설치
  • 현재 사용할 수 있는 쉘을 확인 chsh -l 명령을 통해 현재 사용가능한 쉘 목록 확인 # chsh -l #/bin/sh #/bin/bash #/usr/bin/sh #/usr/bin/bash 콘쉘 ( ksh )를 설치 #yum -y install ksh 사용할 수 있는 쉘을 다시 확인 # chsh -l #/bin/sh #/bin/bash #/usr/bin/sh #/usr/bin...
  • 웹지기 12-16 7351 0 0 댓글 0
  • 91 [ Server ][ Linux ] Gitlab 서버 도메인 변경
  • gitlab 서버의 도메인을 변경하고 싶다면 일단 검색을 한다. # find / -name gitlab.yml # /var/opt/gitlab/gitlab-rails/etc/gitlab.yml # /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml 이런 리스트에서 다음 파일에서 변경을 해준다. # vim /var/opt/gitlab/gitlab-rails/etc/gitlab.yml ...
  • 웹지기 12-12 8360 0 0 댓글 0
  • 90 [ Server ][ Linux ] CentOS7 Let's Encrypt 무료 SSL 인증서 와일드카드로 …
  • 입력시 일반 도메인(domain.com)과 와일드카드(*.domain.com) 도메인 두번 적는다 # certbot certonly --manual --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory -d domain.com -d *.domain.com 이메일을 입력하라는 문구가 나오면 인증서 알림을 받을 이메일을 입력한다. # Saving debug log t...
  • 웹지기 12-12 5380 1 0 댓글 1
  • 89 [ Server ][ Linux ] CentOS7 htmlspecialchars 사용설정
  • htmlspecialchars 함수를 사용하기 위해서는 다음의 ini설정을 변경해 주어야 한다. php.ini filter.default, filter.default_flags 설정 AAI 멀티 버젼 같은 경우 각각의 PHP버젼별로 php.ini파일이 다르므로 검색을 해서 위치를 찾는다 # find / -name php.ini # /etc/opt/remi/php70/php.ini # /etc/opt/remi/php71/php.ini # /etc/opt/rem...
  • 웹지기 12-03 5094 0 0 댓글 0
게시물 검색

회원로그인

접속자집계

오늘
100
어제
5,664
최대
33,828
전체
8,389,823

그누보드5
Copyright © funyphp.com. All rights reserved.