This experiment requires three servers:
Three servers are as follows:
192.168.1.155 Installing the LAP environment
192.168.1.156 installing the MySQL Database
192.168.1.135 Installing the Redis cache server
1.yum Installing the AP Environment:
Yum install httpd httpd-devel php php-devel php-mysql-y
2. The installation database is described in the following links:
http://jiaxinwang.blog.51cto.com/12273793/1935065
3. Start the HTTPD service
Systemctl Start httpd
4. Turn off the firewall and SELinux service or add the appropriate ports
Systemctl Stop Firewalld
Setenforce 0
5. Download Discuz website template (download in/var/www/html directory)
wget Http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_UTF8.zip
6. Unzip
Unzip Discuz_x3.2_sc_utf8.zip
Because the site code is upload, move the upload folder file to the Publish directory
7. The discovery directory does not exist and is not writable;
Chmod-r 757 data/config/uc_client/uc_server/
8. Locate the config_global.php file modification file in the Publish directory
Catalog:/var/www/html/config
Modified to:$_config[' db ' [' 1 '] [' dbhost '] = ' 192.168.1.156 ';
9. Create a Database
Database name: IP or domain name of the server 192.168.1.156
Database name: Create a database in the database
Database user name: root
Database Password: 123456
Add a password, other default
command to create a database: creating databases Discuz;
10. When the next step occurs when the host ' 192.168.1.156 ' is not allowed to connect with this MySQL server error;
WORKAROUND: Give the database root a permission to access remotely
Grant all on * * to [e-mail protected] '% ' identified by ' 123456 ';
Then solve the problem, next, wait for the installation to complete!
11. Download Redis This experiment is using the redis-2.8.18
Decompression: Tar zvxf redis-2.8.18.tar.gz
Go to Unzip directory: CD redis-2.8.18/
Precompiled: Make Prefix=/usr/local/redis Install
Installation: Make && make install
12. Make a soft connection to the file of the bin file of the installation directory under/usr/bin/
Ln-s/usr/local/redis/bin/*/usr/bin/
13. Copy the redis.conf configuration file to the installation directory under the Unzip directory
cp/root/redis-2.8.18/redis.conf/etc/redis/
14. Start Redis
Enter configuration file
Vim/etc/redis/redis.conf
Change Daemonize No to daemonize Yes
Save, exit
Boot-up configuration file redis-server/etc/redis/redis.conf
Ps-ef | grep Redis
Root 53762 1 0 17:53? 00:00:06 Redis-server *:6379
Root 54130 1700 0 18:24 pts/0 00:00:00 grep--color=auto Redis
15. Modify the config_global.php file to the Publish directory
/var/www/html/config
$_config[' memory ' [' Redis '] [' server '] = ' 192.168.1.135 '; # # # #改为redis服务器IP地址
16. Enter redis-cli into Redis on Redis server
Click anywhere on the forum (Generate keys) and enter keys * on the REDIS server to see the keys value
Found no because PHP does not have a Redis module, to add the Phpredis module
(Do a PHP test page, if you cannot find the Redis instructions do not have a Redis module)
17. Download and install Phpredis
wget https://github.com/phpredis/phpredis/archive/3.1.2.tar.gz
Tar zvxf 3.1.2.tar.gz
CD PHPREDIS-3.1.2/
Phpize (PHP initialization)
./configure--with-php-config=/usr/bin/php-config--enable-redis (pre-compiled)
Make && make install (installation)
18. Add a Redis module to the PHP configuration file
Vim/etc/php.ini
Extension_dir = "/usr/lib64/php/modules/"
Extension=redis.so
18. Restart the httpd service
Systemctl Restart httpd
19. Go to the forum a few clicks, generate the keys value, and then go to Redis to see if there is no keys value generated
KEYS *
1) "69zeig_cronpublish"
2) "69zeig_globalstick"
3) "69zeig_usergroup_19"
4) "69zeig_usergroup_18"
5) "69zeig_threadtable_info"
6) "69zeig_smilies"
7) "69zeig_usergroup_16"
8) "69zeig_userstats"
9) "69zeig_pluginlanguage_system"
"69zeig_usergroup_5"
................................
127.0.0.1:6379>
Note: Firewalls and Setenforce
This article from "Hing" blog, declined reprint!
Lamp+redis Building Discuz Forum