2014年5月18日日曜日

apache2.4 mysql5.6 php5.5 linuxインストールメモ

※centos6.4, httpd-2.4.6, MySQL-5.6.14, php-5.5.6
■最新化
yum update
■makeの下準備
yum install gcc gcc-c++ zlib zlib-devel libxml2 libxml2-devel libmcrypt libmcrypt-devel curl curl-devel openssl-devel
■Apache
yum install -y pcre-devel
wget http://archive.apache.org/dist/httpd/httpd-2.4.6.tar.gz
tar zxvf httpd-2.4.6.tar.gz
cd httpd-2.4.6
cd ./srclib/
wget http://ftp.jaist.ac.jp/pub/apache//apr/apr-1.5.1.tar.gz
wget http://ftp.jaist.ac.jp/pub/apache//apr/apr-util-1.5.3.tar.gz
tar zxvf apr-1.5.1.tar.gz
tar zxvf apr-util-1.5.3.tar.gz
mv apr-1.5.0 apr
mv apr-util-1.5.3 apr-util
cd ..
./configure --with-included-apr --enable-mods-shared=all
make
make install
/usr/local/apache2/bin/httpd -v

cp build/rpm/httpd.init /etc/rc.d/init.d/httpd
vim /etc/rc.d/init.d/httpd ← bin,pidのあたりを修正する

ps -aux | grep httpd
kill [process number]

service httpd [start,stop,restart]

vim /etc/hosts ← hostname を追加する

htpasswd -c .htpasswd xxxxxx

/usr/local/apache2/bin/httpd -S -DSSL
/usr/local/apache2/bin/httpd -M
■MySQL
yum install libaio libaio-devel
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-5.6.14-1.linux_glibc2.5.x86_64.rpm-bundle.tar
tar xvf MySQL-5.6.14-1.linux_glibc2.5.x86_64.rpm-bundle.tar
rpm -ivh MySQL-shared-5.6.14-1.linux_glibc2.5.x86_64.rpm
rpm -ivh MySQL-client-5.6.14-1.linux_glibc2.5.x86_64.rpm
rpm -ivh MySQL-server-5.6.14-1.linux_glibc2.5.x86_64.rpm
rpm -ivh MySQL-devel-5.6.14-1.linux_glibc2.5.x86_64.rpm

ls /etc/my.cnf
cp /usr/share/mysql/my-default.cnf /etc/my.cnf
vim /etc/my.cnf
service mysql start

view ~/.mysql_secret ← パスワードの確認
mysql -u root -p
SET PASSWORD = PASSWORD('root');
■PHP
wget http://ftp.riken.jp/Linux/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
vim /etc/yum.repos.d/epel.repo ← enabled=0
yum --enablerepo=epel install libmcrypt-devel
wget http://jp1.php.net/get/php-5.5.6.tar.gz/from/this/mirror
tar zxvf php-5.5.6.tar.gz
cd php-5.5.6
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --enable-mbstring --enable-mbregex --with-mcrypt --enable-calendar --with-libdir=lib64 --with-mysql --with-mysqli --with-openssl --with-curl --with-curlwrappers --enable-zip
[20140724]./configure --prefix=/usr/local/php --with-apxs2=/etc/httpd/bin/apxs --enable-mbstring --enable-mbregex --with-mcrypt --enable-calendar --with-libdir=lib64 --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl --with-curl --enable-zip --enable-memcache --with-gd --with-zlibmake
make test
make install

/usr/local/php/bin/php -v
cd /usr/bin
ln -s /usr/local/php/bin/php php
php -r 'phpinfo();'  | grep php.ini
cp php.ini-development /usr/local/php/lib/php.ini
vim /usr/local/php/lib/php.ini ← time.zone = Asia/Tokyo
■SVN
yum install subversion
svn help
svn export https://xxxxxxxx
■phpmadmin
wget http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/4.0.9/phpMyAdmin-4.0.9-all-languages.zip?r=http%3A%2F%2Fwww.phpmyadmin.net%2Fhome_page%2Findex.php&ts=1385817138&use_mirror=jaist
unzip phpMyAdmin-4.0.9-all-languages.zip
mv phpMyAdmin-4.0.9-all-languages phpmyadmin
mv phpMyAdmin-4.0.9-all-languages.zip ./org
cd phpmyadmin/
cp config.sample.inc.php config.inc.php
vim config.inc.php

0 件のコメント:

コメントを投稿