centos Learning: Why PHP and apache able to "illicit sexual relations", write your own apache module

1, generating a skeleton
./apxs daichen -n -g
2, wherein rewriting of "truth"

3. Compile

./apachectl -c -i ./daichen/mod_daichen.c
is automatically generated in the modules in a mod_daichen.so

4,引入
httpd.conf
LoadModule daichen_module modules / mod_daichen.so

5、配置
httpd.conf
AddType application/x-httpd-php .php
AddType daichen .daichen

[Representative Suffix .xx content_type to the file XXX]
[content_type automatically determines the request is valid and then go to "hook" the modules, if the hook used on the matching module to handle the request]

Published 65 original articles · won praise 3 · views 50000 +

Guess you like

Origin blog.csdn.net/web_orange/article/details/74055772