Some terms server and record structures web server

Quick navigation menu

  1. Common terms server
  2. Set up a web server and virtual host configuration

Recording of common terms server aspect

1, CS and BS structure architecture

1.1 CS architecture

CS (Client / Server), install the package types of desktop software or mobile phone models, such as the common QQ, micro letter, Thunder, and so on.
Advantages are: based on the installation package, higher performance, and more secure.
The disadvantage is: Each platform for the business need to develop a corresponding client installation packages, such as windows / mac / android / need to develop a corresponding installation package on ios; platforms for software is easy to install too many system resources; for customers who need to install in order to use

1.2 BS Architecture

BS (Browser / Server), based on the site mode browser, such as common website Jingdong, Taobao station, and so on.
Advantages are: browser-based, the system comes with, customers do not need to install, easy to access; conserve system resources; convenient site iterative upgrade;
disadvantages are: operational stability, fluency, security is relatively weak number CS architecture.

2, the client

Terminal Services has the ability to obtain a browser, such as mobile phones, computers, etc., by installing different client software, you can get different services. Common client software: browser, QQ, Alipay, Thunder, love Fantastic Art, etc.

 

3, the server

Popular speaking, able to provide a service machine (computer) server becomes

3.1 server type

According to different classification criteria, the service can be divided into the following types:

  1. By type of service can be divided into: file server, database server;
  2. Press the operating system can be divided into: Linus servers, Windows servers;
  3. By application software can be divided into: Apache server, Nginx server, IIS server, Tomcat server, Node servers;

3.2 server software

The computer has the ability to provide a service application software, server software has become, by installing the appropriate service software, the computer can then have the ability to provide certain services after configuration.
Common services software:

  1. File Server: Server-U, FileZilla, VsFTP etc.
  2. Database server: Oracle, MySQL, PostgreSQL, MSSQL, etc.
  3. Mail Server: Postfix, Sendmail, etc.
  4. web servers: Apache, Nginx, IIS, Tomcat, NodeJS etc.

3.3 Web server

That server, the main provider of document (text, images, video, audio) browsing service, usually installed Apache, Nginx server software.
HTTP server may incorporate a business logic programming language processing, whereby development is performed, development is generally called the server.
Common running on the server side programming languages including PHP, Jsp, Asp, Python, Ruby, Go , etc.

 

4, network infrastructure

4.1 IP address

The so-called IP address is a 32-bit address to each connected to the Internet hosts assigned (like every normal phone calls require a different number).
Check local ip: windows with ipconfig, mac with ifconfig.
a public network ip ip (Foreign accessible, the need to go to the telephone company), (ip a local area can be accessed) local area network ip.

4.2 domain

Because IP addresses based on numbers are hard to remember, so they use the domain name instead of the IP address, the IP address of the domain name is a "mask."
Check domain name corresponding to the IP address of the command has ping, tracert. After getting ip, ip can also access the site.

4.3 DNS service

DNS record of the domain name and IP address mapping (correspondence) relationship. Find a priority, the local hosts file> DNS server.

4.4 Port

The port number is exporting computer communicate with the outside world to communicate, each port corresponds to a different service, web page access to a host based on ip positioned to provide specific software services based on port positioning.
For example, in real life, a different bank window for different services.
View port occupancy: `netstat -an`
common port number 80,8080,3306,21,22

 

 5, set up a web server

5.1 wampserver

wampserver is a windows-based integration software, integrated analytic engine apache + php + mysql.
Installation wampserver, and no difference in ordinary software, installed by default in C: \ wamp, after the installation is complete, the task when you see the icon Green indicates normal start.
## 5.2 Configuring the root of the
root of the site is a space for the web application on the web server, by modifying the configuration file to customize the default Web site root directory wampserver after installation is: C: \ wamp \ www.
We can customize a site's root directory, for example, create a new folder on a windows computer tanWeb F disk, which created several test page, and then we want to point to the site's root folder, how it take effect?

  1. Open wampserver software installation path, find the apache httpd.conf file folder
  2. Open the httpd.conf file editing, find about 178 lines and 205 lines, the `c: / wamp / www /` change `F: / tanWeb /`
  3. Save, restart Apache.

 

After rebooting, you can access through 127.0.0.1. httpd.conf file which can be accessed by setting the default 127.0.0.1, but does not support localhost access, if you want to localhost can access, you need to handle it, about 235 httpd.conf file line, Default says `Allow from 127.0.0.1 `behind plus a` Allow from all`, then restart Apache, it can also be accessed via localhost.

 

5.3 website deployment

We will make a good website copy to the configured root directory, browser access to 127.0.0.1.

5.4 static and dynamic resources

Static resources: the browser can be directly resolved resource we call static resources, such as html, javascript, css, video and other
dynamic resource: dynamic resource is parsed on the server, which can be converted to static resources.
If we visit the client browser is a static resource, after that server receives a request, it will respond directly to the static resource to the client;
if the client browser access to a dynamic resource, then the server receives a request will be dynamic resources are converted to static resource, and then respond.

5.5 virtual host configuration

Under the first domain name resolution, when we enter a domain name in the browser, the first system will first visit the hosts file of the machine, the general path of the hosts file is `C: \ Windows \ System32 \ drivers \ etc \ hosts`, if the hosts file on which translates domain names, places this subject; If you do not find the target domain name resolution hosts, then look for resolved from the DNS server.
So we do a test, when we enter a `jd.com` domain name in the browser on the machine, how to make the point your browser to our native deployment of web services? For example, the above we 127.0.0.1 visited sites deployed in the F disk tanWeb file. The secret is to do processing operation in the hosts file. As shown below

Save, enter the domain name `jd.com` browser or` tmall.com`, we see displayed on the browser page of our local web site:

Besides web hosting, which means independent of each other on a single computer, you can run multiple web sites, each virtual host. For example, I typed `jd.com` and` tmall.com` in the browser, they are accessing different directory of the web service.
have a test:

  1. In the F drive, respectively, create a new folder tanWeb tmall directory, and jd folder, and each folder create an index.html page
  2. In the above has been already set in the hosts file to resolve domain names point to the `jd.com` and` `tmall.com` 127.0.0.1`, next step is to modify the configuration inside Apache;
  3. Open the Apache httpd.conf file inside, find the configuration around 468 lines of virtual hosts, uncomment #, meaning that enable virtual host configuration `Include conf / extra / httpd-vhosts.conf`
  4. Then find httpd-vhosts.conf file, open the editor, found on the bottom of the configuration of virtual hosts, each virtual host configuration corresponds to the physical root of the site, as well as access to the domain name. Related shots are as follows:

Then enter `tmall.com` browser and` jd.com`, to see the effect of your browser:

Under the browser and then say `jd.com` input from, how it is to find the machine and display page:

  1. Browser and enter `jd.com`, browser then go looking for the machine` C: \ Windows \ System32 \ drivers \ etc \ hosts` file
  2. Looking in the hosts file `jd.com` map, just find the hosts file has a` 127.0.0.1 jd.com` mapping, `127.0.0.1` represents the machine, and then locate the native Apache web server software
  3. Read the Apache httpd.confg files, which have been set up web root directory, and start the virtual host;
  4. Then read the virtual host configuration file httpd-vhosts.conf, which has been configured physical path `jd.com` website domain name corresponding to the last page to find in this catalog, show to the browser.

The general process is like that.

Guess you like

Origin www.cnblogs.com/tandaxia/p/12610721.html