centOS7でのサーバ手順

完全なるメモです。

概要

# cat /etc/*release
CentOS Linux release 7.6.1810 (Core) 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

CentOS Linux release 7.6.1810 (Core) 
CentOS Linux release 7.6.1810 (Core) 

httpdインストール

#  yum install httpd
# systemctl start httpd.service
# systemctl enable httpd.service
# systemctl stop firewalld
  Failed to stop firewalld.service: Unit firewalld.service not loaded.
# systemctl stop iptables

phpインストール

# yum install php php-mbstring php-mysql
とすると、php5系が入ってしまうので、以下の手順

# yum -y install http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
<span style="color: #dd830c"># yum info --enablerepo=remi,remi-php73 php
# yum info --enablerepo=remi,remi-php73 php php-mbstring php-xml php-xmlrpc php-gd php-pdo php-pecl-mcrypt php-mysqlnd php-pecl-mysql</span>
# yum -y install --enablerepo=remi,remi-php73 php php-mbstring php-xml php-xmlrpc php-gd php-pdo php-pecl-mcrypt php-mysqlnd php-pecl-mysql
# systemctl restart httpd.service

この色の部分は、パッケージの詳細を確認しています(インストールはしてない)

php確認

# cd /var/www/html/
# vi test.php

test.phpには以下の文を書き込み


IPアドレス/test.phpにアクセス
f:id:harucharuru:20210412140110p:plain

phpMyAdminインストール

# yum -y install http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
# yum install mysql-server
# systemctl start mysqld.service
# systemctl enable mysqld.service
# yum install epel-release
<span style="color: #dd830c"># yum info --enablerepo=remi,remi-php73 phpMyAdmin </span>
# yum -y install  --enablerepo=remi,remi-php73 phpMyAdmin 
# systemctl restart httpd.service

あとは、
Cloud Computing System.lab: CentOS7 phpMyAdminのインストール
を参考にしつつ、phpMyAdmin.confの変更は、
phpMyAdminの設定(CentOS 7) | さくらインターネットのVPS設定マニュアル
を参考にしました。