各種アプリケーションのインストール - mitsuaki0717/shino-repo GitHub Wiki
- 前提RPMのインストール
# yum -y install pcre-devel
# yum -y install expat-devel
- porgインストール
# tar xzvf porg-0.8.tar.gz
# cd porg-0.8
# ./configure --prefix=/usr/local --disable-grop
# make && make install
# make logme
- 事前準備(APR)
# wget http://ftp.jaist.ac.jp/pub/apache//apr/apr-1.5.2.tar.gz
# tar zxvf apr-1.5.2.tar.gz
# cd apr-1.5.2
# ./configure --prefix=/opt/apr-1.5.2
# make
# porg -lD "make install"
# porg -a
- 事前準備(APR-Unit)
# wget http://ftp.jaist.ac.jp/pub/apache//apr/apr-util-1.5.4.tar.gz
# tar zxvf apr-util-1.5.4.tar.gz
# cd apr-util-1.5.4
# ./configure --prefix=/opt/apr-util-1.5.4 --with-apr=/opt/apr-1.5.2
# make
# porg -lD "make install"
# porg -a
事前準備3(PCRE)
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz
tar zxvf pcre-8.37.tar.gz
cd pcre-8.37
./configure --prefix=/opt/pcre-8.37
make
porg -lD "make install"
==================================================
アンインストール
# porg -a
python-3.6.1
# porg -r python-3.6.1
==================================================
Apache インストール
wget ftp://ftp.meisei-u.ac.jp/mirror/apache/dist/httpd/httpd-2.4.25.tar.gz
tar zxvf httpd-2.4.20.tar.gz
cd httpd-2.4.20
./configure --prefix=/opt/httpd-2.4.20 --with-apr=/opt/apr-1.5.2 --with-apr-util=/opt/apr-util-1.5.4 --with-pcre=/opt/pcre-8.37 --enable-so --enable-mods-shared=all --enable-proxy=shared --enable-proxy-ajp=shared --with-mpm=worker
make
porg -lD "make install"
======================================================================================================
======================================================================================================
■PHPのインストール
# yum install libxml2-devel
# tar zxvf php-7.1.7.tar.gz
# cd php-7.1.7
# ./configure --prefix=/usr/local/php7 --with-apxs2=/opt/httpd-2.4.20/bin/apxs
# make
# porg -lD "make install"
■PHPの設定
# vi /opt/httpd-2.4.20/conf/httpd.conf
以下の設定を追加
AddType application/x-httpd-php .html
<FilesMatch .php$>
SetHandler application/x-httpd-php
■Apacheの自動起動設定
# vi /etc/systemd/system/httpd.service
以下を記載
[Unit]
Description=The Apache2.4 HTTP Server
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
ExecStart=/opt/httpd-2.4.20/bin/httpd -k start
ExecReload=/opt/httpd-2.4.20/bin/httpd -k restart
ExecStop=/opt/httpd-2.4.20/bin/httpd -k stop
[Install]
WantedBy=multi-user.target
# chmod +x httpd.service
# systemctl daemon-reload
# systemctl start httpd.service
# systemctl enable httpd.service
========================================================
========================================================
yum -y remove mariadb-libs
RHEL6にRPMインストール
mysql-community-client-5.7.18-1.el6.x86_64.rpm
mysql-community-common-5.7.18-1.el6.x86_64.rpm
mysql-community-libs-5.7.18-1.el6.x86_64.rpm
mysql-community-libs-compat-5.7.18-1.el6.x86_64.rpm
mysql-community-server-5.7.18-1.el6.x86_64.rpm
上記のRPMをインストールする
RHEL7にRPMインストール mysql-community-client-5.7.19-1.el7.x86_64.rpm mysql-community-devel-5.7.19-1.el7.x86_64.rpm mysql-community-libs-5.7.19-1.el7.x86_64.rpm mysql-community-libs-compat-5.7.19-1.el7.x86_64.rpm mysql-community-common-5.7.19-1.el7.x86_64.rpm mysql-community-server-5.7.19-1.el7.x86_64.rpm RHEL6と同様
詳細は以下のURLを確認 https://dev.mysql.com/doc/refman/5.6/ja/linux-installation-yum-repo.html
yumを利用する場合は mysql57-community-release-el6-11.noarch.rpmをインストールすることでyumでのインストールが可能 yumを使う場合はDNSが必要 yum localinstall mysql57-community-release-el6-11.noarch.rpm
■初期設定 # systemctl start mysqld # cat /var/log/mysqld.log | grep 'password is generated'
[root@TEST-LAMP mysql]# mysql_secure_installation
Securing the MySQL server deployment.
Enter password for user root:
The existing password for the user account root has expired. Please set a new password.
New password:
Re-enter new password: The 'validate_password' plugin is installed on the server. The subsequent steps will run with the existing configuration of the plugin. Using existing password for root.
- rootのパスワード変更 Estimated strength of the password: 100 Change the password for root ? ((Press y|Y for Yes, any other key for No) : y
New password:
Re-enter new password:
Estimated strength of the password: 100 Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment.
- anonymousの削除 Remove anonymous users? (Press y|Y for Yes, any other key for No) : y Success.
Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network.
- リモートからのrootユーザでのログインの禁止 Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y Success.
By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment.
- testデータベースの削除 Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
-
Dropping test database... Success.
-
Removing privileges on test database... Success.
Reloading the privilege tables will ensure that all changes made so far will take effect immediately.
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Success.
All done!
# vi /etc/my.cnf 以下を追記 character-set-server=utf8 datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0
log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
[client] default-character-set=utf8
[mysqldump] default-character-set=utf8
[mysql] default-character-set=utf8
Pythonをインストールするためにzlib-develが必要になるためインストールしておく
\# yum install -y zlib-devel
\# cd /var/tmp
\# tar zxvf Python-3.6.1.tgz
\# cd Python-3.6.1
\# ./configure --enable-shared --enable-optimizations --with-ssl
\# make
\# porg -lD "make install"
※Pythonにssl Moduleを有効化する場合の手順
configureの後に以下を実施
# yum install openssl-devel
# find / -name openssl
/usr/bin/openssl
/usr/lib64/openssl
/usr/include/openssl
/usr以下にインストールされていることを確認
# vi Modules/Setup
以下の行を修正
SSL=/usr
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
$ python
import ssl
・インストール後の確認
以下の様なエラーが出た場合はライブラリが読み込めていないので、linkを作成する
[root@RBYDB01 ~]# python3
python3: error while loading shared libraries: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory
以下のコマンドで読み込めないライブラリを確認する
ldd /usr/local/bin/python3
[root@RBYAP01 ~]# ldd /usr/local/bin/python3
linux-vdso.so.1 => (0x00007ffc25ade000)
libpython3.6m.so.1.0 => not found
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fa89ff67000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fa89fd62000)
libutil.so.1 => /lib64/libutil.so.1 (0x00007fa89fb5f000)
libm.so.6 => /lib64/libm.so.6 (0x00007fa89f85d000)
libc.so.6 => /lib64/libc.so.6 (0x00007fa89f49a000)
/lib64/ld-linux-x86-64.so.2 (0x00007fa8a06a8000)
以下のコマンドでリンクを作成
ln -s /usr/local/lib/libpython3.6m.so.1.0 /lib64/
tar xzvf mod_wsgi-4.5.15.tar.gz cd mod_wsgi-4.5.15/ ./configure --with-python= /usr/local/bin/python3.6 make porg -lD "make install"
■■■ configureオプション ■■■ --enable-so Dynamic Shared Objectがモジュールをロードするために必要 --enable-mods-shared=all DSOが使用可能なモジュール全て --enable-proxy=shared プロキシの有効化 --enable-proxy-ajp=shared tomcatとの連携用 --with-mpm=worker マルチスレッドとマルチプロセスのハイブリッド型に設定
■■■ 注意 ■■■
makeで以下のエラーが出た場合は以下を実施(aprへのパスがうまく通っていない。)
libtool: link: cannot find the library /opt/pcre-8.37/lib/libapr-1.la' or unhandled argument
/opt/pcre-8.37/lib/libapr-1.la'
↓かをコピーすることで直接apacheにaprを持たせる。
cp -rp apr-1.5.2 /var/tmp/httpd-2.4.20/srclib/apr
cp -rp apr-util-1.5.4 /var/tmp/httpd-2.4.20/srclib/apr-util
・「--with-included-apr」のはaprがApacheにインクルードしてるよってオプション ./configure --with-included-apr --with-pcre=/opt/pcre-8.37 --enable-so --enable-mods-shared=all --enable-proxy=shared --enable-proxy-ajp=shared --with-mpm=worker make porg -lD "make install" porg -a
■■■ 注意 ■■■ RHEL7はwgetコマンドが標準でインストールされていないため以下のコマンドでインストールしておく yum install -y wget
installでこけた場合は1度「make clean」して再度インストールしてみる。
◆インストールが終わったら・・・ 確認してみよう!! ・Apacheの起動 sudo /usr/local/apache2/bin/apachectl start プロセスを確認 ps aux |grep httpd
ブラウザからも確認しよう・・・ windowsサーバからは見れなかった・・・
proxyの設定を変更すると見れる。 なぜだろう???
以下で停止 sudo /usr/local/apache2/bin/apachectl stop プロセスを確認 ps aux |grep httpd
=============== 以下は次回 =============== 自動起動設定 ダウンロードしたApacheのソース内に起動スクリプトがあるのでそれを使用する。 以下が起動スクリプト httpd-2.4.20/build/rpm/httpd.init
起動スクリプトを/etc/init.dに配置する(既存で存在する場合はリネームするor削除or移動) cp /var/tmp/httpd-2.4.20/build/rpm/httpd.init /etc/rc.d/init.d/httpd