Apahce configuration instructions can be divided into two blocks, core instructions and instructions provided by third parties. In apache, each instruction corresponds to a module, and among all modules, the most important ones are core_module, so_module, http_module, and mpm modules. Except for so_moudle, other modules cannot be turned off or disabled.
1: httpd.conf
(1) Main server part
1, ServerName: Define the apache default host name, you can Is the domain name or IP address
2, ServerRoot: used to define the directory where the server is located, this path is usually specified by --prefix during configuration
3, DocumentRoot: used to specify Apache provides the root directory of the page service. This path must be an absolute path rather than a relative path. If there are spaces, it needs to be enclosed in quotation marks.
4. ServerAdmin: The address to send an email to the administrator after a server error.
5, ServerAlias and Alias: are all used to map directories, but ServerAlias identifies the mapped directory as a CGI script directory and treats all files in this directory as CGI scripts. But Alias is just mapped to a normal directory
6, User and Group: used to define the user and user group used to run the apache child process
7, Listen: used to define the listening apache Port number
8, LoadModule command: used to load modules or target files LoadModule cgi_module modules/mod_cgi.so_module
9, ErrorDocument: Custom error page information ErrorDocument 500 "unknown error" ErrorDocument 404 "/var/server/www/cgi-bin/missing_404.pl" ErrorDocument 402 http://www.nicky.com/error_402.html
10. options: Determine which directories to use those features , these features are as follows:
None: The option command will not take effect
ExecCGI: Allows execution of CGI scripts in the current directory
Includes: Allows the use of SSI functions
IncludesNOEXEC: The SSI function is allowed, but the exec cgi and exec cmd functions are disabled.
Indexes: Enable the index function. For example, if a request is made to the directory URLz and there is no index file specified by the DirectoryIndex directive, the server will Automatically return a list of requested directory contents
FollowSymLinks: Allows the use of symbolic links in the current environment, but will be ignored in the Location container
All: Uses all features except MultiViews, also options The default parameters
MultiViews: used to start the multi-view function provided by the mod_negotiations module
11, ServerTokens: OS/Major/Full affects the detail of the error footer information, and is generally not recommended.
(2) Container part
1,
<ifmodule mpm_netware_module><br> DirectoryIndex index.html <br></ifmodule>
If loaded Enter then execute <ifmodule mpm_netware_module><br> DirectoryIndex index.html <br></ifmodule>
If not loaded, execute
2
Based on
<ifdefine proxy></ifdefine>
LoadModule proxy_module modules/libproxy.so
##
Order Deny,Allow
Deny from all
The above example disables access to the /var/apache/html directory. Any request to /var/apache/html will be rejectedIf you want the directory to use regular expressions, you need to add a ~
Order Deny,Allow
Allow from all
<p>4 <files> and <filesmatch><br>Files: only works on files, you can also use wildcards and [] and ~ in front of the regular expression to use regular expressions<br><code><br> Order Deny,Allow<br>Allow from All<br>
FilesMatch: Files without adding a ~ symbol<filesmatch><br>Order Deny,Allow<br>Allow from All<br></filesmatch>
5
<location></location>
Order Allow,Deny
Deny from All
If the URL starts with cgi, it will be rejected
In addition, you can also URL requests are mapped to the Apache module handler, for example, using the mod_status module: <location><br>SetHandler server-status<br></location>
If you use the above configuration. Then when accessing /server-status, Apache will hand over the connection to the mod_status module for processing and return an Apache server running status page
Container processing order issue:
Apache will process it first The Directory container (but Directory and .htaccess with regular expressions will not be processed,) then the Files and FilesMatch containers, and then the Location and LocationMatch containers
<location></location>
Order deny,allow
## Allow from All
> ;
##
Above For example, since Apache will process the <directory> container first, and the <location> container processed last will overwrite the previous Directory configuration, so www.json.com will be allowed to be accessed by users. If the containers are the same, they will be listed in dictionary order. Work from short to long. </location></directory>
linux video tutorial
The above is the detailed content of Apache service configuration explained in detail. For more information, please follow other related articles on the PHP Chinese website!

本文给大家介绍如何安装apache2.4,以及如何配置php8.0,文中附有图文详细步骤,下面就带大家一起看看怎么安装配置apache2.4+php8.0吧~

mod_limitipconn,这个是apache的一个非官方模块,根据同一个来源ip进行并发连接控制,bw_mod,它可以根据来源ip进行带宽限制,它们都是apache的第三方模块。1.下载:wgetwget2.安装#tar-zxvfmod_limitipconn-0.22.tar.gz#cdmod_limitipconn-0.22#vimakefile修改:apxs=“/usr/local/apache2/bin/apxs”#这里是自己apache的apxs路径,加载模块或者#/usr/lo

查看apache版本的步骤:1、进入cmd命令窗口;2、使用cd命令切换到Apache的bin目录下,语法“cd bin目录路径”;3、执行“httpd -v”命令来查询版本信息,在输出结果中即可查看apache版本号。

本篇文章给大家带来了关于PHP的相关知识,其中主要跟大家分享在Ubuntu20.04 LTS环境下安装Apache的全过程,并且针对其中可能出现的一些坑也会提供解决方案,感兴趣的朋友下面一起来看一下吧,希望对大家有帮助。

1.Nginx和tomcat的区别nginx常用做静态内容服务和代理服务器,直接外来请求转发给后面的应用服务器(tomcat,Django等),tomcat更多用来做一个应用容器,让javawebapp泡在里面的东西。严格意义上来讲,Apache和nginx应该叫做HTTPServer,而tomcat是一个ApplicationServer是一个Servlet/JSO应用的容器。客户端通过HTTPServer访问服务器上存储的资源(HTML文件,图片文件等),HTTPServer是中只是把服务器

在使用 PHP 进行网站开发时,你可能会遇到字符编码问题。特别是在使用不同的 Web 服务器时,会发现 IIS 和 Apache 处理字符编码的方法不同。当你使用 IIS 时,可能会发现在使用 UTF-8 编码时出现了乱码现象;而在使用 Apache 时,一切正常,没有出现任何问题。这种情况应该怎么解决呢?

Pacemaker是适用于类Linux操作系统的高可用性集群软件。Pacemaker被称为“集群资源管理器”,它通过在集群节点之间进行资源故障转移来提供集群资源的最大可用性。Pacemaker使用Corosync进行集群组件之间的心跳和内部通信,Corosync还负责集群中的投票选举(Quorum)。先决条件在我们开始之前,请确保你拥有以下内容:两台RHEL9/8服务器RedHat订阅或本地配置的仓库通过SSH访问两台服务器root或sudo权限互联网连接实验室详情:服务器1:node1.exa

快速查看服务器软件的编译参数:1、nginx编译参数:your_nginx_dir/sbin/nginx-v2、apache编译参数:catyour_apache_dir/build/config.nice3、php编译参数:your_php_dir/bin/php-i|grepconfigure4、mysql编译参数:catyour_mysql_dir/bin/mysqlbug|grepconfigure以下是完整的实操例子:查看获取nginx的编译参数:[root@www~]#/usr/lo


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version
Visual web development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Atom editor mac version download
The most popular open source editor

SublimeText3 Linux new version
SublimeText3 Linux latest version
