The construction of a simple forum (Discuz), memchche, OpenResty (like nginx)

1. Construction of a simple forum (from Lao Wu Discuz_X3.2_SC_UTF8.zip)
1. unzip Discuz_X3.2_SC_UTF8.zip##Unzip

2. cd readme/
less readme.txt ##View the installation process

3 . mv upload/ /usr/local/lnmp/nginx/html/bbs

4 . cd /usr/local/lnmp/nginx/html/bbs
chmod 777 config/ data/ uc_client/ uc_server/ -R

5. cd /usr/local/lnmp/php/etc/
vim php.ini (modified as follows) 6. After changing the configuration file, refresh the service and check the port

1001 pdo_mysql.default_socket= /usr/local/lnmp/mysql/data/mysql.sock
1150 mysql.default_socket = /usr/local/lnmp/mysql/data/mysql.sock
1210 mysqli.default_socket = /usr/local/lnmp/mysql/data/mysql.sock

/etc/init.d/php-fpm reload
to view port 9000: netstat -antlp | grep :9000

tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 7491/php-fpm

7.chmod 755 /usr/local/lnmp/mysql/data/##At this time, the webpage only has permission to have the following content
[root@server1 etc]# ll -d /usr/local/lnmp/mysql/data/
drwxr- xr-x 5 mysql root 4096 Jul 21 11:17 /usr/local/lnmp/mysql/data/

2. The addition of the memchche module for the fast extension of the php function module (download the compressed package of mamcache from Lao Wu)
Memcache is an open source project of danga.com. It is a high-performance distributed memory object caching system. It maintains a unified huge Hash table, which can be used to store data in various formats. It can be compared to services such as MySQL, and the Memcache extension of PHP is actually the way to connect to Memcache.

1. View the previous environment status
rpm -qa | grep php
yum remove -y rpm -qa | grep php##The previous installation with yum will overwrite subsequent operations
rpm -qa | grep php
rpm -qa | grep mysql
rpm -qa | grep httpd
php -m | grep memcached##It shows that there is no /usr/bin/php
tar zxf memcache-2.2.5.tgz ##Unzip memc
cd /root/memcache-2.2.5
ls
phpize##php expand after compilation Module (add memc module to the previously compiled php)

[root@server1 memcache-2.2.5]# phpize
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226

2../configure##Compile
make##Make it generate executable file
make install
cd /usr/local/lnmp/php/lib/php/extensions/no-debug-non-zts-20131226/
ls

3.php -m | grep memcache##Detecting whether the memcache module is expanded
Logically speaking, there will be no error "saying there is no /usr/bin/php directory" at this time, but it appears when I do it, restart the machine, It was successful again (maybe the operation and maintenance restart Dafa)
cd /usr/local/lnmp/php/etc/

    vim php.ini

*extension = memcache.so##Add a line by hand (write the extension module of memcache to the ini file)


   /etc/init.d/php-fpm reload

php -m | grep memcache##这个时候是成功的

4.
/etc/init.d/memcached start
netstat -antlp | grep :11211 (it shows that port 11211 is monitored by memcache)
tcp 0 0 0.0.0.0:11211 0.0.0.0:* LISTEN 10327/memcached
tcp 0 0 :::11211 :::* LISTEN 10327/memcached

5. yum install -y telnet## for testing
cd /root/memcache-2.2.5
cp example.php /usr/local/lnmp/nginx/html/
cp memcache.php /usr/local/lnmp/nginx/html /

cd /usr/local/lnmp/nginx/html/
vim memcache.php


define('ADMIN_USERNAME','admin');       // Admin Username
define('ADMIN_PASSWORD','westos');      // Admin Password
define('DATE_FORMAT','Y/m/d H:i:s');
define('GRAPH_SIZE',200);
define('MAX_ITEM_DUMP',50);

$MEMCACHE_SERVERS[] = '127.0.0.1:11211'; // add more as an array
//$MEMCACHE_SERVERS[] = 'mymemcache-server2:11211'; // add more as an array

6. OpenResty (like nginx)
integrates various well-designed Nginx modules, so that Nginx effectively becomes a powerful general-purpose web application platform.

1.get openresty_1.11.2.3.tar.gz (from Lao Wu)
First turn off nginx (nginx -s stop) - the function of this application is the same as nginx. Port conflict
tar zxf openresty_1.11.2.3.tar.gz

2. Compile (three steps)
cd openresty_1.11.2.3/
./configure (default installation path: /usr/local/openresty)
gmake && gmake install

  1. /usr/local/openresty/nginx/
    vim nginx.conf
    a. Remove the comment on the first line: user nginx;
    b. Change the maximum number of connections per worker to: 65535 (arbitrary)
    c. Change the http server Add keepalive 512 for port 11211 of the local machine
    ; under server

4. Check if the port is open: netstat -antlp | grep :11211

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325768470&siteId=291194637