When doing this experiment in the early stage:
Httpd: SELinux (put it in the disabled state in advance)
Getenforce
Setenforce 0
Edit/etc/sysconfig/SELinux
Three SELinux options: Disabled permissive enforcing;
Disabled does not need to be said. permissive is effective for SELinux, but even if you violate the policy, it allows you to continue operations, but records the content you violate.
It is very useful when developing policies.
Httpd is controlled by SELinux on the RedHat system. It must be in the permissive and disabled state.
Httpd. x86_64: Service Package
Httpd-devel.i386: This is the Development Kit, do not do development will not use it;
Httpd-manual.x86_64: Local manual page;
You only need to install the httpd package.
Httpd: SELinux
/Usr/sbin/httpd (MPM: prefork) is prefork by default;
After the HTTPd process starts, there are several processes. The reasons for these processes are as follows:
Httpd: Root, Master Process
In Linux, only the Administrator has the permission to start a port smaller than 1024. Therefore, the first process is started by the Administrator. It does not respond to user requests. It is used to create idle processes or destroy processes.
Httpd: Apche, Apache (Worker Process) Worker Process
It also has its own service script:
/Etc/rc. d/init. d/httpd
Port: (80/TCP), (https: 443/tcp)
The installation directory of the task software is in the/etc/httpd directory;
/Etc/httpd: Working root directory, equivalent to the program installation directory in Windows
/Etc/httpd/conf: configuration file directory
Main configuration file: httpd. conf
The main configuration file consists of the following parts:
/Etc/httpd/CONF. d/*. conf
/Etc/httpd/modules: # module directory path;
/Etc/httpd/logs -->/var/log/httpd: # log file directory
There are two types of log files: access log access_log, Error Log: err_log
/Var/www/# page path for the Web server to respond to user requests;
Html # Apache provides the path for static access;
Cgi-bin # Apache provides the path for dynamic access;
CGI: Common Gateway Interface (Common Gateway Interface) can be understood as a protocol
Role: (a mechanism that enables the Web server to communicate with additional applications, enabling the Web server to start an application when necessary,
To process dynamic requests)
Client --> httpd (index. cgi) --> spawn (generated, generated) process (index. cgi) --> httpd --> Client
What programming languages can be used to develop dynamic CGI: Perl and Python (by default, it is very useful to develop dynamic web pages ),
Java, (servlet, JSP), and PHP (languages used to develop dynamic websites ).
Each programming language has its own adaptation scenarios;
To minimize the pressure on the Web server, whether or not you use dynamic calling on the Web server makes our dynamic server process come true,
Dynamic Processes are declared just like Web servers. There is also a service name. The service name is FastCGI. At this time, the creation and recovery of these dynamic processes,
It is done by your own server, which is called FastCGI. This is also a type of CGI. In this case, we can
The static content is a server. For dynamic requests, use the TCP/IP protocol to request our dynamic server. Static content and dynamic content are separated at this time. This is why dynamic content is processed
A server is called an application server. In this way, the static server and the dynamic server are separated.
A program consists of commands and data, and commands are the commands to run on the CPU. The most important thing in the program is to help us process data. How can I manage a large data volume? It was put in the document in the early stage and is very busy in management.
Later, we introduced a data management mechanism called a database server. This kind of program can help me manage data, and can provide this kind of data service to other applications or users through some interface. This interface
This is called the database API. When the application server becomes increasingly busy, we cannot divide the application server into two parts, because the data accessed by users cannot be synchronized. In this case, you need to layer again. If you want to access
Dynamic Data: first access the Web server, then access the application server, application server, and application server to access the database server, and application server to complete data conversion,
Convert it to an HTML document, and then return it to the Web server. Then, the web server returns it to the customer.
I use Apache server at the front end, PHP server at the middle end, and MySQL server at the back end. This is called Lamp.
Therefore, all subsequent content is centered around the web server. Then we can use the hadoop cluster to process the information in parallel later on. How these servers work together and how they are linked.
FastCGI: The mechanism for external servers to communicate with CGI. We call it FastCGI. With it, dynamic processes will generate specialized processes.
Programs: commands and Data
Data and database services
The following describes how to configure static pages of httpd and how to adjust them.
The main log line in the future: How to build a single httpd server, how to build PHP, and how to build MySQL. How to combine httpd with PHP. How to associate the MySQL domain httpd and PHP. How to build a server
Lamp, how to split it, how to build it on three servers, lamp. How can we extend it to a lamp cluster.
One of the Apache servers (APACHE)