lampのインストール

OS:
ubuntu10.04
ファイル:
lamp.sh
中身:
1.ファイルを取得
wget http://www.php.net/get/php-5.3.23.tar.bz2/from/cn2.php.net/mirror
mv mirror php-5.3.23.tar.bz2
tar jxvf php-5.3.23.tar.bz2
wget http://archive.apache.org/dist/httpd/httpd-2.4.4.tar.gz
wget http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.10.tar.gz
wget http://mirror.bjtu.edu.cn/apache/apr/apr-1.4.6.tar.gz
wget http://mirror.bjtu.edu.cn/apache/apr/apr-util-1.5.1.tar.gz
wget http://sourceforge.net/projects/pcre/files/pcre/8.32/pcre-8.32.tar.gz/download
wget http://zlib.net/zlib-1.2.8.tar.gz

2.インストール作業
apt-get install bison libxml2 libxml2-dev built-essential gcc openssl libssl-dev mcrypt libmcrypt-dev libgd2-xpm libgd2-xpm-dev

sudo apt-get install libncurses5-dev

#apacheのインストール
tar zxvf apr-1.4.6.tar.gz
cd apr-1.4.6/
./configure –prefix=/usr/local/apr
make && make install

tar zxvf apr-util-1.5.1.tar.gz
cd apr-util-1.5.1/
./configure –prefix=/usr/local/apr-util \
–with-apr=/usr/local/apr/
make && make install

cd pcre-8.32
./configure && make && make install

cd httpd-2.4.4
./configure –prefix=/usr/local/httpd –enable-so –enable-mods-shared=all \
–enable-deflate –enable-cache –enable-file-cache –enable-mem-cache \
–enable-disk-cache –with-apr=/usr/local/apr/ \
–with-apr-util=/usr/local/apr-util/ –enable-rewrite –enable-expires \
–enable-authn-dbm –enable-vhost-alias –with-mpm=worker –with-ssl \
–disable-ipv6 –disable-cgid –disable-cgi

#phpのインストール
wget http://www.ijg.org/files/jpegsrc.v6b.tar.gz
wget http://download.sourceforge.net/libpng/libpng-1.6.2.tar.gz
wget http://download.savannah.gnu.org/releases/freetype/freetype-2.4.11.tar.gz
tar zxvf jpegsrc.v6b.tar.gz
./configure –enable-shared –enable-static &&make&&make install
tar jxvf libpng-1.2.10.tar.bz2
./configure &&make&&make install

tar jxvf freetype-2.3.9.tar.bz2
./configure && make && make install

./configure –with-apxs2=/usr/local/httpd/bin/apxs \
–prefix=/usr/local/php \
–with-config-file-path=/usr/local/php/etc \
–enable-mysqlnd –with-mysql=mysqlnd \
–with-mysqli=mysqlnd \
–with-pdo-mysql=mysqlnd –with-iconv-dir=/usr/local –with-freetype-dir \
–with-jpeg-dir –with-png-dir –with-zlib –with-libxml-dir=/usr –enable-xml \
–disable-rpath –enable-bcmath –enable-shmop –enable-sysvsem \
–enable-inline-optimization –with-curl –with-curlwrappers –enable-mbregex \
–enable-mbstring –with-mcrypt –with-gd –enable-gd-native-ttf –with-openssl \
–with-mhash –enable-pcntl –enable-sockets –with-ldap-sasl \
–with-xmlrpc –enable-zip –enable-soap –with-pear –with-zlib
make && make install

# httpd.confに下記内容を追加

SetHandler application/x-httpd-php

# install nginx

./configure –prefix=/usr/local/nginx \
–with-rtsig_module \
–with-poll_module \
–with-ipv6 \
–with-http_ssl_module \
–with-http_realip_module \
–with-http_addition_module \
–with-http_xslt_module \
–with-http_image_filter_module \
–with-http_sub_module \
–with-http_flv_module \
–with-http_gzip_static_module \
–with-http_random_index_module \
–with-http_secure_link_module \
–with-http_degradation_module \
–with-http_stub_status_module \
–with-pcre

##install php php-fpm

./configure –prefix=/usr/local/php54 –with-config-file-path=/usr/local/php54/etc \
–enable-mysqlnd –with-mysql=mysqlnd –with-mysqli=mysqlnd –enable-fpm \
–with-pdo-mysql=mysqlnd –with-iconv-dir=/usr/local –with-freetype-dir \
–with-jpeg-dir –with-png-dir –with-zlib –with-libxml-dir=/usr –enable-xml \
–disable-rpath –enable-bcmath –enable-shmop –enable-sysvsem –enable-inline-optimization \
–with-curl –with-curlwrappers –enable-mbregex –enable-mbstring –with-mcrypt \
–with-gd –enable-gd-native-ttf –with-openssl –with-mhash –enable-pcntl –enable-sockets \
–with-ldap-sasl –with-xmlrpc –enable-zip –enable-soap –with-pear –with-zlib

http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.13.tar.gz
#mysqlのインストール
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DSYSCONFDIR=/etc \
-DMYSQL_UNIX_ADDR=/tmp/mysqld.sock \
-DMYSQL_DATADIR=/data1/mysql_db -DEXTRA_CHARSETS=all \
-DDEFAULT_CHARSET=utf8 -DWITH_READLINE=ON -DWITH_SSL=system \
-DWITH_DEBUG=0 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DINSTALL_LAYOUT=STANDALONE -DENABLED_LOCAL_INFILE=1 \
-DENABLED_PROFILING=1 -DMYSQL_MAINTAINER_MODE=0 \
-DWITH_EMBEDDED_SERVER=1 -DMYSQL_TCP_PORT=3306 \
-DMYSQL_USER=mysql
make && make install

#add
[mysqld]
character-set-server = utf8

#エラー内容
#COLLATION 'latin1_swedish_ci’ is not valid for CHARACTER SET 'utf8’
#解決対策:
# ./scripts/mysql_install_db –user=mysql –collation-server=utf8_general_ci
#

configure: error: Cannot find OpenSSL’s or
in this case, the compiler wants to tell you that you haven’t the openSSL developer library installed. Do so by:
sudo apt-get install openssl-dev
on some systems, like Ubuntu Feisty, you might need to use this command:
sudo apt-get install libcurl4-openssl-dev

Source

Posted by arkgame