1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

wp構築メモ

Last updated at Posted at 2019-08-04

WordPress構築のおおまかな流れ

1.CentOS7を用意する
2.各種パッケージをインストールする
3.ポート開放する
4.DBの設定をする
5.wordpressをインストールする
6.phpのバージョンアップをする
7.selinuxの設定など
8.wordpressへアクセスし、設定する
おおまかな手順は以上です。

パッケージをインストールする

Apache, PHP

# yum install httpd php php-mysql wget
---HTTPポート解放
# firewall-cmd --add-port=80/tcp --zone=public --permanent
# firewall-cmd --reload
# firewall-cmd --list-all --zone=public
# systemctl start httpd
# systemctl enable httpd

mariadbをインストールする

# yum install mariadb mariadb-server
# systemctl start mariadb
# systemctl enable mariadb

DBのパスワードを設定する

mysql -u root
MariaDB [(none)]> update mysql.user set password=password('$パスワードを自由に入力') where user = 'root';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit;

wordpress用のDBを作成する

# mysql -u root -p
# Enter password:
MariaDB [(none)]> create database wordpress;
MariaDB [(none)]> show databases;
MariaDB [(none)]> exit;

WordPressのインストールをする

wget https://ja.wordpress.org/latest-ja.tar.gz
# mv latest-ja.tar.gz /var/www/html/
# cd /var/www/html/
# tar -xzvf latest-ja.tar.gz 
# chown -R apache:apache wordpress

apacheの設定をする

# vi /etc/httpd/conf/httpd.conf

httpd.conf内を以下のように変更。

DocumentRoot "/var/www/wordpress"

httpd.conf内のどこかに以下を追記。

<Directory "/var/www/html/wordpress">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

phpのバージョンを5.6にする

# yum install epel-release
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
# sudo yum remove php-*
# sudo yum install --enablerepo=remi,remi-php56 php php-devel php-mbstring php-pdo php-gd php-xml php-mcrypt php-mysql

apacheを再起動する

# systemctl restart httpd

SELinuxを一時的に無効にする

# getenforce
Enforcing
# setenforce 0

wordpressの設定

ブラウザからhttp://xxx.xxx.xxx/wordpress/wp-adminもしくはhttp://xxx.xxx.xxxにアクセス

「さあ、始めよう」をクリックする

DBユーザー名とパスワードを入力して「送信」ボタンをクリックする

「インストール実行」をクリックする

SELinuxを再度有効化する

# setenforce 1

参考

1.https://qiita.com/pugiemonn/items/6f642ffb0165f69dab3d
2.https://qiita.com/heimaru1231/items/84d0beca81ca5fdcffd0
3.http://www.matsubarasystems.com/wordpress/wordpress-install-writeconfig-probrem

1
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?