yum으로 설치
sudo yum install gcc
sudo yum install make
sudo yum install gcc-c++
sudo yum install php-mysql php php-xml php-mcrypt php-mbstring php-cli mysql httpd
sudo yum install mysql-server
sudo yum install httpd-devel.x86_64 httpd-tools.x86_64
볼륨마운트
sudo mkdir data1
sudo mount /dev/sdf /data1
sudo vi /etc/fstab
추가 : data1 /dev/sdf data1 defaults 0 0
MySQL 컨피그 수정
sudo vi /etc/my.cnf
datadir 수정
캐릭터셋 변경
init_connect='SET collation_connection = utf8_unicode_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake
sudo /etc/init.d/mysqld start
mysqladmin -u root password '비밀번호'
아파치 설정
sudo vi /etc/httpd/conf/httpd.conf
수정 : DocumentRoot "/data1/www/html"
수정 : <Directory "/data1/www/html">
수정
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /data1/www/html
ServerName ec2.php.com
DirectoryIndex index.html index.php
</VirtualHost>
아파치 기동
sudo /etc/init.d/httpd start
권한설정 (시스템 구동시 자동 시작)
sudo chkconfig --levels 235 mysqld on
sudo chkconfig --levels 235 httpd on
php등을 위한 hosts설정
hosts
54.248.115.161 ec2.php.com
54.248.115.161 ec2.phpmyadmin.com
--tomcat connector
sudo yum install autoconf.noarch
sudo yum install libtool.x86_64
cd /data1/install_files/tomcat-connectors-1.2.32-src/native
./buildconf.sh
sudo ./configure --with-apxs=/usr/sbin/apxs
sudo make
sudo make install
-- tomcat 연동
cd /etc/httpd/conf
sudo vi workers.properties
workers.tomcat_home=/data1/apache-tomcat-6.0.35
workers.java_home=/usr/bin/java
ps=/
worker.list=default
worker.default.port=8009
worker.default.host=localhost
worker.default.type=ajp13
worker.default.lbfactor=1
sudo vi uriworkermap.properties
/*.do = default
/*.jsp = default
sudo vi /etc/httpd/conf/httpd.conf
주석해제 : NameVirtualHost *:80
추가 : LoadModule jk_module modules/mod_jk.so
추가 :
<IfModule jk_module>
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel error
</IfModule>
<VirtualHost *:80>
JkMountFile conf/uriworkermap.properties
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /data1/apache-tomcat/webapps/riderhub
ServerName ec2-54-248-115-161.ap-northeast-1.compute.amazonaws.com
DirectoryIndex index.jsp
</VirtualHost>
phpmyadmin
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
sudo rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.i386.rpm
sudo yum install phpmyadmin
sudo vi /etc/httpd/conf.d/phpmyadmin.conf
주석처리
#<Directory "/usr/share/phpmyadmin">
# Order Deny,Allow
# Deny from all
# Allow from 127.0.0.1
#</Directory>
cd /usr/share/phpmyadmin/
sudo cp config.sample.inc.php config.inc.php
sudo vi config.inc.php
수정
$cfg[Servers'][$i]['auth_type'] = 'http';
sudo vi /etc/httpd/conf/httpd.conf
추가
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /usr/share/phpmyadmin
ServerName ec2.phpmyadmin.com
DirectoryIndex index.php
</VirtualHost>
make로 직접 build
http://blog.naver.com/PostView.nhn?blogId=parkjy76&logNo=30142677992
sudo yum install gcc
sudo yum install make
sudo yum install gcc-c++
1. apr
- sudo ./configure
- sudo make
- sudo make install
(/usr/local/apr)
2. apr-util
- sudo ./configure --with-apr=/usr/local/apr
- sudo make
- sudo make install
3. pcre
- sudo /configure -prefix=/usr/local/pcre
- sudo make
- sudo make install
- libtool: compile: unrecognized option `-DHAVE_CONFIG_H' 에러 발생
- sudo yum install gcc-c++
- sudo /configure -prefix=/usr/local/pcre
- sudo make
- sudo make install
4. httpd
- sudo ./configure --prefix=/usr/local/httpd --enable-module=so --enable-rewrite --enable-so --with-pcre=/usr/local/pcre
- sudo make
- sudo make install
5. connector
- cd native
- ./buildconf.sh
- ./configure --with-apxs=/usr/local/httpd/bin/apxs
- sudo make
- sudo make install
6. /usr/local/httpd/conf/httpd.conf 수정
- 추가
LoadModule jk_module modules/mod_jk.so
<IfModule jk_module>
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel error
</IfModule>
- 주석해제
Include conf/extra/httpd-vhosts.conf
- 주석처리
#<Directory />
# AllowOverride none
# Require all denied
#</Directory>
저장
- 파일생성
/usr/local/httpd/conf/workers.properties 추가
workers.tomcat_home=/usr/local/tomcat5.0.28-dcd2
workers.java_home=/usr/java/jdk1.6.0_17
ps=/
worker.list=default
worker.default.port=8009
worker.default.host=localhost
worker.default.type=ajp13
worker.default.lbfactor=1
- 파일생성
/usr/local/httpd/conf/uriworkermap.properties 추가
/*.do = default
/*.jsp = default
(from http://shonm.tistory.com/208)
- conf/extra/httpd-vhost.conf 수정
<VirtualHost *:80>
JkMountFile conf/uriworkermap.properties
DocumentRoot /data1/apache-tomcat-6.0.35/webapps/riderhub
ServerName ec2-54-248-115-161.ap-northeast-1.compute.amazonaws.com/
DirectoryIndex index.jsp
</VirtualHost>
<VirtualHost *:80>
ServerAdmin hamyd@bigfoot.com
DocumentRoot /var/www/html
ServerName ec2.php.com
DirectoryIndex index.jsp
</VirtualHost>
<VirtualHost *:80>
ServerAdmin hamyd@bigfoot.com
DocumentRoot /usr/share/phpmyadmin
ServerName ec2.phpmyadmin.com
DirectoryIndex index.jsp
</VirtualHost>
7. apache 실행
- cd /usr/local/httpd/bin
- sudo ./apachectl start
phpMyAdmin
8. sudo yum install php.x86_64
9. wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
10. sudo rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.i386.rpm
11. sudo yum install phpmyadmin
12. sudo vi /etc/httpd/conf.d/phpmyadmin.conf
13. cd /usr/share/phpmyadmin/
14. sudo cp config.sample.inc.php config.inc.php
15. sudo vi config.inc.php
16. $cfg[Servers'][$i]['auth_type'] = 'http'; 로 수정
17. httpd.conf 수정
추가 : LoadModule php5_module modules/libphp5.so
추가 : AddType application/x-httpd-php .php .php3 .php4 .php5 .htm .html .inc