이번 포스트는 낚시와 관련된게 아니라 제가 현재 회사에서 작업을 하고 있거나 했던 내용을 참고 하기 위해 올리는거라 설명이 별루 없으며 순간 순간 수정이 되오니 ㅎㅎ 양해 바랍니다.

ㅠ.ㅠ 출조 가고파요~~ 족저근막염 때문에 출조를 못 나가니.. 이거워 야 원....

아무튼 낚시와 관련된게 아니니 서버쪽과 관련이 없으신분들은 패스~~~하세요!!!

고객사에서 이번에 HP Server(HP ProLiant DL360 G9)를 새로 구입을 하였는데 따로 RAID Controller를 구입하지 않으시고 내장 RAID Controller B140i을 사용 하시네요. B140i를 사용할때에는 CentOS 설치시 반드시 dd 형식으로 설치 해야하는데 HP에서 B140i에서 CentOS 설치 지원되는 최소 버젼이 6.6 버전이라 어차피 dd 로 올릴꺼 최신 버전으로 CentOS 7(x86_64 1804) 설치를 합니다.

문제는 현재 사용하고 있는 APM(Apache, PHP, Mysql) 들이 CentOS 6.2 버전이고 홈페이지 소스를 관리하는 업체에서 최대한 APM 버전을 그대로 해달라는 요청에 저만 죽어나네요.

RPM, yum 으로 APM 예전 버전들을 찾아서 설치해 보았으나 모조리 실패~~!!

어쩔수 없이 Source 컴파일 설치를 시작합니다.

APM Source 파일을 찾아서 다운로드 하는것만 해도 하루 지나가네요. ㅡ,.ㅡ

예전 설치 환경

OS : CentOS 6.2

Apache : httpd-2.2.24

MySQL : MySQL 5.1.52

PHP : 5.3.3

새로 설치 환경

OS : CentOS 7.5(x86_64 1804)

Apache : httpd-2.2.24

MySQL : MySQL 5.1.52

PHP : 5.3.3

MySQL 5.1.52 Source 컴파일 설치

다운로드 경로 :

# wget https://downloads.mysql.com/archives/get/file/mysql-5.1.52.tar.gz

Source 로 설치시 필요한 의존성 패키지를 모조리 설치합니다~

# yum install -y wget patch pcre-devel lua-devel libxml2-devel ncurses-devel zlib zlib-devel curl openssl openssl-devel libtermcap-devel libc-client-devel bison gcc g++ cpp gcc-c++ freetype freetype-devel freetype-utils gd gd-devel libjpeg libjpeg-devel libpng libpng-devel curl curl-devel flex php-mbstring libexif-devel libmcrypt libmcrypt-devel

# tar xvfpz mysql-5.1.52.tar.gz

# ./configure --prefix=/usr/local/mysql --enable-thread-safe-client --localstatedir=/usr/local/msyql/data --enable-shared --with-mysqld-user=mysql --with-charset=utf8 --with-extra-charsets=all --with-libedit --enable-assembler --sysconfdir=/etc

# make && make install

# useradd mysql

# chown -R mysql.mysql /usr/local/mysql

# chown -R mysql.mysql /usr/local/mysql/data

# chmod 755 /usr/local/mysql/data

# /usr/local/mysql/bin/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data

# cp /usr/local/mysql/share/mysql/my-huge.cnf /etc/my.cnf

# cd

# vi ~/.bash_profile

PATH=$PATH:$HOME/bin:/etc/rc.d/init.d:/usr/local/mysql/bin

# /usr/local/mysql/bin/mysqld_safe --user=mysql &

# cp -a /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld

# chkconfig --add mysqld

그다음 root 암호 설정을 알아서...

APAHCE 2.2.24 컴파일 설치

다운로드 경로 :

# wget https://archive.apache.org/dist/httpd/httpd-2.2.24.tar.gz

# tar xfpz httpd-2.2.24.tar.gz

# cd httpd-2.2.24

# ./configure --prefix=/usr/local/apache2 --enable-rule=SHARED_CORE --enable-modules=all --enable-mods-shared=most --with-mpm=worker --enable-rewrite --enable-deflate --enable-headers --enable-so --enable-ssl --enable-unique-id

# make && make istall

# cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd

PHP 5.3.3 컴파일 설치

다운로드 경로 : http://php.net/releases/

# wget http://museum.php.net/php5/php-5.3.3.tar.gz

# tar xvfpz php-5.3.3.tar.gz

# cd php-5.3.3

# ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/apache2/conf --with-regex=php --with-zlib --disable-debug --enable-calendar --enable-ftp --enable-sockets --enable-sysvsem --enable-sysvshm --enable-mbstring --enable-magic-quotes

# make && make install

위의 명령어를 적었는데 아래와 같이 오류가 발생하면..

.. php-5.3.3/ext/dom/node.c: In function 'dom_canonicalization'

.. php-5.3.3/ext/dom/node.c: 1953:21: ............

.. php-5.3.3/ext/dom/node.c: 1955:5: ............

아래 명령어를 사용하여 다운 받아 진행을 합니다.

# wget -O php.patch https://mail.gnome.org/archives/xml/2012-August/txtbgxGXAvz4N.txt

(참조 : http://blog.naver.com/PostView.nhn?blogId=ssik425&logNo=10175143994)

# cd php-5.3.3

# patch -p0 -b < php.patch

# make && make install



CentOS Apache



아파치(Apache)에서 설정 시 webadmin 사용자 추가 후 디폴트로 되어 있는 DocumnetRoot 를 변경(/var/www/html -> /home/webadmin/www/html) 


테스트 시 아래와 같은 에러가 발생


Forbidden You don’t have permission to access / on this server. 



먼저 홈페이지 디렉토리(/var/www/html)을 사용자 디렉토리로 옮겼다는 가정하에 시작합니다.


# chown -R webadmin:webadmin /home/webadmin/www/html

// 사용자와 그룹을 webadmin으로 변경(root 권한)


# vi /etc/httpd/conf/httpd.conf


아래 내용을 추가 기입하세요.


<Directory /Users/mytory/workspace>

   Options FollowSymLinks

   AllowOverride None

   Order deny,allow

   Allow from all

</Directory>



# service httpd restart


이제 홈페이지로 접속 테스트를 해 보니 정상 작동~













CentOS APM 설치 후 홈페이지 소스를 FTP로 옮길려고 로그인을 하였는데.. 

디렉토리만 보이고 내용은 하나도 보이지 않는 현상이 나타나네요.


일단 vsftp 는 확인해 본바 이상이 없음.



SELinux 정책 확인


# vi /etc/sysconfig/selinux


# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

#     enforcing - SELinux security policy is enforced.

#     permissive - SELinux prints warnings instead of enforcing.

#     disabled - No SELinux policy is loaded.

#SELINUX=enforcing

SELINUX=disabled

# SELINUXTYPE= can take one of these two values:

#     targeted - Targeted processes are protected,

#     mls - Multi Level Security protection.

SELINUXTYPE=targeted



SELINUX=enforcing 을 아래 disabled 로 변경


그 후 가급적 서버 재부팅을 권함.


다시 FTP 로그인 후 접속 해보면 파일 내용이 나옵니다.



만약 이렇게 해도 안된다면 아래 글을 참조하세요.


# setsebool -P ftp_home_dir 1

// SELinux 정책에서 사용자의 home 디렉토리의 쓰기를 막아놓은것을 해제하는 명령어

 

# service vsftpd restart


# setsebool -P ftp_disable_trans 1

// SELinux 정책에서 FTP부분을 적용하지 않겠다는 명령어





1. hosts 호스트명 변경


# vi /etc/hosts

127.0.0.1    localhost    localhost.localdomain    도메인


2. 자체방화벽이 있다면 iptable, ip6table 정책 삭제 및 이름 변경

   CentOS 6.4 설치 후 iptable의 정책이 돌아가고 있으면 Apache 를 실행 하여도 접속하지 못함. 주의~


# rm /etc/sysconfig/iptables

# rm /etc/sysconfig/ip6tables 


3. Apache http.conf 수정


# vi /etc/httpd/conf/httpd.conf

276 줄에 있는 ServerName 변경


예) #ServerName www.example.com:80 을   # 없얘고  ServerName www.test.com(자기 도메인):80



4. php.ini 파일수정


# vi /etc/php.ini


229 줄에 있는 short_open_tab = Off 를  On 으로 변경

만약 위의 작업을 하지 않는다면 아무리 phpinfo() 파일을 해 봐도 화면에 나타나지 않음.. ㅡㅡ;



5. phpinfo 에서 mysql 적용이 되지않다면 php-mysql을 설치해야함 


# yum install php-mysql 


위의 문구만 치고 apache를 재시작 하면 적용 끝


# yum install php-mysql



이상 더 생각이 나면 추가 할 예정임..







출처 : http://ezgreg.tistory.com/57

지난 2009년 11월 19일, PHP 5.3.1 이 릴리즈 되면서 5.3대로 업데이트를 해보자는 생각을 구글링을 하다 YUM으로 업데이드 할 수 있는 레포지토리를 찾았습니다.

# rpm --import http://repo.webtatic.com/yum/RPM-GPG-KEY-webtatic-andy
# wget -P /etc/yum.repos.d/ http://repo.webtatic.com/yum/webtatic.repo


이렇게 Repository를 추가하시고 인스톨이나 업데이트를 하실 분은 아래의 명령어를 알맞게 사용하시면 됩니다.

-  최초 설치 시 -

# yum --enablerepo=webtatic install php


- 업데이트 시 -

# yum --enablerepo=webtatic update php



PHP 5.3에서 추가된 부분은 아래를  참고하시길 바랍니다.
네이스페이스가 추가된 부분은 정말 필요했던 부분인거 같습니다.
Change Log를 보시면 자세한 설명도 나와있습니다.

The PHP development team is proud to announce the immediate release of PHP 5.3.0. This release is a major improvement in the 5.X series, which includes a large number of new features and bug fixes.

Some of the key new features include: namespaceslate static bindingclosures, optional garbage collection for cyclic references, new extensions (likeext/pharext/intl and ext/fileinfo), over 140 bug fixes and much more.

For users upgrading from PHP 5.2 there is a migration guide available here, detailing the changes between those releases and PHP 5.3.0.

Further details about the PHP 5.3.0 release can be found in the release announcement, and the full list of changes are available in the ChangeLog.