In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
9.1. The combination of PHP and httpd
Common PHP open source software:
Forums: phpwind, discuz, phpbb
Blog system: wordpress
Portal sites: drupal, xooms
Database: phpMyAdmin, Workbench, MySQL Front, Navicat for MySQL, Toad
CMS (Content Management System) content management system: Drupal, joomla
The combination of PHP and httpd:
Module, as a module, is loaded when needed:
Prefork: a request is processed by a single process, which is stable and consumes a lot of resources in large concurrency scenarios. Create processes in advance, maintain appropriate processes on demand, design module blocks, have relatively small cores, add modules with various functions (including php), support running configuration, support separate compiling modules, and support multiple virtual host configurations.
Worker: a process has multiple threads, and a thread responds to a request
Event: a thread responds to multiple requests and is event-driven. The main purpose is to implement a single thread to respond to multiple requests.
Cgi (Common gateway interface): universal gateway interface, a communication tool for HTTP servers to communicate with program services on other machines. (the CGI program must run on a network server, and each time the HTTP service encounters a dynamic program, it needs to start a new parser.)
Fastcgi, a scalable, high-speed interface for communicating between HTTP servers and dynamic scripting languages, has the advantage of separating dynamic languages from HTTP servers. Its main behavior is to keep the CGI interpreter process in memory and thus achieve high performance. Repeated loading of the CGI interpreter is the main reason for the poor performance of CGI. If the CGI interpreter stays in memory and accepts scheduling by the FastCGI process manager, it can provide good performance, scalability, Fail- Over features, and so on.
LAMP configuration order: httpd-- > MySQL-- > php-- > XCache (cache / optimizer)
Rpm format configuration lamp
# yum-y install httpd php php-mysql mysql-server mysql php-mcrypt
9.2. Compile and install LAMP
Software version:
Apacge:httpd-2.4.25.tar.gz
Dependency package: apr-1.5.2.tar.gz apr-util-1.5.4.tar.gz
Mysql:mysql-5.5.55-linux2.6-x86_64.tar.gz
Php: php-5.6.30-src.zip
Related software downloads:
# wget http://mirrors.hust.edu.cn/apache//httpd/httpd-2.4.25.tar.gz#wget http://mirrors.hust.edu.cn/apache//apr/apr-1.5.2.tar.gz#wget http://mirrors.hust.edu.cn/apache//apr/apr-util-1.5.4.tar.gz#wget http://ftp.ntu.edu.tw/pub/MySQL/Downloads/MySQL-5.5/mysql- 5.5.55-linux2.6-x86_64.tar.gz#wget http://cn2.php.net/distributions/php-5.6.30.tar.gz
1. Install apache
[root@mylinux app] # tar xf apr-1.5.2.tar.gz [root@mylinux app] # cd apr-1.5.2 [root@mylinux apr-1.5.2] # #. / configure-- prefix=/usr/local/apr [root@mylinux apr-1.5.2] # # make & & make install [root@mylinux app] # tar xf apr-util-1.5.4.tar.gz [root@mylinux app] # cd apr-util-1.5.4 [root@mylinux apr-util-1.5.4]. / configure-- prefix=/usr/local/apr-util-- with-apr=/usr/local/apr/ [root@mylinux apr-util-1.5.4] make & & make install [root@mylinux home] # yum install pcre-devel-y [root@mylinux app] # tar xf httpd-2.4.25.tar.gz [root@mylinux app] # cd httpd-2.4.25 [root@mylinux httpd-2.4.25] #. / configure-- prefix=/usr/local/apache-- sysconfdir=/etc/httpd24-- enable-so-- enable-ssl-- enable-rewrite-- with-zlib-- with-pcre-- with-apr=/usr/local/apr-- with-apr-util=/usr/local/apr-util-- enable-modules=most-- enable-mpms-shared=all-- with-mpm=event [root@mylinux httpd-2.4.25] # make & & make install [root@mylinux httpd24] # vim / etc/httpd24/httpd.conf # modify configuration file PidFile "/ var/run/httpd.pid" # add line ServerName 127.0.0.1 var/run/httpd.pid 80 # modify service name # provide service script [root@mylinux httpd24] # cp / home/app/httpd-2.4.25/build/rpm/httpd.init / etc/ Rc.d/init.d/httpd [root@mylinux init.d] # vim / etc/rc.d/init.d/httpd # modify the related parameter CONFFILE=/etc/httpd24/httpd.conf apachectl=/usr/local/apache/bin/apachectl httpd=$ {HTTPD-/usr/local/apache/bin/httpd} pidfile=$ {PIDFILE-/var/run/$ {prog} .pid} lockfile=$ {LOCKFILE-/var/lock/subsys/$ {prog}} RETVAL=0 prog=httpd [root@mylinux init.d] # chmod + x / etc/rc.d/init.d/httpd # Grant execution permission to this script [root@mylinux init.d] # chkconfig-- add httpd # add to the list of services [root@mylinux init.d] # service httpd start # start test Starting httpd: [OK]
2. Install MySQL in universal binary format
[root@mylinux app] # tar xf mysql-5.5.55-linux2.6-x86_64.tar.gz [root@mylinux app] # ln-sv / home/app/mysql-5.5.55-linux2.6-x86_64 / usr/local/ mysql` / usr/local/mysql'-> `/ home/app/mysql-5.5.55-linux2.6-x86_64' [root@mylinux app] # cd mysql [root@mylinux mysql] # chown-R root:mysql. [ Root@mylinux mysql] # scripts/mysql_install_db-- user=mysql # initialize [root@mylinux mysql] # cp support-files/my-large.cnf / etc/my.cnf # provide configuration file [root@mylinux mysql] # cp support-files/mysql.server / etc/rc.d/init.d/mysqld # service script [root@mylinux mysql] # service mysqld start # start test Starting MySQL.. SUCCESS! [root@mylinux profile.d] # vim / etc/mysql.sh # add the environment variable [root@mylinux profile.d] # source mysql.sh [root@mylinux profile.d] # mysqlWelcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 1Server version: 5.5.55-log MySQL Community Server (GPL) Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.mysql > quitBye [root@mylinux profile.d] #
3. Install PHP
# yum-y groupinstall "Desktop Platform Development" # resolve dependencies # yum-y install bzip2-devel libmcrypt-devel [root@mylinux app] # tar xf php-5.6.30.tar.gz [root@mylinux app] # cd php-5.6.30 [root@mylinux php-5.6.30] #. / 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-- 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 [root@ Mylinux php-5.6.30] # make [root@mylinux php-5.6.30] # make test [root@mylinux php-5.6.30] # make install [root@mylinux php-5.6.30] # cp php.ini-production / etc/php.ini # provide configuration files
4. Modify apache-related configuration
# vim / etc/httpd/httpd.conf AddType application/x-httpd-php .php # add two lines of AddType application/x-httpd-php-source .phps. DirectoryIndex index.php index.html # modify the line
5. Test
[root@mylinux php-5.6.30] # service httpd restartStopping httpd: [OK] Starting httpd: [OK] [root@mylinux htdocs] # vim / usr/local/apache/htdocs/123.php [root@mylinux htdocs] # vim / usr/local/apache/htdocs/index..php
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.