11

Click here to load reader

サーバ構築実践入門

Embed Size (px)

DESCRIPTION

Linuxの勉強をはじめたばかりで、Webサーバなどつくったことがない人向け。 社内の勉強会の資料として使用しました。

Citation preview

Page 1: サーバ構築実践入門

サーバ構築実践田中優之

13年8月19日月曜日

Page 2: サーバ構築実践入門

アジェンダ

• はじめに

• Webサーバ構築

• DBサーバ構築

• memcachedサーバ構築

13年8月19日月曜日

Page 3: サーバ構築実践入門

はじめに今日は実際にいろいろサーバをつくってみます。以下に注目してください。

• 使用しているコマンド

• おおまかな作業の流れ

• それぞれの作業の意味、コマンドの意味

参考:https://github.com/masayuki5160

13年8月19日月曜日

Page 4: サーバ構築実践入門

Webサーバ構築• 環境について

• Cent OS 5.9

• apache

• php

• pear

• ethna

13年8月19日月曜日

Page 5: サーバ構築実践入門

Webサーバ構築# yum install httpd

# /etc/init.d/httpd starthttpd を起動中: [ OK ]

※ブラウザでアクセスしてapache起動チェック

# vi /var/www/html/index.htmlでためしにindex.htmlを作成

# yum install php# /etc/init.d/httpd restarthttpd を停止中: [ OK ]httpd を起動中: [ OK ][root@vagrant-c5-x86_64 vagrant]#

test用にphpinfo作成<?phpphpinfo();?>

13年8月19日月曜日

Page 6: サーバ構築実践入門

Webサーバ構築pearインストール# yum install php-pear

Ethna利用準備# pear channel-discover pear.ethna.jpAdding Channel "pear.ethna.jp" succeededDiscovery of channel "pear.ethna.jp" succeeded

# pear install -a ethna/ethnaethna/simpletest requires PEAR Installer (version >= 1.9.0), installed version is 1.4.9downloading Ethna-2.5.0.tgz ...Starting to download Ethna-2.5.0.tgz (241,455 bytes)..................................................done: 241,455 bytesdownloading DB-1.7.14.tgz ...Starting to download DB-1.7.14.tgz (133,103 bytes)...done: 133,103 bytesdownloading Smarty-2.6.26.tgz ...Starting to download Smarty-2.6.26.tgz (67,946 bytes)...done: 67,946 bytesinstall ok: channel://pear.ethna.jp/Smarty-2.6.26install ok: channel://pear.php.net/DB-1.7.14install ok: channel://pear.ethna.jp/Ethna-2.5.0

13年8月19日月曜日

Page 7: サーバ構築実践入門

DBサーバ構築

• 環境について

• Cent OS 5.9

• MySQL

13年8月19日月曜日

Page 8: サーバ構築実践入門

DBサーバ構築[root@vagrant-c5-x86_64 vagrant]# yum install mysql-serverLoaded plugins: fastestmirrorLoading mirror speeds from cached hostf

# /etc/init.d/mysqld start

[root@vagrant-c5-x86_64 vagrant]# mysql -u rootWelcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 2Server 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 itsaffiliates. Other names may be trademarks of their respectiveowners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

13年8月19日月曜日

Page 9: サーバ構築実践入門

memcachedサーバ構築

• 環境について

• Cent OS 5.9

• memcached

13年8月19日月曜日

Page 10: サーバ構築実践入門

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日月曜日

Page 11: サーバ構築実践入門

まとめ今回は最も簡単な方法を選択して構築しています。

環境がかわってきたり、ちょっと要求がかわったりするだけで一気に作業の難易度はかわってきたりします。日頃からいろいろやっているとすんなり解決できたりします。でもうまくできないことの方が多いですw

13年8月19日月曜日