2015年6月4日 星期四

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

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

2015-06-04
Lu

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

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

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


安裝

# 立刻關閉 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 mysql-server

chkconfig httpd on
service httpd restart

chkconfig mysqld on
service mysqld restart


# 替 MySQL 的 root 帳號設定密碼 (下面假設設定為 ABCDE)
/usr/bin/mysql_secure_installation

[root@localhost ~]# /usr/bin/mysql_secure_installation


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


In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, 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 MySQL
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 MySQL installation has an anonymous user, allowing anyone
to log into MySQL 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, MySQL 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 MySQL
installation should now be secure.

Thanks for using MySQL!


[root@localhost ~]#


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

[root@localhost ~]# mysql -u root -pABCDE

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

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

mysql> create database wordpressdb;
Query OK, 1 row affected (0.00 sec)

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

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> 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.2.2-zh_TW.tar.gz
tar   xzvf   wordpress-4.2.2-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.66/wordpress











最後把權限改回
chmod a-w /var/www/html/wordpress

(完)

[研究] 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

沒有留言:

張貼留言