Next to the previous article, I spoke little nonsense about the actual situation. For more information, see compile and install Lamp 1.
General binary installation of MySQL-5.5.38
2. Install MySQL
# Create a MySQL user and group [email protected] ~] # Groupadd-r MySQL [[email protected] ~] # Useradd-r-g mysql-S/sbin/nologin MySQL # directory planning [email protected] ~] # Mkdir-PV/mydata/datamkdir: Created directory '/mydata' mkdir: Created directory'/mydata/data' [[email protected] ~] # Chown-r MYSQL: mySQL/mydata/data/# decompress the source package [[email protected] Lamp] # tar xf mysql-5.5.38-linux2.6-i686.tar.gz-C/usr/local/src [[email protected] Lamp] # cd/usr /local/[[email protected] local] # ln-SV src/mysql-5.5.38-linux2.6-i686 MySQL 'mysql'-> 'src/mysql-5.5.38-linux2.6-i686 '# initialize the database [[email protected] local] # cd mySQL/[[email protected] MySQL] # scripts/mysql_install_db -- basedir =/usr/local/MYS QL -- datadir =/mydata/data -- user = MySQL [[email protected] MySQL] # chown-r root: root/usr/local/src/mysql-5.5.38-linux2.6-i686/# provide the configuration file and Service Startup Script [[email protected] MySQL] # cp support-files/MySQL. server/etc/init. d/mysqld [[email protected] MySQL] # chkconfig -- add mysqld [[email protected] MySQL] # chkconfig mysqld on [[email protected] MySQL] # cp support-files/my-medium.cnf /etc/My. CNF # edit the configuration file [[email prot Ected] MySQL] # vi/etc/My. CNF # The following options will be passed to all MySQL clients [client] # Password = your_passwordport = 3306 socket =/tmp/MySQL. sockcharacter-set-Server = utf8 # Here follows entries for some specific programs # the MySQL server [mysqld] Port = 3306 socket =/tmp/MySQL. sockpid-file =/mydata/data/mysqld. pidcharacter-set-Server = utf8collation-server = utf8_unicode_cibasedir = /Usr/local/mysqldatadir =/mydata/datauser = mysqlskip-name-resolve # Start MySQL service [[email protected] ~] # Service mysqld startstarting MySQL... success! [[Email protected] ~] # Netstat-tulpn | grep 3306tcp 0 0 0.0.0.0: 3306 0.0.0.0: * Listen 708/mysqld [[email protected] ~] # Vi/etc/profile. d/MySQL. shexport Path = $ path:/usr/local/MySQL/bin [[email protected] ~] #./Etc/profile. d/MySQL. Sh [[email protected] ~] #/Usr/local/MySQL/bin/mysql_secure_installation [[email protected] ~] # Vim/etc/man. configmanpath/usr/local/MySQL/MAN [[email protected] ~] # Ln-SV/usr/local/MySQL/include // usr/include/MySQL '/usr/include/mysql'->'/usr/local/MySQL/include /' [[email protected] ~] # Vi/etc/lD. So. conf. d/MySQL. conf [[email protected] ~] #/Sbin/ldconfig # Use tcmalloc to accelerate MySQL [[email protected] lib] # PWD/usr/local/MySQL/lib [[email protected] lib] # ls | grep restart # edit the mysqld_safe file [[email protected] bin] # vi/usr/local/MySQL/bin/mysqld_safe # And # executing mysqld_safe, add the following export ld_preload = "/usr/local/MySQL/lib/libtcmalloc_minimal.so" # restart MySQL service [[email protected] ~] # Service mysqld restartshutting down MySQL... success! Starting MySQL... success! [[Email protected] bin] # lsof-N | grep-I tcmamysqld 4793 MySQL mem Reg 8, 2 888700 14655/usr/local/src/mysql-5.5.38-linux2.6-i686/lib/libtcmalloc_minimal.so
3. Compile and install PHP to integrate modules
If we have not previously installed: libxml2 libxml2-devel bzip2-devel libmcrypt-devel, you need to install these packages:
[[email protected] ~]# yum -y install libxml2 libxml2-devel bzip2-devel libmcrypt libmcrypt-devel
However, I do not have the libmcrypt * package:
No package libmcrypt available.
No package libmcrypt-devel available.
You can download the RPM package: http://rpm.pbone.net/
[[email protected] lamp]# ls lib*libmcrypt-2.5.7-1.2.el6.rf.i686.rpm libmcrypt-devel-2.5.7-1.2.el6.rf.i686.rpm[[email protected] lamp]# rpm -ivh lib*warning: libmcrypt-2.5.7-1.2.el6.rf.i686.rpm: Header V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEYPreparing... ########################################### [100%] 1:libmcrypt ########################################### [ 50%] 2:libmcrypt-devel ########################################### [100%]
Okay. Now that you are ready, start to install PHP.
[[Email protected] Lamp] # tar xf php-5.4.32.tar.gz-C/usr/local/src [[email protected] Lamp] # cd/usr/local/src [[email protected] SRC] # cd php-5.4.32/# You need to specify -- enable-FPM to enable FastCGI, for later change to FastCGI mode [[email protected] php-5.4.32] #. /configure -- prefix =/usr/local/PHP -- With-mysql =/usr/local/MySQL -- With-OpenSSL -- With-mysqli =/usr/local/MySQL/bin/ mysql_config -- enable-mbstring -- With-FreeType-dir -- With-JPEG-dir -- With-PNG-dir -- With-zlib -- With-libxml-Dir =/usr -- enable-XML -- enable-sockets -- enable-FPM -- with-apxs2 =/usr/local/Apache/bin/apxs -- With-mcrypt -- With-config-file-Path =/etc -- With-config -File-scan-Dir =/etc/PHP. D -- with-bz2 -- enable-maintainer-ZTS -- enable-FPM [[email protected] php-5.4.32] # Make & make install [[email protected] php-5.4.32] # cp PHP. ini-production/etc/PHP. ini
4. Integrate Apache and PHP
Edit the/etc/httpd. conf configuration file, locate addtype, and add the following two lines:
[[Email protected] ~] # Vi/etc/httpd. conf addtype application/X-httpd-PHP. PHP addtype application/X-httpd-PHP-source. PHPs # Then go to: directoryindex and add the index. php <ifmodule dir_module> directoryindex index. PHP index.html </ifmodule> # test [[email protected] ~] # Httpd-tsyntax OK [[email protected] ~] # Service httpd restartstopping httpd: [OK] Starting httpd: ah00558: httpd: cocould not reliably determine the server's fully qualified domain name, using localhost. localdomain. set the 'servername' directive globally to suppress this message [OK] [email protected] ~] # Vi/usr/local/Apache/htdocs/index. php <? Phpphpinfo ();?>
Access through a browser. The following interface is displayed: OK
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/49/8C/wKioL1QUVPeBnULtAAGWn6nOVtY574.jpg "Title =" 1.png" alt = "wkiol1quvpebnultaagwn6novty574.jpg"/>
5. Configure xcache to speed up PHP
For more information, see xcache for PHP Acceleration
[[Email protected] alhost Lamp] # tar xf xcache-3.0.4.tar.gz-C/usr/local/src [[email protected] Lamp] # cd/usr/local/src [[email protected] SRC] # cd xcache-3.0.4/### use a local interpreter to test the version number/extended API that the module depends on, generate the serial number tag before generating the configure file to compile [[email protected] xcache-3.0.4] #/usr/local/PHP/bin/phpize [[email protected] xcache-3.0.4] #. /configure -- enable-xcache-coverager -- enable-xcache-optimizer -- With-P HP-Config =/usr/local/PHP/bin/PHP-config [[email protected] xcache-3.0.4] # Make & make install # After installation is complete, xcache will be prompted. the path of the so module. so move to the/usr/local/PHP/include/PHP/EXT directory for convenient management # installing shared extensions: /usr/local/PHP/lib/PHP/extensions/no-debug-zts-20100525/[[email protected] xcache-3.0.4] # mv/usr/local/PHP/lib/PHP/extensions/no-debug-zts-20100525/xcache. so/usr/local/PHP/include/PHP/EXT/# raw Password of the xcache Administrator (MD5 ciphertext) [[email protected] ~] # Echo-N '000000' | md5sume10adc3949ba59abbe56e057f20f883e ### integrate PHP and xcache [[email protected] ~] # Cd/usr/local/src/xcache-3.0.4/[[email protected] xcache-3.0.4] # cp xcache. INI/etc/PHP. d/[email protected] ~] # Vi/etc/PHP. d/xcache. INI ### edit xcache. INI ## Generally, only the following four items can be edited: Extension = xcache. admin. enable_auth = xcache. admin. user = xcache. admin. pass #####################################[ xcache-common] extension = "/usr/local/PHP/include/PHP/EXT/xcache. so "; xcache. so path [xcache. admin] xcache. admin. enable_auth = on; Enable xcache verification. admin. user = "xcache"; verification name: xcache. admin. pass = "e10adc3949ba59abbe56e057f20f883e"; the verification password after MD5, that is Echo-n "123456" | md5sum. If left empty, the management page is disabled. [xcache] xcache. shm_scheme = "MMAP"; determines how xcache allocates shared memory xcache from the system. size = 60 m; 0 forbidden. If not 0, the cache is enabled. note the maximum MMAP value allowed by your system. xcache. count = 1; specify the number of segments to be split. (CAT/proc/cpuinfo | grep-C processor) xcache. slots = 8 K; it is only a reference value for the number of hash slots. You can safely buffer projects that exceed this number. xcache. TTL = 0; set the TTL (time to live) value of the buffer item, 0 = never expire. xcache. gc_interval = 0; check the interval between expired items and reclaim the memory space. xcache. var_size = 4mxcache. var_count = 1xcache. var_slots = 8 K; Same as above, but used for data buffering instead of opcode buffering. xcache. var_ttl = 0; xcache _ (GET | set | Inc | dec) and Other Default TTL values. xcache. var_maxttl = 0; the maximum TTL value. The program cannot specify the TTL that exceeds this maximum value. xcache. var_gc_interval = 300xcache. test = offxcache. readonly_protection = on; If readonlyprotection is enabled, the performance will be slightly reduced, but the security factor will be improved. this option is applicable to xcache. mmap_path =/dev/zero is invalid. xcache. mmap_path = "/tmp/xcache"; cache file, not a directory. You need to manually create xcache. coredump_directory = "" xcache. Cacher = on; Use/do not use the opcode cache. xcache. invalid when size = 0. xcache. stat = on; Use Stat () to check for script updates. xcache. optimizer = off [xcache. coverager] xcache. coverager = on; Enable code overwrite to collect information. xcache is enabled. coveragedump_directory settings and xcache_coverager_start/Stop/get/clean () can be used. (This will reduce the impact) xcache. coverager_autostart = on; each page request automatically calls xcache_coverager_startxcache.coveragedump_directory = "" # generate xcache cache [[email protected] ~] # Touch/tmp/xcache [[email protected] ~] # Chmod 777/tmp/xcache
You can use phpinfo to verify whether PHP supports xcache.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/49/8B/wKiom1QUWkyAzZ41AAFrZS8rnLo433.jpg "Title =" 1.png" alt = "wkiom1quwkyazz41aafrzs8rnlo433.jpg"/>
Install discuz! X
[[Email protected] Lamp] # unzip discuz_x3.2_ SC _utf8.zip [[email protected] Lamp] # cp-r readme // www/[[email protected] Lamp] # cp-r upload // WWW/[[email protected] Lamp] # cp-r utility // www/# All the three directories need to be copied to the upload directory under the website directory. All the files under the directory are the forum owners. program file. The readme directory describes the product introduction, authorization, installation, upgrade, conversion, and version update logs. The utility directory is a tool attached to the Forum, including the Upgrade Program. ### Configure the VM and edit/etc/httpd. conf # comment center host # DocumentRoot "/usr/local/Apache/htdocs" # enable virtual host # virtual hostsinclude/etc/httpd/extra/httpd-vhosts.conf # edit/etc /httpd/extra/httpd-vhosts.conf <virtualhost *: 80> serveradmin [email protected] DocumentRoot "/www/upload" servername www.discuz.com errorlog logs/discuz-error_log customlog logs/discuz-access_log common <directory "/www/upload"> options inde Xes followsymlinksallowoverride nonerequire all granted </directory> </virtualhost> # restart the HTTPd service [[email protected] ~] # Service httpd restart
Then, access through a browser to enter the installation Interface
Step 1, you know, disagree, you have to agree, 650) This. width = 650; "src =" http://img.baidu.com/hi/jx2/j_0063.gif "alt =" j_0063.gif "/>
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/49/8C/wKiom1QUYUKCVBGkAAOs0wJNhmo793.jpg "Title =" 1.png" alt = "wkiom1quyukcvbgkaaos0wjnhmo793.jpg"/>
Check the installation environment and there are a lot of red forks. What should I do?
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/49/8C/wKiom1QUYb3iXH5GAAJCEF-WsZk022.jpg "Title =" 1.png" alt = "wKiom1QUYb3iXH5GAAJCEF-WsZk022.jpg"/>
Refer to this tutorial discuz! X3 new installation graphic tutorial
We need to set the file attributes of the relevant directories so that the data files can be correctly read and written by the program. Set the following directory on the server and all file attributes under the directory to 777.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/49/8C/wKiom1QUY12wbcERAAE7PTBlfP8381.jpg "Title =" 1.png" alt = "wkiom1quy12wbceraae7ptblfp8381.jpg"/>
# If you know how to do this, [[email protected] ~] # Cd/www/upload/[[email protected] upload] # chmod-r 777 config [[email protected] upload] # chmod-r 777 data [[email protected] upload] # chmod-r 777 uc_server/[[email protected] upload] # chmod-r 777 uc_client/data/Cache/
OK. Refresh the page in the browser. The permission check is successful"
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/49/8E/wKioL1QUZI7jVCT0AAIQvMdsclY681.jpg "Title =" 1.png" alt = "wkiol1quzi7jvct0aaiqvmdscly681.jpg"/>
Set the runtime environment
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/49/8E/wKioL1QUZMfAtyERAAGlTjy6gD4166.jpg "Title =" 1.png" alt = "wkiol1quzmfatyeraagltjy6gd4166.jpg"/>
Go to the database settings page, as shown in
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/49/8E/wKioL1QUZbSyIhWUAAFZUpR9xwM138.jpg "Title =" 1.png" alt = "wkiol1quzbsyihwuaafzupr9xwm138.jpg"/>
Enter discuz! After database information and administrator information, click "Next". The system will automatically install the database until it is complete.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/49/8D/wKiom1QUZk7BYu1QAAMY1xeahCQ769.jpg "Title =" 1.png" alt = "wkiom1quzk7byu1qaamy1xeahcq769.jpg"/>
Click "install application now", log on to the background again, select the application to be installed, and install it.
OK. Now discuz! The installation of Forum X is complete. For more settings, continue in the next article.
Http://coolnull.com/1293.html
Http://blog.chinaunix.net/uid-26963748-id-3267204.html
Http://www.vfeelit.com/76.html
Http://www.fanli7.net/a/JAVAbiancheng/ANT/20140403/444902.html
Http://www.discuz.net/thread-3258186-1-1.html
Http://www.linuxidc.com/Linux/2011-04/34621.htm
This article is from the share your knowledge blog, please be sure to keep this source http://skypegnu1.blog.51cto.com/8991766/1552384
Deploy discuz on centos! X Forum 2