0

wp構築メモ

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

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away