WordPress (Ver. 4.9.6) をCentOS7xにInstall †更新日 2018-07-07 (土) 08:42:38
事前準備 †PHP7.2以上推奨のためPHP7.3をInstall EPEL と Remi のインストール †# yum update # yum install epel-release # rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
エンタープライズ Linux 用の拡張パッケージ(EPEL) は、 Red Hat Enterprise Linux (RHEL) 向けの高品質なアドオンパッケージであり、CentOS や Scientific Linux (SL) のような RHEL からスピンオフしたディストリビューションと互換性のある、Fedora プロジェクトで有志によって作成されたパッケージになります。
拡張のレポジトリのようだ。PHP7はこちらからインストールできるので追加する。
# ls -l /etc/yum.repos.d 合計 96 -rw-r--r--. 1 root root 1664 5月 17 22:53 CentOS-Base.repo -rw-r--r--. 1 root root 1309 5月 17 22:53 CentOS-CR.repo -rw-r--r--. 1 root root 649 5月 17 22:53 CentOS-Debuginfo.repo -rw-r--r--. 1 root root 630 5月 17 22:53 CentOS-Media.repo -rw-r--r--. 1 root root 1331 5月 17 22:53 CentOS-Sources.repo -rw-r--r--. 1 root root 4768 5月 17 22:53 CentOS-Vault.repo -rw-r--r--. 1 root root 314 5月 17 22:53 CentOS-fasttrack.repo -rw-r--r--. 1 root root 1050 10月 3 2017 epel-testing.repo -rw-r--r--. 1 root root 951 10月 3 2017 epel.repo -rw-r--r--. 1 root root 739 6月 12 2014 mirrors-rpmforge -rw-r--r--. 1 root root 717 6月 12 2014 mirrors-rpmforge-extras -rw-r--r--. 1 root root 728 6月 12 2014 mirrors-rpmforge-testing -rw-r--r--. 1 root root 446 6月 19 17:28 remi-glpi91.repo -rw-r--r--. 1 root root 446 6月 19 17:28 remi-glpi92.repo -rw-r--r--. 1 root root 446 6月 19 17:28 remi-glpi93.repo -rw-r--r--. 1 root root 456 6月 19 17:28 remi-php54.repo -rw-r--r--. 1 root root 1314 6月 19 17:28 remi-php70.repo -rw-r--r--. 1 root root 1314 6月 19 17:28 remi-php71.repo -rw-r--r--. 1 root root 1314 6月 19 17:28 remi-php72.repo -rw-r--r--. 1 root root 1314 6月 19 17:28 remi-php73.repo -rw-r--r--. 1 root root 750 6月 19 17:28 remi-safe.repo -rw-r--r--. 1 root root 2605 6月 19 17:28 remi.repo -rw-r--r--. 1 root root 1128 6月 12 2014 rpmforge.repo PHP7.2のインストール †# yum install --enablerepo=remi,remi-php72 php
# php --version PHP 7.2.7 (cli) (built: Jun 20 2018 08:21:26) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies WordPressで必要なパッケージをInstall †# yum install --enablerepo=remi,remi-php72 php php-mysql php-mbstring php-gd # systemctl restart httpd # firewall-cmd --zone=public --add-port=80/tcp --permanent success # firewall-cmd --zone=public --add-port=443/tcp --permanent success # firewall-cmd --reload success # firewall-cmd --list-all public (active) target: default icmp-block-inversion: no interfaces: ens32 sources: services: dhcpv6-client ssh ports: 443/tcp 80/tcp protocols: masquerade: no forward-ports: source-ports: icmp-blocks: rich rules: SSLを有効にする †# yum -y install mod_ssl
# httpd -M |grep ssl AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::20c:29ff:feb0:d6db. Set the 'ServerName' directive globally to suppress this message ssl_module (shared) # systemctl restart httpd 以下の自己認証作成方法がある。(参考) †MySQLのInstall †
$ rpm -qa | grep maria mariadb-libs-5.5.56-2.el7.x86_64 mariadb-5.5.56-2.el7.x86_64 mariadb-server-5.5.56-2.el7.x86_64 # yum remove mariadb-libs # rm -rf /var/lib/mysql/
# yum localinstall http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm # yum install mysql mysql-devel mysql-server mysql-utilities
# rpm -qa | grep mysql mysql-community-server-5.7.22-1.el7.x86_64 mysql-community-client-5.7.22-1.el7.x86_64 php-mysqlnd-7.2.7-1.el7.remi.x86_64 mysql-connector-python-8.0.11-1.el7.x86_64 mysql-community-common-5.7.22-1.el7.x86_64 mysql-community-libs-5.7.22-1.el7.x86_64 mysql57-community-release-el7-7.noarch mysql-utilities-1.6.5-1.el7.noarch mysql-community-devel-5.7.22-1.el7.x86_64 # mysqld --version mysqld Ver 5.7.22 for Linux on x86_64 (MySQL Community Server (GPL)) 初期化 †# mysqld --user=mysql --initialize
# systemctl enable mysqld.service
# systemctl start mysqld.service # systemctl status mysqld.service ● mysqld.service - MySQL Server Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled) Active: active (running) since 木 2018-06-28 17:14:35 JST; 18s ago Docs: man:mysqld(8) http://dev.mysql.com/doc/refman/en/using-systemd.html Process: 4313 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS) Process: 4289 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS) Main PID: 4315 (mysqld) Tasks: 27 CGroup: /system.slice/mysqld.service mq4315 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mys... 6月 28 17:14:31 vmcent7x systemd[1]: Starting MySQL Server... 6月 28 17:14:35 vmcent7x systemd[1]: Started MySQL Server.
# grep password /var/log/mysqld.log 2018-06-28T08:13:02.625203Z 1 [Note] A temporary password is generated for root @localhost: xE(s4btdxyGw ← これが初期パスワード 2018-06-28T08:16:19.854629Z 2 [Note] Access denied for user 'root'@'localhost' (using password: NO) 2018-06-28T08:16:59.959866Z 3 [Note] Access denied for user 'root'@'localhost' (using password: NO)
# mysql -u root -p Enter password: mysql> SET PASSWORD = PASSWORD('*********'); Query OK, 0 rows affected, 1 warning (0.00 sec) my.cnf に追記 †[mysqld]ブロックに以下を追記 character-set-server = utf8 default_password_lifetime = 0 # systemctl restart mysql WordPress用DBの作成 †# mysqladmin -u root -p create wordpress Enter password: WordPressのInsatll †wordpress-4.9.6-ja.tar.gz解凍後/var/wwww/html/wpにコピー
以下にアクセス FTPの変わりにSSH利用するためのプラグインのインストール †WordPressでプラグインやテーマのインストールにSSHを利用 ssh-sftp-updater-support.0.7.3.zip をインストール FTPの有効化 †ssh-sftp-updater-supportをインストールするために必要、ssh-sftp-updater-supportインストール後はFTPの変わりにssh-sftp-updater-supportを使用する # systemctl start vsftpd テーマのインストールと有効化は自分のWPサーバにFTP等で接続する †
管理画面のURL †パーマリンクタグには日本語が使用できないときは以下のタグを利用する †
%year% 投稿年 %monthnum% 投稿月 %day% 投稿日 %hour% 投稿時刻の時 %minute% 投稿時刻の分 %second% 投稿時刻の秒 %postname% 投稿タイトル(投稿スラッグ) %post_id% 投稿ID %category% カテゴリー名(カテゴリースラッグ) %tag% タグ名(タグスラッグ) %author% 著者名 SiteGuard WP Plugin †サイトのセキュリティアップのためのプラグイン
<Directory "/var/www/html"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews (略) # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # ##AllowOverride None AllowOverride All ←ここ
$ httpd -M | grep rewrite AH00558: httpd: Could not reliably determine the server's fully qualified \ domain name, using fe80::20c:29ff:feb0:d6db. Set the 'ServerName' directive \ globally to suppress this message rewrite_module (shared) ←ここ 設定が保存できない対処法(サーバで画像認証の設定がONにできない) $ cd wp/wp-content/plugins/siteguard/really-simple-captcha $ mkdr tmp $ chmod 777 tmp Fooderの「WordPress・・・・・」削除 †
/** Edit by JE2ISM $powered = '<div id="powered">Powered by <a href="' . $wpUrl . '" target="_blank">WordPress</a> & '; $powered .= '<a href="' . $themeUrl . '" target="_blank">saitama Theme</a> by Commnitycom,Inc.</div>'; $powered = apply_filters( 'custom_powered', $powered ); */ 投稿の作成者氏名非表示 †
the_author_posts_link() function the_author_posts_link( $deprecated = '' ) { if ( ! empty( $deprecated ) ) { _deprecated_argument( __FUNCTION__, '2.1.0' ); } // echo get_the_author_posts_link(); ←コメントアウト } 地図のページ作成(固定ページに) †「西林野巫の会」へのアクセス [map addr="三重県松阪市大黒田町XXXX-X" width="800px" height="400px" zoom="16"] |