First, lamp combination of basic knowledge
Second, WordPress, phpMyAdmin installation
LAMP
Linux
Apache (httpd)
Mysql
PHP, Python, Perl, Ruby, etc.
Combination of A and p:
Cgi:common Gateway Interface Universal Gateway Interface, which can be understood as a simplified version of the HTTP protocol for communication between the Web server and the PHP application process
Client-->web server-->php-->web server--client;php process generation and destruction are maintained by Web server, so Web server is very busy and inefficient
Fast CGI: Quick CGI, it works like CGI (client-->web server-->php-->web server--client)
But the difference is that when Web server starts, it launches a FASTCGI manager, such as PHPFPM, and initiates multiple processes that contain the PHP interpreter to form a pool of processes managed by PHPFPM, so that when the Web server receives a request, A process is scheduled to be executed by PHPFPM, and the process is not destroyed but continues back to the PHPFPM process pool. Eliminates fork destory process for improved performance
In a nutshell, PHP would like to httpd to generate multiple processes listening on the specified socket, it is a separate service, HTTPD received the request, through the protocol to the PHP process, executed by PHP after the exchange of httpd, and finally httpd encapsulated to the client. The benefit is that Web server and PHP server can be detached, deploying multiple servers separately
Module:client-->web server-->client because PHP is already a httpd module that contains the PHP interpreter that can execute PHP
FastCGI and module: Both modes have the concept of process pool, performance is higher than CGI, the difference is that a process pool is the process pool of Web server, one is the process pool of PHP, fastcgi this mode, can be relatively good separation of dynamic and static requests, A problem with PHP does not affect Web server.
CENTOS6 amp Combo (RPM package):
HTTPD is generally installed
#yum Install httpd slightly
Install PHP
#yum Install PHP
[[email protected] ~]# rpm-ql PHP
/etc/httpd/conf.d/php.conf
/usr/lib64/httpd/modules/libphp5.so
/var/lib/php/session
/var/www/icons/php.gif
As you can see, it's a modular way of combining httpd
Installing Mysql-server
#yum Install Mysql-server
MySQL is a CS-agency program, so you need to specify the installation server when installing. However, the MySQL client is dependent, so it will be installed
Service mysqld start MySQL program is called mysqld, it is a separate service program
Installing Php-mysql
This is a PHP driver interface for MySQL connection
Blog assignments:
RPM Package Format installation lamp, provide two virtual host, one for WordPress, one for phpMyAdmin, for the latter to provide SSL access
As a result of previous experiments www.aaa.com www.bbb.com two virtual hosts, where www.bbb.com provides SSL access, now transform it:
www.aaa.com content for WordPress
Www.bbb.com for phpMyAdmin and provides SSL access
1, WordPress part:
/etc/httpd/conf.d/aaa.conf content:
<virtualhost 172.20.1.100:80>
ServerAdmin [email protected]
documentroot/web/vhosts/aaa.com/
ServerName www.aaa.com
Serveralias aaa.com
Errorlog/var/log/httpd/aaa.err
Customlog/var/log/httpd/aaa.access combined
</VirtualHost>
So deleted the original default home page, new test
Create a new test.php in/web/vhosts/aaa.com/with the content:
Test the connection between PHP and MySQL
<?php
$link =mysql_connect ("localhost", "root", "");
if (! $link) echo "faild! connection error, user name password is not correct";
else echo "ok! can be connected";
?>
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M01/80/3F/ Wkiol1c8g4cstibyaaba2yici8a862.png "" 364 "height=" 102 "/>
Test PHP version and other information:
<?php
Phpinfo ();
?>
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M02/80/3F/ Wkiol1c8g4haynroaacgcydfmhq055.png "" 528 "height=" 104 "/>
Note that the index.php end If. PHP, if written in HTML, the inside of the code will not run, it can recognize the suffix execution; test ok~
Download WordPress and unzip (process slightly)
[[email protected] aaa.com]# ls
index.php WordPress Wordpress-4.5.2-zh_cn.zip
[Email protected] aaa.com]# RM index.php
RM: Do you want to delete the normal file "index.php"? Y
[Email protected] aaa.com]# mv wordpress/*.
[[email protected] aaa.com]# ls
index.php WordPress wp-admin wp-config-sample.php wp-includes wp-login.php wp -signup.php
License.txt wordpress-4.5.2-zh_cn.zip wp-blog-header.php wp-content wp-links-opml.php wp-mail.php wp -trackback.php
Readme.html wp-activate.php wp-comments-post.php wp-cron.php wp-load.php wp-settings.php XM lrpc.php
[Email protected] aaa.com]#
Default MySQL does not have a password, because it is a test, so the password is random
mysql> SET PASSWORD for ' root ' @ ' localhost ' = PASSWORD ('[email protected]');
Open Web page start install WordPress
Database name: WordPress
User name: Root
Password: [email protected]
Database host: localhost
Table prefix: wp_
The installation process will be error, because the database WordPress does not exist, new:
[Email protected] aaa.com]# mysql-uroot-p123456
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 5
Server version:5.1.73 Source Distribution
Copyright (c) and/or, Oracle, its affiliates. All rights reserved.
Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
mysql> CREATE DATABASE WordPress; # #创建数据库
Query OK, 1 row Affected (0.00 sec)
Mysql>
In fact, you can also modify the wp-config.php, set up a database, user name, password, etc. but to create these in advance, it is not very good for MySQL, so use the Setup Wizard to automatically create
The process will also have an error, cannot write to the file, modify the permissions:
[Email protected] vhosts]# chmod 777-r aaa.com
If not unexpected, then now to a "welcome", set the site title, user name, password and other information. After completing the "Install WordPress"
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M01/80/42/ Wkiom1c8gpignogzaabd3ysepmg408.png "" 301 "height=" 117 "/>
2, phpMyAdmin part, and use SSL access
Modify the/etc/httpd/conf.d/ssl.conf, modify the section:
<virtualhost 172.20.1.100:443>
DocumentRoot "/web/vhosts/bbb.com/phpmyadmin/" # #主页路径
ServerName www.bbb.com:443 # #站点的servername
Errorlog Logs/ssl_error_log # #错误日志存放路径
Transferlog Logs/ssl_access_log # #访问日志存放路径
LogLevel warn
SSLCERTIFICATEFILE/ETC/HTTPD/SSL/HTTP.CRT # #证书路径
Sslcertificatekeyfile/etc/httpd/ssl/http.key # #密钥路径
Because there was an SSL test before, the previous certificate and key can continue to be used
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M00/80/3F/ Wkiol1c8g4ot7zemaaey0vxe-m8771.png "" 387 "height=" 199 "/>
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" image "border=" 0 "alt=" image "src=" http://s3.51cto.com/wyfs02/M01/80/3F/ Wkiol1c8g4tc6yrfaacj9gvoi1u337.png "" 421 "height=" 206 "/>
During the experiment, I downloaded the latest version of Phpmyadmin-4.6.1-all-languages, prompting PHP 5.5+ is required. Currently installed version is:5.3.3
Tip requires php5.5 above, the current version is 5.3.3. So we re-downloaded the phpMyAdmin 4.0.10.15, which can be used normally
If there is an error finding Mbstring,yum install php-mbstring, reread the httpd profile or restart the httpd service.
Spit a notch cheetah, use the Cheetah browser to enter the account password when opened, unable to log in and no error notification, the replacement of Google Browser can be normal landing.
Lamp Combination Basics WordPress, phpMyAdmin installation