Home Backend Development PHP Tutorial Conversion of APACHE configuration file httpd.conf to 3_PHP tutorial

Conversion of APACHE configuration file httpd.conf to 3_PHP tutorial

Jul 13, 2016 pm 05:28 PM
ad apache about of Configuration file

IndexOptions FancyIndexing AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip AddIconByType (TXT,/icons/text.gif) text/* AddIconByType (IMG,/icons/image2.gif) image/* AddIconByType (SND ,/icons/sound2.gif) audio/* AddIconByType (VID,/icons/movie.gif) video/* AddIcon /icons/binary.gif .bin .exe AddIcon /icons/binhex.gif .hqx AddIcon /icons/tar .gif .tar AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip AddIcon /icons/a.gif .ps . ai .eps AddIcon /icons/layout.gif .html .shtml .htm .pdf AddIcon /icons/text.gif .txt AddIcon /icons/c.gif .c AddIcon /icons/p.gif .pl .py AddIcon /icons /f.gif .for AddIcon /icons/dvi.gif .dvi AddIcon /icons/uuencoded.gif .uu AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl AddIcon /icons/tex.gif .tex AddIcon /icons/bomb.gif core AddIcon /icons/back.gif .. AddIcon /icons/hand.right.gif README AddIcon /icons/folder.gif ^^DIRECTORY^^ AddIcon /icons/blank.gif ^^ BLANKICON^^ DefaultIcon /icons/unknown.gif #AddDescription "GZIP compressed document" .gz #AddDescription "tar archive" .tar #AddDescription "GZIP compressed tar archive" .tgz ReadmeName README HeaderName HEADER IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t 当一个HTTP请求的URL为一个目录的时候,服务器返回这个目录中的索引文件。但如果一个目录中不存在缺省的索引文件,并且该服务器又许可显示目录文件列表的时候,就会显示出这个目录中的文件列表,为了使得这个文件列表能具有可理解性,而不仅仅是一个简单的列表,就需要前面的这些设置参数。 如果使用了Index Options Fancy Indexing文件使用哪种图标,则使用 下面的 AddIconByEncoding、AddIconByType以及AddIcon来定义,分别依据MIME 的编码、类型以及文件的后缀来判断使用何种图标。如果不能确定文档使用的图标,就使用 DefaultIcon服务器还在目录下,查询使用ReadmeName和HeaderName定义的文件(自动加上 . html后缀,如果没有发现,再使用.txt后缀进行搜索),如果发现了这些文件, 就在文件列表之前首先显示这些文件的内容,以使得普通目录列表具备更大的可 理解性。   IndexIgnore让服务器在列出文件列表时忽略相应的文件, 这里使用模式配 置的方式定义文件名。 AddEncoding x-compress Z AddEncoding x-gzip gz  AddEncoding用于告诉一些使用压缩的MIME类型,这样可以让浏览器进行解压缩操作。 AddLanguage en .en AddLanguage fr .fr AddLanguage de .de AddLanguage da .da AddLanguage el .el AddLanguage it .it LanguagePriority en fr de   一个HTML文档可以同时具备多个语言的版本,如对于file1.html文档可以具 备file1.html.en、file1.html.fr 等不同的版本,每个语言后缀必须使用 AddLanguage进行定义。这样服务器可以针对不同国家的客户,通过与浏览器进行协商,发送不同的语言版本。而LanguagePriority 定义不同语言的优先级,以便在浏览器没有特殊要求时,按照顺序使用不同的语言版本回应对file1.html 的请求。 这个国际化的能力实际的应用并不多。 #AddType application/x -httpd-php .phtml #AddType application/x-httpd-php-source .phps  AddType参数可以为特定后缀的文件指定MIME类型,这里的设置将覆盖 mime.types中的设置。   #AddHandler cgi-script .cgi AddHandler是用于指定非静态的处理类型,用于定义文档为一个非静态的文 档类型,需要进行处理,再向浏览器返回处理结果。例如上面注释中的设置是将以.cgi结尾的文件设置为cgi-script类型,那么服务器将启动这个CGI程序以进行处理。如果需要在前面AliasScript定义的路径之外执行CGI程序,就需要使用这个参数进行设置,此后以.cgi结尾的文件将被当作CGI程序执行。   在配置文件、这个目录中的.htaccess以及其上级目录的.htaccess中必须允许执行CGI程序,这需要通过Options ExecCGI参数设定。 #AddType text/html .shtml #AddHandler server-parsed .shtml   另外一种动态进行处理的类型为server-parsed,由服务器自身预先分析网页内的标记,将标记更改为正确的HTML标识。由于server-parsed需要对text/html 类型的文档进行处理,因此首先定义了对应的.shtml为text/html类型。  然而要支持SSI,还要首先要在配置文件(或.htaccess)中使用Options IncludesOptions IncludesNOExec让执行普通的SSI标志,但不执行其中引用的外部程序。Another way to specify the server-parsed type is to use the XBitBack setting option. If XBitHack is set to On, the server will check all text/html type documents (including documents with the .html suffix). If it is found that the file attribute has the execution bit " x", the server considers it to be a server analysis document and needs to be processed by the server. It is recommended to use AddHandler for settings and set XBitBack to Off, because using XBitBack will perform additional checks on all HTML documents, reducing efficiency. #AddHandler send-as-is asis #AddHandler imap-file map #AddHandler type-map var The AddHandler commented above is used to support the asis, map and var processing capabilities of the Apache server. # Action media/type /cgi-script/location # Action handler-name /cgi-script/location Because the processing functions provided internally by Apache are limited, you can use Action to define external programs for the server as dynamic document types that can be processed. These external The program is the same as the standard CGI program. It processes the input data and then outputs the results of different MIME types. For example, to define an operation that first executes wri2txt to process the special suffix wri and then returns the result, you can use: Action windows-writer /bin/wri2txt AddHandler windows-writer wri Further, you can directly use Action to define a certain MIME The type is processed in advance, which requires the Action parameter setting method in the first format in the example. This setting method no longer requires an additional AddHandler to associate the processing operation with the file suffix, but uses Action to directly process MIME type files. But if the document suffix does not have a formal MIME type, you need to define a MIME type first. #MetaDir .web #MetaSuffix .meta Meta information is sent to the client's browser before the document is sent to the client. Therefore, the browser can access this Meta information through the HEAD request without actually returning all the document data through GET. The server usually sends some standard HTTP header information to the browser. If you want to add additional information, you need to use MetaDir to define the directory where the Meta data is stored, and MetaSuffix is ​​used to specify the suffix of the file containing Meta data. #ErrorDocument 500 "The server made a boo boo. #ErrorDocument 404 /missing.html #ErrorDocument 404 /cgi-bin/missing_handler.pl #ErrorDocument 402 http://some.other_server.com/subscription_info.html   If the web page requested by the customer When a situation such as non-existence or lack of access rights occurs, the server will generate an error code and will also respond to the client's browser with a web page identifying the error. ErrorDocument is used to set the content that should be responded to by the client's browser when an error occurs. The first parameter of ErrorDocument is the error sequence number, and the second parameter is the response data, which can be simple text, local web page, local CGI program, and web page on the remote host. BrowserMatch "Mozilla/2" nokeepalive BrowserMatch "MSIE. 4.0b2;" nokeepalive downgrade-1.0 force-response-1.0 BrowserMatch "RealPlayer 4.0" force-response-1.0 BrowserMatch "Java/1.0" force-response-1.0 BrowserMatch "JDK/1.0" force-response-1.0 The BrowserMatch command is specific The client program sets special parameters to ensure compatibility with older browsers and support new features of new browsers. # # SetHandler server-status # Order deny,allow # Deny from all # Allow from .your_domain.com. # # # SetHandler server-info # Order deny,allow # Deny from all # Allow from .your_domain.com # # # Deny from all # ErrorDocument 403 http://phf.apache.org/phf_abuse_log.cgi is used to set access control The settings are mainly for directories and files, but you can also set access control for different URLs, so you don't have to worry about whether ScriptAlias ​​and Alias ​​set the path outside the controlled directory. The statement that controls the URL is the Location statement, which not only protects files and CGI on the server, but also protects special function URLs that cannot find the corresponding files but are provided by the server itself. http://servername/server-status is used to report the current status of the Apache server, and http://servername/server-info is used to report the statistical information of the Apache server. Related settings include the ExtendedStatus parameter, which allows the server to output a more detailed report. # #ProxyRequests On # # # Order deny,allow # Deny from all # Allow from .your_domain.com # #ProxyVia On #CacheRoot "/www/proxy" #CacheSize 5 #CacheGcInterval 4 #CacheMaxExpire 24 #CacheLastModifiedFactor 0.1 #CacheDefaultExpire 1 # NoCache a_domain.com another_domain.edu joes.garage_sale.com # The Apache server itself has the proxy function, but this requires the mod_proxy module to be loaded. This can be determined using the IfModule statement. If the mod_proxy module exists, use ProxyRequests to turn on proxy support. The following Directory is used to set access permission settings to the Proxy function, as well as to set various parameter settings for buffering. Virtual Host #NameVirtualHost 12.34.56.78:80 #NameVirtualHost 12.34.56.78 # # ServerAdmin webmaster@host.some_domain.com # DocumentRoot /www/docs/host.some_domain.com # ServerName host.som

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/531827.htmlTechArticleIndexOptions FancyIndexing AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip AddIconByType (TXT,/icons/text.gif) text/* AddIconByType (IMG,/icons/image2.gif) image/*...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP Framework Performance Comparison: The Ultimate Showdown of Speed ​​vs. Efficiency PHP Framework Performance Comparison: The Ultimate Showdown of Speed ​​vs. Efficiency Apr 30, 2024 pm 12:27 PM

According to benchmarks, Laravel excels in page loading speed and database queries, while CodeIgniter excels in data processing. When choosing a PHP framework, you should consider application size, traffic patterns, and development team skills.

Where is the win10 user profile? How to set the user profile in Win10 Where is the win10 user profile? How to set the user profile in Win10 Jun 25, 2024 pm 05:55 PM

Recently, many Win10 system users want to change the user profile, but they don’t know how to do it. This article will show you how to set the user profile in Win10 system! How to set up user profile in Win10 1. First, press the "Win+I" keys to open the settings interface, and click to enter the "System" settings. 2. Then, in the opened interface, click "About" on the left, then find and click "Advanced System Settings". 3. Then, in the pop-up window, switch to the "" option bar and click "User Configuration" below.

How to add a server in eclipse How to add a server in eclipse May 05, 2024 pm 07:27 PM

To add a server to Eclipse, follow these steps: Create a server runtime environment Configure the server Create a server instance Select the server runtime environment Configure the server instance Start the server deployment project

How to conduct concurrency testing and debugging in Java concurrent programming? How to conduct concurrency testing and debugging in Java concurrent programming? May 09, 2024 am 09:33 AM

Concurrency testing and debugging Concurrency testing and debugging in Java concurrent programming are crucial and the following techniques are available: Concurrency testing: Unit testing: Isolate and test a single concurrent task. Integration testing: testing the interaction between multiple concurrent tasks. Load testing: Evaluate an application's performance and scalability under heavy load. Concurrency Debugging: Breakpoints: Pause thread execution and inspect variables or execute code. Logging: Record thread events and status. Stack trace: Identify the source of the exception. Visualization tools: Monitor thread activity and resource usage.

Application of algorithms in the construction of 58 portrait platform Application of algorithms in the construction of 58 portrait platform May 09, 2024 am 09:01 AM

1. Background of the Construction of 58 Portraits Platform First of all, I would like to share with you the background of the construction of the 58 Portrait Platform. 1. The traditional thinking of the traditional profiling platform is no longer enough. Building a user profiling platform relies on data warehouse modeling capabilities to integrate data from multiple business lines to build accurate user portraits; it also requires data mining to understand user behavior, interests and needs, and provide algorithms. side capabilities; finally, it also needs to have data platform capabilities to efficiently store, query and share user profile data and provide profile services. The main difference between a self-built business profiling platform and a middle-office profiling platform is that the self-built profiling platform serves a single business line and can be customized on demand; the mid-office platform serves multiple business lines, has complex modeling, and provides more general capabilities. 2.58 User portraits of the background of Zhongtai portrait construction

The evasive module protects your website from application layer DOS attacks The evasive module protects your website from application layer DOS attacks Apr 30, 2024 pm 05:34 PM

There are a variety of attack methods that can take a website offline, and the more complex methods involve technical knowledge of databases and programming. A simpler method is called a "DenialOfService" (DOS) attack. The name of this attack method comes from its intention: to cause normal service requests from ordinary customers or website visitors to be denied. Generally speaking, there are two forms of DOS attacks: the third and fourth layers of the OSI model, that is, the network layer attack. The seventh layer of the OSI model, that is, the application layer attack. The first type of DOS attack - the network layer, occurs when a large number of of junk traffic flows to the web server. When spam traffic exceeds the network's ability to handle it, the website goes down. The second type of DOS attack is at the application layer and uses combined

How to deploy and maintain a website using PHP How to deploy and maintain a website using PHP May 03, 2024 am 08:54 AM

To successfully deploy and maintain a PHP website, you need to perform the following steps: Select a web server (such as Apache or Nginx) Install PHP Create a database and connect PHP Upload code to the server Set up domain name and DNS Monitoring website maintenance steps include updating PHP and web servers, and backing up the website , monitor error logs and update content.

How to implement PHP security best practices How to implement PHP security best practices May 05, 2024 am 10:51 AM

How to Implement PHP Security Best Practices PHP is one of the most popular backend web programming languages ​​used for creating dynamic and interactive websites. However, PHP code can be vulnerable to various security vulnerabilities. Implementing security best practices is critical to protecting your web applications from these threats. Input validation Input validation is a critical first step in validating user input and preventing malicious input such as SQL injection. PHP provides a variety of input validation functions, such as filter_var() and preg_match(). Example: $username=filter_var($_POST['username'],FILTER_SANIT

See all articles