いろいろ準備中

[ubuntu][VMWare] VMWare+UbuntuにApache,PHP,MySQLのインストール

5月 8th, 2008 Posted in linux, ubuntu

手持ちのwindowsマシンでlinuxを使いたくなったので、coLinuxを入れたがネットワークの設定がうまくいかなかったので、先日参加したPHP勉強会後の懇親会でちょっと話題に出たUbuntuインストールしてみた時のメモ。

vmware+Ubuntuは以前インストールしたことがあったので、ここまではすんなり。

続いてApache+PHP+MySQLの最新版をそれぞれインストールを行う。

・Apacheのインストール

2.2.8をインストール

$ tar zxvf httpd-2.2.8.tar.gz
$ cd httpd-2.2.8
$ ./configure --prefix=/usr/local/apache2 --with-mpm=worker --enable-module=so --enable-rewrite=shared --enable-ssl=shared --enable-dav=shared
 
…
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See 'config.log' for more details.
configure failed for srclib/apr

コンパイラーがないというエラーが出ました。ちょっと調べたところg++がないためのエラーのようです。以下のコマンドで、gccやmakeまでインストールされるようなのでこれを実行します。

$ sudo apt-get update
$ sudo aptitude install build-essential

もう一度configureをします。

$ ./configure --prefix=/usr/local/apache2 --with-mpm=worker --enable-module=so --enable-rewrite=shared --enable-ssl=shared --enable-dav=shared
…
no recognized SSL/TSL toolkit detected

今度はssl関連で引っかかったようなので、以下を実行します。

$ sudo apt-get install openssl libssl-dev

再度configureをします。うまくいったのでづつけてmake、make installします。

$ ./configure --prefix=/usr/local/apache2 --with-mpm=worker --enable-module=so --enable-rewrite=shared --enable-ssl=shared --enable-dav=shared
$ make
$ sudo make install

これでApacheのインストールは終了。

・MySQLのインストール

バージョン5.0.51

$ tar zxvf mysql-5.0.51b.tar.gz
$ cd mysql-5.0.51b
$ ./configure --prefix=/usr/local/mysql
...
checking for termcap functions library... configure: error: No curses/termcap library found

エラーが出たので、以下を実行してライブラリを入手

$ sudo apt-get install libncurses5 libncurses5-dev

もう一度configureから

$ ./configure --prefix=/usr/local/mysql
$ make
$ sudo make install

でインストール終了。

PHPのインストール

バージョン5.2.6

$ php-5.2.6.tar.gz
$ cd php-5.2.6
$ ./configure --with-apxs2=/usr/local/apache2/bin/apxs --enable-mbstring --enable-zend-multibyte --with-zlib --enable-memory-limit --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql=/usr/local/mysql
...
configure: error: xml2-config not found

エラーが出たので以下を実行

sudo apt-get install libxml2-dev

もう一度最初から

$ ./configure --with-apxs2=/usr/local/apache2/bin/apxs --enable-mbstring --enable-zend-multibyte --with-zlib --enable-memory-limit --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql=/usr/local/mysql
$ make
$ sudo make install

これでPHPも終了。

※configureオプションが違うと出るエラーも変わるので注意が必要です

コメントを投稿する