2013年1月28日月曜日

apache mod_suexec install 失敗

apache mod_suexec install

開発環境にてヴァーチャルホストで、
ユーザー、グループの違うディレクトリを参照したいため
mod_suexecを利用したいと考えインストールする。

rootになる
$sudo -s
apacheをインストールしたディレクトリに移動
#cd httpd-2.4.3/modules
moduleを探す
find . -name '*suexec*'

./generators/mod_suexec.c
./generators/mod_suexec.h
モジュールファイルに移動
cd generators
モジュールインストール
/home/httpd/bin/apxs -i -a -c mod_suexec.c


----------------------------------------------------------------------

# /home/httpd/bin/apxs -i -a -c mod_suexec.c
/home/httpd-2.4.3/build/libtool --silent --mode=compile gcc -std=gnu99 -prefer-pic   -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/home/httpd-2.4.3/include  -I/home/httpd-2.4.3/include   -I/home/httpd-2.4.3/include   -c -o mod_suexec.lo mod_suexec.c && touch mod_suexec.slo
/home/httpd-2.4.3/build/libtool --silent --mode=link gcc -std=gnu99    -o mod_suexec.la  -rpath /home/httpd-2.4.3/modules -module -avoid-version    mod_suexec.lo
/home/httpd-2.4.3/build/instdso.sh SH_LIBTOOL='/home/httpd-2.4.3/build/libtool' mod_suexec.la /home/httpd-2.4.3/modules
/home/httpd-2.4.3/build/libtool --mode=install install mod_suexec.la /home/httpd-2.4.3/modules/
libtool: install: install .libs/mod_suexec.so /home/httpd-2.4.3/modules/mod_suexec.so
libtool: install: install .libs/mod_suexec.lai /home/httpd-2.4.3/modules/mod_suexec.la
libtool: install: install .libs/mod_suexec.a /home/httpd-2.4.3/modules/mod_suexec.a
libtool: install: chmod 644 /home/httpd-2.4.3/modules/mod_suexec.a
libtool: install: ranlib /home/httpd-2.4.3/modules/mod_suexec.a
libtool: finish: PATH="/sbin:/bin:/usr/sbin:/usr/bin:/sbin" ldconfig -n /home/httpd-2.4.3/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /home/httpd-2.4.3/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
chmod 755 /home/httpd-2.4.3/modules/mod_suexec.so
[activating module `suexec' in /home/httpd-2.4.3/conf/httpd.conf]


インストールが出来たと思う。
確認のためdiffをとってみた

# diff httpd.conf httpd.conf.bak
146d145
< LoadModule suexec_module      modules/mod_suexec.so

成功

apacheの再起動
/home/httpd/apachectl restart

error、、、
SuexecUserGroup configured, but suEXEC is disabled: Missing suexec binary /home/httpd-2.4.3/bin/suexec

excite翻訳してみた。
-----------

形成されたSuexecUserGroup、しかし、suEXECは無効になります:
見当たらないsuexecの2進法の/home/httpd-2.4.3/ビン/suexec
------------

# ls -l /home/httpd-2.4.3/bin/suexec
ls: cannot access /home/httpd-2.4.3/bin/suexec: そのようなファイルやディレクトリはありません

suexecがない

調べてみたら、
デフォルトではsuexecはインストールされてないらしい。。

改めてapacheをインストールをしないといけないそうです。

参照
http://bitarts.jp/tech/linux/suexec.html


2013年1月4日金曜日

php インストール

php

freetype2
freetype-2.4.0.tar.gz
tar -zxmf freetype-2.4.0.tar.gz
cd freetype-2.4.0
./configure --enable-shared
make
sudo make install

libxml
ftp://xmlsoft.org/libxml2/
tar -zxmf libxml2-2.9.0.tar.gz
cd libxml2-2.9.0
./configure --enable-shared
make
sudo make install

zlib
http://sourceforge.net/projects/libpng/files/zlib/1.2.7/
tar -zxmf zlib-1.2.7.tar.gz
cd zlib-1.2.7
./configure --enable-shared
make
sudo make install

libpng
tar -zxmf libpng-1.5.13.tar.gz
cd libpng-1.5.13
./configure --prefix=/usr/local
make
make test
sudo make install

jpeg
http://www.ijg.org/files/
tar -zxmf jpegsrc.v8d.tar.gz
cd jpeg-8d/
./configure --prefix=/usr/local
sudo make install

php
http://php.net/get/php-5.4.10.tar.gz/from/a/mirror
tar -zxmf php-5.4.10.tar.gz
cd php-5.4.10

./configure \
--with-apxs2=/home/httpd/bin/apxs \
--with-gd \
--with-jpeg-dir=/usr/local/lib \
--with-png-dir=/usr/local/lib \
--with-zlib-dir=/usr/local/lib \
--with-freetype-dir=/usr/local \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-mysql=/usr/local/mysql \
--enable-mbstring \
--enable-mbregex \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-mcrypt \
--disable-posix-threads

error
configure: error: mcrypt.h not found. Please reinstall libmcrypt.

yum -y install libmcrypt-devel

make
make test
sudo make install

インストール後に書かれていた内容のメモ
-------------

Wrote PEAR system config file at: /usr/local/etc/pear.conf
You may want to add: /usr/local/lib/php to your php.ini include_path
/home/user/packages/php-5.4.10/build/shtool install -c ext/phar/phar.phar /usr/local/bin
ln -s -f /usr/local/bin/phar.phar /usr/local/bin/phar
Installing PDO headers:          /usr/local/include/php/ext/pdo/

--------------


cp php.ini-development /usr/local/lib/php.ini

/home/user/packages/php-5.4.10/build/shtool install -c ext/phar/phar.phar /usr/local/bin/




mysql インストール

mysql

http://www-jp.mysql.com/


sudo -s

サーバーのユーザー設定
groupadd mysql
useradd -g mysql mysql
passwd mysql
su - mysql
mkdir packages

サーバーにアップ
scp -P YourPort mysql-5.5.29.tar.gz user@host:~user/packages/

tar -zxmf mysql-5.5.29.tar.gz
cd mysql-5.5.29

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
make
sudo make install

cd /usr/local/mysql
chown -R mysql .
chgrp -R mysql .

./scripts/mysql_install_db --user=mysql


# ./scripts/mysql_install_db --user=mysql
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h hostname password 'new-password'

Alternatively you can run:
./bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd ./mysql-test ; perl mysql-test-run.pl

Please report any problems with the ./bin/mysqlbug script!



cd /etc/
mv my.cnf my.cnf.org

cd /usr/local/mysql
cp -i support-files/my-large.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysql.server

./bin/mysqladmin -u root password '******'
./bin/mysqladmin -u root -h hostname password '******'

./bin/mysql_secure_installation