linux架构学习第二十六天之LAMP架构原理及搭建详解

内容:

1、何为LAMP

2、LAMP的架构以及通信过程

3、LAMP的搭建过程(rpm包)

4、基于LAMP搭建wordpress博客

一、何为LAMP

LAMP(Linux-Apache-MySQL-PHP)网站架构是目前国际流行的Web框架,该框架包括:Linux操作系统,Apache网络服务器,MySQL数据库,Perl、PHP或者Python编程语言,所有组成产品均是开源软件,是国际上成熟的架构框架,很多流行的商业应用都是采取这个架构,LAMP具有通用、跨平台、高性能、低价格的优势,因此LAMP无论是性能、质量还是价格都是企业搭建网站的首选平台。

二、LAMP的架构以及通信过程

LAMP的架构:

LAMP是一个多C/S架构的平台,最初级为web客户端基于TCP/IP通过http协议发起传送,这个请求可能是动态的,也可能是静态的。

所以web服务器通过发起请求的后缀来判断,如果是静态的资源就由web服务器自行处理,然后将资源发给客户端。如果是动态这时web服务器会通过CGI(Common Gateway interface)协议发起给php。

这里但是如果php是以模块形式与Web服务器联系。那么他们是通过内部共享内存的方式。如果是php单独的放置与一台服务器,那么他们是通过sockets套接字监听的方式通信(这又是一个C/S架构)。

这时php会相应的执行一段程序,如果在执行程序时,需要用到数据。那么php就会通过mysql协议发送给mysql服务器(也可以看作是一个C/S架构)。由mysql服务器处理,将数据供给php程序。

lamp流程:

1. 用户发送http请求到达httpd服务器

2. httpd解析url获取需要的资源的路径,通过内核空间读取硬盘资源,如是静态资源,则构建响应报文,发回给用户

3. 如果是动态资源,将资源地址发给php解析器,解析php程序文件,解析完毕将内容发回给httpd,httpd构建响应报文,发回给用户

4. 如果涉及到数据库操作,则利用php-mysql驱动,获取数据库数据,返回给PHP解析器。

A,M,P是怎么联动起来工作的呢:

1、apache + php结合的方式大概几种:

第一种:把php编译时直接编译成apache的模块、module模块化的方式进行工作(apahce默认的这种方式)。

第二种:CGI、通用网关接口、apache基于CGI跟hph通信

第三种:fastcgi、他也是一种协议、在这种模块下他们两个是这样结合的:

本来php是做为一个模块或都是php解析器运行的,不是监听在某个套接字上接收别人的请求的,而是让别人调用为一个进程使用的,可能是做为别人的子进程在运行,但是工作在fastcgi这种模块下的hph自行启用为一个服务进程,

他监听在某个套接字上,随时可以接受来自客户端的请求的,他也是有一个主进程的,为了可以响应多个用户的请求,他会启用多个子进程,这些子进程我们也可以称为工作进程,

他也是有空闲进程的,一但有客户请求他马上使用空闲的进程响应客户端的请求,将结果返回给前端的调用者,在php5.3.3版本之前他是没有这个能力了,只能工作在模块和CGI的方式下,而在5.3.3之后这个模块直接被收进php模块中,这种模块就叫php-fpm。

所以在以后编译php时,要想跟apache结合,就要编译成php-fpm,这是基于fastcgi工作的模式,并启动这服务进程,也就意味着他是通过套接字跟前端的调用者通信,既然基于套按字通信了,那么前端的web服务器和后面的php服务器完全可以工作在不同的主机上,实现了所谓的分层机制。

apache不会跟数据库打交道,他是个静态web服务器,跟数据库打交道的是应用程序,作为应用程序的源驱动能够基于某个API跟服务器之间建立会话,而后他会通过我们的mysql语句发送给数据库,数据库再将结果返回给应用程序,不是php进程,而是php进程中所执行的代码。

2、php + mysql的通信:

PHP跟mysql怎么整合起来呢,php又怎么被httpd所调用呢

首先httpd并不具备解析代码的能力,他要依赖于php的解析器,接着php本身不依赖于mysql,他只是一个解析器,能执行代码就OK了,那他什么时候用到mysql呢,如果要在mysql中存数据时才用到mysql,只是当php中有运行mysql语句时才用到mysql。

php语言要想联系mysql,通常用到php的驱动,rpm包的叫php_mysql,php跟mysql没有一点关系,只有程序员在php中编写mysql语句时才连接mysql来执行sql语句的。

基于php-mysql去连接mysql只使用一个函数mysql_connect();而mysql_connect()正是php-mysql提供的一个API,只要指明要连接的服务器即可。

三、LAMP搭建过程(基于rpm包):

(1)安装配置apache,基于虚拟主机模式的https协议

(2)安装配置mysql

(3)安装配置php,以及php-mysql模块

(4)基于LAMP搭建wordpress测试

设置虚拟主机配置:

[14:09 [email protected]/etc/httpd/ssl]# cat /etc/httpd/conf.d/www.hillpress.com.conf 
namevirtualhost *:80
<virtualhost *:80>
documentroot "/var/www/html/www.hillpress.com"
servername www.hillpress.com
errorlog logs/error_log_www.hillpress.com
loglevel warn
customlog logs/access_log_www.hillpress.com combined
</virtualhost>

申请签署证书(我的CA服务和web服务在同一主机):

[14:06 [email protected]/etc/httpd/ssl]# openssl req -new -days 365 -key private/hillpress.key -out /etc/httpd/ssl/hillpresscsr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.‘, the field will be left blank.
-----
Country Name (2 letter code) [XX]:CN
State or Province Name (full name) []:BEIJING
Locality Name (eg, city) [Default City]:BEIJING
Organization Name (eg, company) [Default Company Ltd]:nihao
Organizational Unit Name (eg, section) []:www.hillpress.com
Common Name (eg, your name or your server‘s hostname) []:www.hillpress.com
Email Address []:[email protected]
Please enter the following ‘extra‘ attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
[14:07 [email protected]/etc/httpd/ssl]# openssl ca -in hillpress.csr -out hillpress.crt
Using configuration from /etc/pki/tls/openssl.cnf
Check that the request matches the signature
Signature ok
Certificate Details:
        Serial Number: 3 (0x3)
        Validity
            Not Before: Sep 30 06:07:43 2016 GMT
            Not After : Sep 30 06:07:43 2017 GMT
        Subject:
            countryName               = CN
            stateOrProvinceName       = BEIJING
            organizationName          = nihao
            organizationalUnitName    = www.hillpress.com
            commonName                = www.hillpress.com
            emailAddress              = [email protected]
        X509v3 extensions:
            X509v3 Basic Constraints: 
                CA:FALSE
            Netscape Comment: 
                OpenSSL Generated Certificate
            X509v3 Subject Key Identifier: 
                88:05:22:19:70:36:13:D6:6B:43:A4:51:C3:8D:02:66:00:6A:D8:C0
            X509v3 Authority Key Identifier: 
                keyid:5B:E9:DA:5B:0B:3F:76:99:E6:96:FA:C0:E4:41:CD:7B:C4:21:7A:4A
Certificate is to be certified until Sep 30 06:07:43 2017 GMT (365 days)
Sign the certificate? [y/n]:y
1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated

安装mod_ssl模块支持ssl协议:

[14:11 [email protected]/etc/httpd/ssl]#rpm -ql mod_ssl
/etc/httpd/conf.d/ssl.conf
/usr/lib64/httpd/modules/mod_ssl.so
/var/cache/mod_ssl
/var/cache/mod_ssl/scache.dir
/var/cache/mod_ssl/scache.pag
/var/cache/mod_ssl/scache.sem

配置https的ssl:/etc/httpd/conf.d/ssl.conf,主要是配置根目录、证书的位置

[14:15 [email protected]/etc/httpd/ssl]# grep "^[^#]" /etc/httpd/conf.d/ssl.conf 
LoadModule ssl_module modules/mod_ssl.so
Listen 443
SSLPassPhraseDialog  builtin
SSLSessionCache         shmcb:/var/cache/mod_ssl/scache(512000)
SSLSessionCacheTimeout  300
SSLMutex default
SSLRandomSeed startup file:/dev/urandom  256
SSLRandomSeed connect builtin
SSLCryptoDevice builtin
<VirtualHost _default_:443>
DocumentRoot "/var/www/html/www.hillpress.com"
ServerName www.mypress.com
ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
LogLevel warn
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite DEFAULT:!EXP:!SSLv2:!DES:!IDEA:!SEED:+3DES
SSLCertificateFile /etc/httpd/ssl/hillpress.crt
SSLCertificateKeyFile /etc/httpd/ssl/private/hillpress.key
<Files ~ "\.(cgi|shtml|phtml|php3?)$">
    SSLOptions +StdEnvVars
</Files>
<Directory "/var/www/cgi-bin">
    SSLOptions +StdEnvVars
</Directory>
SetEnvIf User-Agent ".*MSIE.*"          nokeepalive ssl-unclean-shutdown          downgrade-1.0 force-response-1.0
CustomLog logs/ssl_request_log           "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>

检查语法,重载服务

[14:15 [email protected]/etc/httpd/ssl]# httpd -t
Syntax OK
[14:16 [email protected]/etc/httpd/ssl]# service  httpd reload
Reloading httpd: 
[14:16 [email protected]/etc/httpd/ssl]#

(2)安装mysql:

[16:37 [email protected]/misc/cd]# yum install -y mysql-server
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Repository ‘base‘ is missing name in configuration, using id
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package mysql-server.x86_64 0:5.1.73-7.el6 will be installed
--> Processing Dependency: mysql = 5.1.73-7.el6 for package: mysql-server-5.1.73-7.el6.x86_64
--> Processing Dependency: perl-DBI for package: mysql-server-5.1.73-7.el6.x86_64
--> Processing Dependency: perl-DBD-MySQL for package: mysql-server-5.1.73-7.el6.x86_64
--> Processing Dependency: perl(DBI) for package: mysql-server-5.1.73-7.el6.x86_64
--> Running transaction check
---> Package mysql.x86_64 0:5.1.73-7.el6 will be installed
---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be installed
---> Package perl-DBI.x86_64 0:1.609-4.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================================================
 Package                          Arch                     Version                          Repository              Size
=========================================================================================================================
Installing:
 mysql-server                     x86_64                   5.1.73-7.el6                     base                   8.6 M
Installing for dependencies:
 mysql                            x86_64                   5.1.73-7.el6                     base                   894 k
 perl-DBD-MySQL                   x86_64                   4.013-3.el6                      base                   134 k
 perl-DBI                         x86_64                   1.609-4.el6                      base                   705 k
Transaction Summary
=========================================================================================================================
Install       4 Package(s)
Total download size: 10 M
Installed size: 29 M
Downloading Packages:
-------------------------------------------------------------------------------------------------------------------------
Total                                                                                     12 MB/s |  10 MB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : perl-DBI-1.609-4.el6.x86_64                                                                           1/4 
  Installing : perl-DBD-MySQL-4.013-3.el6.x86_64                                                                     2/4 
  Installing : mysql-5.1.73-7.el6.x86_64                                                                             3/4 
  Installing : mysql-server-5.1.73-7.el6.x86_64                                                                      4/4 
  Verifying  : mysql-server-5.1.73-7.el6.x86_64                                                                      1/4 
  Verifying  : mysql-5.1.73-7.el6.x86_64                                                                             2/4 
  Verifying  : perl-DBD-MySQL-4.013-3.el6.x86_64                                                                     3/4 
  Verifying  : perl-DBI-1.609-4.el6.x86_64                                                                           4/4 
Installed:
  mysql-server.x86_64 0:5.1.73-7.el6                                                                                     
Dependency Installed:
  mysql.x86_64 0:5.1.73-7.el6         perl-DBD-MySQL.x86_64 0:4.013-3.el6         perl-DBI.x86_64 0:1.609-4.el6        
Complete!
[16:38 [email protected]/misc/cd]# service  mysqld start
Initializing MySQL database:  Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password ‘new-password‘
/usr/bin/mysqladmin -u root -h centos6.8 password ‘new-password‘
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
                                                           [  OK  ]
Starting mysqld:                                           [  OK  ]

(3)安装php,以及php-mysql模块:

[16:40 [email protected]/misc/cd]# yum -y install php php_mysql
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Repository ‘base‘ is missing name in configuration, using id
Loading mirror speeds from cached hostfile
No package php_mysql available.
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:5.3.3-47.el6 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.3-47.el6 for package: php-5.3.3-47.el6.x86_64
--> Processing Dependency: php-cli(x86-64) = 5.3.3-47.el6 for package: php-5.3.3-47.el6.x86_64
--> Running transaction check
---> Package php-cli.x86_64 0:5.3.3-47.el6 will be installed
---> Package php-common.x86_64 0:5.3.3-47.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================================================
 Package                       Arch                      Version                           Repository               Size
=========================================================================================================================
Installing:
 php                           x86_64                    5.3.3-47.el6                      base                    1.1 M
Installing for dependencies:
 php-cli                       x86_64                    5.3.3-47.el6                      base                    2.2 M
 php-common                    x86_64                    5.3.3-47.el6                      base                    530 k
Transaction Summary
=========================================================================================================================
Install       3 Package(s)
Total download size: 3.8 M
Installed size: 13 M
Downloading Packages:
-------------------------------------------------------------------------------------------------------------------------
Total                                                                                    8.8 MB/s | 3.8 MB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : php-common-5.3.3-47.el6.x86_64                                                                        1/3 
  Installing : php-cli-5.3.3-47.el6.x86_64                                                                           2/3 
  Installing : php-5.3.3-47.el6.x86_64                                                                               3/3 
  Verifying  : php-common-5.3.3-47.el6.x86_64                                                                        1/3 
  Verifying  : php-cli-5.3.3-47.el6.x86_64                                                                           2/3 
  Verifying  : php-5.3.3-47.el6.x86_64                                                                               3/3 
Installed:
  php.x86_64 0:5.3.3-47.el6                                                                                              
Dependency Installed:
  php-cli.x86_64 0:5.3.3-47.el6                             php-common.x86_64 0:5.3.3-47.el6                            
Complete!
[20:44 [email protected]~]# yum install -y php-mysql
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Repository ‘base‘ is missing name in configuration, using id
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package php-mysql.x86_64 0:5.3.3-47.el6 will be installed
--> Processing Dependency: php-pdo(x86-64) for package: php-mysql-5.3.3-47.el6.x86_64
--> Running transaction check
---> Package php-pdo.x86_64 0:5.3.3-47.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================================================
 Package                      Arch                      Version                            Repository               Size
=========================================================================================================================
Installing:
 php-mysql                    x86_64                    5.3.3-47.el6                       base                     86 k
Installing for dependencies:
 php-pdo                      x86_64                    5.3.3-47.el6                       base                     80 k
Transaction Summary
=========================================================================================================================
Install       2 Package(s)
Total download size: 166 k
Installed size: 384 k
Downloading Packages:
-------------------------------------------------------------------------------------------------------------------------
Total                                                                                    261 kB/s | 166 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : php-pdo-5.3.3-47.el6.x86_64                                                                           1/2 
  Installing : php-mysql-5.3.3-47.el6.x86_64                                                                         2/2 
  Verifying  : php-mysql-5.3.3-47.el6.x86_64                                                                         1/2 
  Verifying  : php-pdo-5.3.3-47.el6.x86_64                                                                           2/2 
Installed:
  php-mysql.x86_64 0:5.3.3-47.el6                                                                                        
Dependency Installed:
  php-pdo.x86_64 0:5.3.3-47.el6                                                                                          
Complete!

php配置文件不需要额外修改,但要修改httpd配置文件,添加支持php的MIME类型:

# vim /etc/httpd22/httpd.conf //找到AddType application/x在下面添加
    AddType application/x-httpd-php  .php
    AddType application/x-httpd-php-source  .phps
    DirectoryIndex  index.php  index.html/找到 DirectoryIndex index.html 添加index.php

测试apache与php的连通性:

将首页index.html改成index.php,并且编辑首页内容,添加php的测试语句

[17:18 [email protected]/var/www/html/www.hillpress.com]# cat !$
cat index.php
welcome to mypage
<?php
phpinfo();
?>

测试php与mysql的连通性:

[17:45 [email protected]/var/www/html/www.hilldiscuz.com]# cat nihao.php 
<?php
     $link = mysql_connect(‘localhost‘,‘root‘,‘nihao‘);
 if ($link)
   echo "Success...";
 else
   echo "Failure...";
 mysql_close();
?>

(4)基于LAMP搭建wordpress测试

1)讲SElinux关闭,或者添加SElinux安全上下文策略

2)把下载的wordprss源码包解压到web的服务根目录,并且修改文件的属组属主

3)修改wordprss的配置文件:wp-config-sample.php,并将名字改为wp-config.php,修改数据库的位置以及登录的帐号密码

[22:26 [email protected]/var/www/html/www.hillpress.com]# cat wp-config.php 
<?php
/**
 * WordPress基础配置文件。
 *
 * 这个文件被安装程序用于自动生成wp-config.php配置文件,
 * 您可以不使用网站,您需要手动复制这个文件,
 * 并重命名为“wp-config.php”,然后填入相关信息。
 *
 * 本文件包含以下配置选项:
 *
 * * MySQL设置
 * * 密钥
 * * 数据库表名前缀
 * * ABSPATH
 *
 * @link https://codex.wordpress.org/zh-cn:%E7%BC%96%E8%BE%91_wp-config.php
 *
 * @package WordPress
 */
// ** MySQL 设置 - 具体信息来自您正在使用的主机 ** //
/** WordPress数据库的名称 */
define(‘DB_NAME‘, ‘myDB‘);
/** MySQL数据库用户名 */
define(‘DB_USER‘, ‘wpuser‘);
/** MySQL数据库密码 */
define(‘DB_PASSWORD‘, ‘wppasswd‘);
/** MySQL主机 */
define(‘DB_HOST‘, ‘localhost‘);
/** 创建数据表时默认的文字编码 */
define(‘DB_CHARSET‘, ‘utf8‘);
/** 数据库整理类型。如不确定请勿更改 */
define(‘DB_COLLATE‘, ‘‘);
/**#@+
 * 身份认证密钥与盐。
 *
 * 修改为任意独一无二的字串!
 * 或者直接访问{@link https://api.wordpress.org/secret-key/1.1/salt/
 * WordPress.org密钥生成服务}
 * 任何修改都会导致所有cookies失效,所有用户将必须重新登录。
 *
 * @since 2.6.0
 */
define(‘AUTH_KEY‘,         ‘put your unique phrase here‘);
define(‘SECURE_AUTH_KEY‘,  ‘put your unique phrase here‘);
define(‘LOGGED_IN_KEY‘,    ‘put your unique phrase here‘);
define(‘NONCE_KEY‘,        ‘put your unique phrase here‘);
define(‘AUTH_SALT‘,        ‘put your unique phrase here‘);
define(‘SECURE_AUTH_SALT‘, ‘put your unique phrase here‘);
define(‘LOGGED_IN_SALT‘,   ‘put your unique phrase here‘);
define(‘NONCE_SALT‘,       ‘put your unique phrase here‘);
/**#@-*/
/**
 * WordPress数据表前缀。
 *
 * 如果您有在同一数据库内安装多个WordPress的需求,请为每个WordPress设置
 * 不同的数据表前缀。前缀名只能为数字、字母加下划线。
 */
$table_prefix  = ‘wp_‘;
/**
 * 开发者专用:WordPress调试模式。
 *
 * 将这个值改为true,WordPress将显示所有用于开发的提示。
 * 强烈建议插件开发者在开发环境中启用WP_DEBUG。
 *
 * 要获取其他能用于调试的信息,请访问Codex。
 *
 * @link https://codex.wordpress.org/Debugging_in_WordPress
 */
define(‘WP_DEBUG‘, false);
/**
 * zh_CN本地化设置:启用ICP备案号显示
 *
 * 可在设置→常规中修改。
 * 如需禁用,请移除或注释掉本行。
 */
define(‘WP_ZH_CN_ICP_NUM‘, true);
/* 好了!请不要再继续编辑。请保存本文件。使用愉快! */
/** WordPress目录的绝对路径。 */
if ( !defined(‘ABSPATH‘) )
define(‘ABSPATH‘, dirname(__FILE__) . ‘/‘);
/** 设置WordPress变量和包含文件。 */
require_once(ABSPATH . ‘wp-settings.php‘);

4)为wordpress创建专门的数据库用户,并测试成功

MariaDB [(none)]> create database myDB;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> GRANT ALL ON myDB.* TO ‘wpuser‘@‘%‘ IDENTIFIED BY ‘wppasswd‘;
Query OK, 0 rows affected (0.00 sec)

时间: 2024-08-05 23:19:08

linux架构学习第二十六天之LAMP架构原理及搭建详解的相关文章

linux架构学习第二十六天之web服务搭建(apache)以及https的实现

内容: 1.httpd版本以及安装 2.httpd的配置文件详解 3.httpd的用户身份验证实现 4.httpd的虚拟主机的实现 5.https的通信过程以及实现演示 1.httpd版本以及安装 centos默认的httpd版本是2.2,而centos默认的httpd版本是2.4,这里演示的是centos6的httpd-2.2版本 安装的方式有两种,一个是rpm包安装,一个是编译安装,编译安装相关的配置文件需要手动设置,这里演示的是rpm包安装 httpd2.2和2.4的区别: 2.2的MPM

“全栈2019”Java多线程第二十五章:生产者与消费者线程详解

难度 初级 学习时间 10分钟 适合人群 零基础 开发语言 Java 开发环境 JDK v11 IntelliJ IDEA v2018.3 文章原文链接 "全栈2019"Java多线程第二十五章:生产者与消费者线程详解 下一章 "全栈2019"Java多线程第二十六章:同步方法生产者与消费者线程 学习小组 加入同步学习小组,共同交流与进步. 方式一:关注头条号Gorhaf,私信"Java学习小组". 方式二:关注公众号Gorhaf,回复"

linux架构学习第二十五天HTTP协议详解

内容: 1.http协议概述 2.http协议特点 3.http的工作模式(过程) 4.http请求报文.响应报文格式.常见状态码解析 5.web资源概述(静态资源.动态资源) 1.http协议概述 http协议工作在TCP/IP模型的应用层,其定义web服务间通信的约定通信方式,HTTP基于tcp传送数据,默认是80端口(服务器端) 几个名词: http:hyper text transfer protocol,超文本传输协议,超文本传输协议(HTTP)是一种通信协议,它允许将超文本标记语言(

linux架构学习第二十九天之samba文件共享服务

内容: 1.samba的作用以及由来 2.samba的特性 3.samba的工作过程 4.samba的安装以及配置 5.samba的搭建测试 一.samba的作用以及由来 SAMBA历史溯源(摘自百度百科): 在早期网络世界当中,档案数据在不同主机之间的传输大多是使用 FTP 这个好用的服务器软件来进行传送.不过,使用FTP 传输档案却有个小小的问题,那就您无法直接修改主机上面的档案数据!也就是说您想要更改Linux 主机上的某个档案时,必需要由 Server 端将该档案下载到 Client端后

linux架构学习第二十四天-DNS详解及bind搭建各种DNS测试

内容: 一.DNS 1.域名系统概述 2.域名的结构 3.域名服务器 4.域名解析过程 5.域名服务器的资源记录(resource record RR) 二.bind搭建DNS服务器 1.bind的安装 2.搭建DNS服务器 3.搭建主从DNS服务器 4.实现DNS子域 5.实现DNS视图view(智能DNS) 一.DNS 1.域名系统概述 域名系统DNS(Domain Name System)是因特网使用的命名系统,用来把便于人们使用的机器名字转换成为IP地址.域名系统其实就是名字系统.为什么

linux命令学习笔记(22):find 命令的参数详解

find一些常用参数的一些常用实例和一些具体用法和注意事项. 1.使用name选项: 文件名选项是find命令最常用的选项,要么单独使用该选项,要么和其他选项一起使用. 可以使用某种文件名 模式来匹配文件,记住要用引号将文件名模式引起来. 不管当前路径是什么,如果想要在自己的根目录$HOME中 查找文件名符合*.log的文件,使用~作为 'pathname'参数,波浪号~代表了你的$HOME目录. find ~ -name "*.log" -print 想要在当前目录及子目录中查找所有

第二十六天 蛰伏的Hibernate遇到春日的暖阳 —Spring MVC 集成Hibernate使用(一)

6月7日,晴."纷纷红紫已成尘,布谷声中夏令新.夹路桑麻行不尽,始知身是太平人."        Hibernate和Spring的香艳相逢,不仅是Bean和Bean之间电光火石般的碰撞,也是XML和XML之间的萍水聚首.两种奇妙的架构,携手闯荡江湖,不仅塑造了依赖注入淋漓酣畅的快感,也让J2EE蹿红大半个地球. 第二十六天 蛰伏的Hibernate遇到春日的暖阳 -Spring MVC 集成Hibernate使用(一)

javaSE第二十六天

第二十六天????414 1:网络编程(理解)????414 (1)网络编程:用Java语言实现计算机间数据的信息传递和资源共享????414 (2)网络编程模型????414 (3)网络编程的三要素????414 (4)网络编程中主要类介绍:????416 A:InetAddress: 此类表示互联网协议 (IP) 地址.????416 B:????UDP协议下的Socket对象类DatagramSocket????418 1.发送端:????418 2.接收端:????419 C:????T

python入门第二十六天--网络通信

网络编程 自从互联网诞生以来,现在基本上所有的程序都是网络程序,很少有单机版的程序了. 计算机网络就是把各个计算机连接到一起,让网络中的计算机可以互相通信.网络编程就是如何在程序中实现两台计算机的通信. 举个例子,当你使用浏览器访问新浪网时,你的计算机就和新浪的某台服务器通过互联网连接起来了,然后,新浪的服务器把网页内容作为数据通过互联网传输到你的电脑上. 由于你的电脑上可能不止浏览器,还有QQ.Skype.Dropbox.邮件客户端等,不同的程序连接的别的计算机也会不同,所以,更确切地说,网络