LoginSignup
1
2

More than 3 years have passed since last update.

インフラ知識低のレイヤから勉強(01)

Last updated at Posted at 2020-02-26

初めまして、潔(日本語の名)と申します。インフラ部は知識がありますが、バラバラです。具体的から勉強したことがありません。仕事の職場では大変ことがあります。考えているのはITエンジニアなら、インフラのことが知った方はいいともいますので、インフラの知識を調べて、メモを記入します。大先輩のオススメは低のレイヤの勉強から始まることです。下記の順番に記入する予定です。

一段階

1. Apacheをソースコードからコンパイルおよびインストール
2. PHPをSource Codeからコンパイルおよびインストール
3. MySQLをソースコードからコンパイルおよびインストール
4. PHP FrameworkをInstall

二段階

1. Apache、MySQL、PHPのインストール
2. PHP FrameworkをInstall

三段階

1. Dockerのインストール
2. Apache + PHP Containerの構築
3. MySQL Containerの構築
4. PHP FrameworkをInstall

四段階

1. KubernetesでPHP/MySQL Webをデプロイしてみます

じゃあ、上から最後まで進めていきましょう。

最初は環境を準備しなければならない。Vagrantをきめます。

■ Vagrant環境を準備

vagrant up
vagrant ssh

さて、Vagrant環境で操作していきます

■ Apache HTTP Server 2.4.34のソース展開

方法#1:サイトからプルしていきます

cd /usr/local/src
sudo wget http://www-us.apache.org/dist/httpd/httpd-2.4.34.tar.gz
sudo gzip -d httpd-2.4.34.tar.gz
sudo tar xvf httpd-2.4.34.tar

方法#2:Apacheのダウンロードのページにアクセスして、リンクをクリックします

リンク:https://httpd.apache.org/download.cgi

vagrant ssh
cd /var/www/devOps
sudo cp httpd-2.4.34.tar.gz /usr/local/src
cd /usr/local/src
tar zxvf httpd-2.4.34.tar.gz

■ APR と APR-Utilの準備
Apache Portable Runtimeのページにアクセスして、
・apr-1.5.2.tar.gz
・apr-util-1.5.4.tar.gz
をダウンロードします

cd /usr/local/src
sudo wget https://archive.apache.org/dist/apr/apr-1.5.2.tar.gz
sudo gzip -d apr-1.5.2.tar.gz
sudo tar xvf apr-1.5.2.tar
# 展開したディレクトリをApacheのsrclibディレクトリにコピー。
sudo cp -Rp apr-1.5.2 httpd-2.4.34/srclib/apr


sudo wget https://archive.apache.org/dist/apr/apr-util-1.5.4.tar.gz
sudo gzip -d apr-util-1.5.4.tar.gz
sudo tar xvf apr-util-1.5.4.tar
# 展開したディレクトリをApacheのsrclibディレクトリにコピー。
sudo cp -Rp apr-util-1.5.4 httpd-2.4.34/srclib/apr-util

■ configure実行

cd httpd-2.4.34
sudo ./configure

■ make・make installを実行します

sudo make
sudo make install

注意:インストールするときエラー

1。APRのインストールしていない

checking for APR... no
configure: error: APR not found.  Please read the documentation.

解決方法

APRのインストールしていきます
cd /usr/local/src
sudo wget https://archive.apache.org/dist/apr/apr-1.5.2.tar.gz
sudo gzip -d apr-1.5.2.tar.gz
sudo tar xvf apr-1.5.2.tar
# 展開したディレクトリをApacheのsrclibディレクトリにコピー。
sudo cp -Rp apr-1.5.2 httpd-2.4.34/srclib/apr

2。Perl-Compatible Regular Expressions Library(PCRE)をインストールしていない

checking for pcre-config... false
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/

解決方法#1
・pcre.orgサイトからpcreをダウンロードします
・プレフィックスをつけてコンパイルして、インストルします

vagrant ssh
cd /usr/local/src/
cd pcre.8.39
sudo ./configure --prefix=/usr/local/pcre
sudo make
sudo make install

・Apacheがインストールされているところで、pcreをつ使用してApacheをコンパイルします

cd http httpd-2.4.34
sudo ./configure --with-pcre=/usr/local/pcre
sudo make make install

解決方法#2
pcre-develをインストルするだけでした

# Fedora Linux
yum install -y pcre-devel

解決方法#3
RHEL3では、pcre-configを指します。

./configure --prefix=/usr/local/apache2 --with-pcre=/usr/local/pcre

これでApacheのインストールが完了しました。

次にいきましょう!

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2