lamp環境をインストールする(centos)
TRANSCRIPT
![Page 1: lamp環境をインストールする(centos)](https://reader036.vdocuments.pub/reader036/viewer/2022080214/55a94c7d1a28abd5248b4710/html5/thumbnails/1.jpg)
Lapp環境
(Apahe,MySQL,PHP)インストール
- CentOS環境 -
![Page 2: lamp環境をインストールする(centos)](https://reader036.vdocuments.pub/reader036/viewer/2022080214/55a94c7d1a28abd5248b4710/html5/thumbnails/2.jpg)
Apache2のインストール
● パッケージインストール# yum install httpd
● 設定ファイル変更# vi /etc/httpd/conf/httpd.conf
● Apacheの起動/終了/再起動/ステータス確認# /etc/init.d/httpd start# /etc/init.d/httpd stop# /etc/init.d/httpd restart# /etc/init.d/httpd status(注)リモートの場合はsystem-config-firewallで、ポート80番を開ける必要がある
● DocumentRootのユーザの変更# chown ユーザ名.グループ名 /var/www/html
![Page 3: lamp環境をインストールする(centos)](https://reader036.vdocuments.pub/reader036/viewer/2022080214/55a94c7d1a28abd5248b4710/html5/thumbnails/3.jpg)
MySQLインストール● パッケージインストール
# yum install mysql-server● セキュリティの設定
# mysql_secure_installation
● MySQLの起動/終了/再起動/ステータス確認# /etc/init.d/mysqld start# /etc/init.d/mysqld stop# /etc/init.d/mysqld restart# /etc/init.d/mysqld status
● 接続の確認$ mysql -u root -p
● データベースの作成mysql> create database wp;
● ユーザの作成mysql> grant all on wp.* to wp@localhost identified by 'wp';
● Wpでの接続確認$ mysql -u wp -D wp -p
![Page 4: lamp環境をインストールする(centos)](https://reader036.vdocuments.pub/reader036/viewer/2022080214/55a94c7d1a28abd5248b4710/html5/thumbnails/4.jpg)
PHPのインストール
● パッケージインストール# yum install php
● phpとMySQLを連携させるパッケージのインストール# yum install php-mysql
● その他のパッケージのインストール# yum install php-pear php-gd php-xml
● Apacheの再起動#/etc/init.d/httpd restart
● 動作確認$ vi /var/www/html/workspace/index.php(以下の行を追加)<?php phpinfo(); ?>=> ブラウザでアクセスして、phpのパラメータの表が正常に表示されることを確認
![Page 5: lamp環境をインストールする(centos)](https://reader036.vdocuments.pub/reader036/viewer/2022080214/55a94c7d1a28abd5248b4710/html5/thumbnails/5.jpg)
phpMyAdminのインストール
● EPELをWGETして、インストール# wget http://ftp-srv2.kddilabs.jp/Linux/distributions/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
#rpm -ivh epel-release-6-8.noarch.rpm● インストール
# yum --enablerepo=epel install phpMyAdmin
● Apache再起動# /etc/init.d/httpd restart
● ブラウザでアクセスし、動作確認