サーバ構築実践
田中優之
13年8月19日月曜日
アジェンダ
• はじめに
• Webサーバ構築
• DBサーバ構築
• memcachedサーバ構築
13年8月19日月曜日
はじめに
今日は実際にいろいろサーバをつくってみま
す。以下に注目してください。
• 使用しているコマンド
• おおまかな作業の流れ
• それぞれの作業の意味、コマンドの意味
参考:https://github.com/masayuki5160
13年8月19日月曜日
Webサーバ構築
• 環境について
• Cent OS 5.9
• apache
• php
• pear
• ethna
13年8月19日月曜日
Webサーバ構築
# yum install httpd
# /etc/init.d/httpd start
httpd を起動中: [ OK ]
※ブラウザでアクセスしてapache起動チェック
# vi /var/www/html/index.htmlでためしにindex.htmlを作成
# yum install php
# /etc/init.d/httpd restart
httpd を停止中: [ OK ]
httpd を起動中: [ OK ]
[root@vagrant-c5-x86_64 vagrant]#
test用にphpinfo作成
<?php
phpinfo();
?>
13年8月19日月曜日
Webサーバ構築
pearインストール
# yum install php-pear
Ethna利用準備
# pear channel-discover pear.ethna.jp
Adding Channel "pear.ethna.jp" succeeded
Discovery of channel "pear.ethna.jp" succeeded
# pear install -a ethna/ethna
ethna/simpletest requires PEAR Installer (version >= 1.9.0), installed version is 1.4.9
downloading Ethna-2.5.0.tgz ...
Starting to download Ethna-2.5.0.tgz (241,455 bytes)
..................................................done: 241,455 bytes
downloading DB-1.7.14.tgz ...
Starting to download DB-1.7.14.tgz (133,103 bytes)
...done: 133,103 bytes
downloading Smarty-2.6.26.tgz ...
Starting to download Smarty-2.6.26.tgz (67,946 bytes)
...done: 67,946 bytes
install ok: channel://pear.ethna.jp/Smarty-2.6.26
install ok: channel://pear.php.net/DB-1.7.14
install ok: channel://pear.ethna.jp/Ethna-2.5.0
13年8月19日月曜日
DBサーバ構築
• 環境について
• Cent OS 5.9
• MySQL
13年8月19日月曜日
DBサーバ構築
[root@vagrant-c5-x86_64 vagrant]# yum install mysql-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostf
# /etc/init.d/mysqld start
[root@vagrant-c5-x86_64 vagrant]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 2
Server version: 5.0.95 Source distribution
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql>
13年8月19日月曜日
memcachedサーバ構築
• 環境について
• Cent OS 5.9
• memcached
13年8月19日月曜日
memcachedサーバ構築
# yum install libevent libevent-devel
# wget http://memcached.googlecode.com/files/memcached-1.4.15.tar.gz
# tar xzvf memcached-1.4.15.tar.gz
# cd memcached-1.4.15
#./configure
# make
# make install
13年8月19日月曜日
まとめ
今回は最も簡単な方法を選択して構築していま
す。
環境がかわってきたり、ちょっと要求がかわっ
たりするだけで一気に作業の難易度はかわって
きたりします。日頃からいろいろやっていると
すんなり解決できたりします。でもうまくでき
ないことの方が多いですw
13年8月19日月曜日

サーバ構築実践入門