2016年9月24日 星期六

[研究] WordPress 4.6.1 部落格伺服器架設 (CentOS 7.2 x64)(繁體中文版)

[研究] WordPress 4.6.1 部落格伺服器架設 (CentOS 7.2 x64)(繁體中文版)

2016-09-24

WordPress 台灣正體中文網站
http://tw.wordpress.org/

安裝參考
http://tw.wordpress.org/txt-install/

下載
https://tw.wordpress.org/wordpress-4.6.1-zh_TW.tar.gz


# 建立 WordPress 系統使用的資料庫,稱為 wordpressdb,連線帳號 wordpresser,密碼 123456
(可以依自己喜好修改)

安裝

# 立刻關閉 SELinux
/usr/sbin/setenforce 0 

# 設定 reboot 後也關閉 SELinux
sed -i -e "s@SELINUX=enforcing@#SELINUX=enforcing@" /etc/selinux/config
sed -i -e "s@SELINUX=permissive@#SELINUX=permissive@" /etc/selinux/config
sed -i -e "/SELINUX=/aSELINUX=disabled" /etc/selinux/config

yum  -y install php php-mysql mysql httpd mariadb-server

#chkconfig httpd on
#service httpd restart
systemctl enable httpd
systemctl start httpd
systemctl status httpd

#chkconfig mysqld on
#service mysqld restart
systemctl enable mariadb
systemctl  start  mariadb
systemctl  status  mariadb


# 替 MySQL 的 root 帳號設定密碼
/usr/bin/mysql_secure_installation

[root@localhost ~]# /usr/bin/mysql_secure_installation
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n]
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n]
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n]
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n]
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n]
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
[root@localhost ~]#


# 建立 WordPress 系統使用的資料庫,稱為 wordpressdb,連線帳號 wordpresser,密碼 123456
(可以依自己喜好修改)

[root@localhost ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 5.5.50-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database wordpressdb;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all privileges on wordpressdb.* to wordpresser@localhost identified by '123456';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]>  flush privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit
Bye
[root@localhost ~]#


# 假設 MySQL root 的密碼為 ABCDE
mysqladmin --user=root  -pABCDE  create wordpressdb
# 建立使用者 galerauser,密碼 123456,給 Cluster 使用
mysql -e "GRANT ALL PRIVILEGES ON *.* TO wordpresser@localhost IDENTIFIED BY '123456' ; " -pABCDE
#mysql -e "GRANT ALL PRIVILEGES ON *.* TO wordpresser@% IDENTIFIED BY '123456' ; " -pABCDE
mysql -e " flush privileges; " -pABCDE

mysql -uroot -pABCDE -e "show databases;"
#mysql -e -uroot  -pABCDE "use wordpressdb; show databases; "
#mysql -e "use wordpressdb; show tables; "
#mysql -e "GRANT ALL PRIVILEGES ON wordpressdb.* TO wordpresser@localhost IDENTIFIED BY 'wordpresser' ; "
#mysql -e " flush privileges; "
#mysql -e "use mysql; select * from user where User='wordpresser'; "

cd    /usr/local/src
wget   https://tw.wordpress.org/wordpress-4.6.1-zh_TW.tar.gz
tar   xzvf   wordpress-4.6.1-zh_TW.tar.gz    -C   /var/www/html
# 為了寫入 wp-config.php
chmod  -R a+w /var/www/html/wordpress
#touch /var/www/html/wordpress/wp-config.php
#chmod   a+w /var/www/html/wordpress/wp-config.php

# 啟動瀏覽器,連上網站
firefox   httpd://192.168.128.71/wordpress










(完)

[研究] WordPress 4.6.1 部落格伺服器架設 (CentOS 7.2 x64)(繁體中文版)
http://shaurong.blogspot.com/2016/09/wordpress-461-centos-72-x64.html

[研究] WordPress 4.2.2 部落格伺服器架設 (CentOS 7.1 x64)(繁體中文版)(失敗)
http://shaurong.blogspot.com/2015/06/wordpress-422-centos-71-x64.html

[研究] WordPress 4.2.2 部落格伺服器架設 (CentOS 6.6 x64)(繁體中文版)
http://shaurong.blogspot.com/2015/06/wordpress-422-centos-66-x64.html

[研究] WordPress 3.8.1 部落格伺服器架設 (CentOS 6.5 x64)(繁體中文版)
http://shaurong.blogspot.com/2014/01/wordpress-381-centos-65-x64.html

[研究] WordPress 3.7 部落格伺服器架設 (CentOS 6.4 x64)(繁體中文版)
http://shaurong.blogspot.tw/2013/10/wordpress-27-centos-64-x64.html

[研究] WordPress網誌 快速安裝程式(CentOS 5.5 x86)
http://forum.icst.org.tw/phpbb/viewtopic.php?t=19279

沒有留言:

張貼留言