In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to turn on SSI configuration under Apache to make html support include", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "how to enable SSI configuration under Apache to make html support include"!
For a simple example, for example, you have the following html file (named index.html):
A simple text box and button, I now want to write the html of the button part in another .html file (say btn.html) and introduce it into index.html. What should I do?
1. Load ssi module
The first step is to load the ssi module. Open the apache configuration file httpd.conf, which should already be familiar, which has been mentioned many times in the previous article. Find this line of LoadModule ssl_module modules/mod_ssl.so and remove the previous comment (#).
2016.01.11 more:
After local testing, this step is not necessary. Thank you whuper for pointing out.
2. Add the required file types
Also find the following two lines of code under the httpd.conf file:
AddType text/html .shtml AddOutputFilter INCLUDES .shtml
Remove the comments if you have any comments. Because the default file name for using ssi technology is .shtml, we need to set the .shtml suffix name in the configuration file and set the file type settings that need to be parsed for ssi technology according to our own requirements.
For example, here I want to use the .html file to operate, so I can add it at the end of the above two lines of code, such as this:
AddType text/html .shtml .htmlAddOutputFilter INCLUDES .shtml .html
3. Add INCLUDES
Again in the httpd.conf file, find this line of Options Indexes FollowSymLinks http://www.bbqmw.net/, add INCLUDES after it, and look like this:
Options Indexes FollowSymLinks INCLUDES
It is important to note that ssi can use shell to execute commands, so this function is dangerous, it will execute any commands contained in the exec tag, if your users have permission to modify your web page content, it is recommended to turn this function off. Of course, you can also add the IncludesNOEXEC parameter to turn off exec while keeping SSI. Now change to: Options Indexes FollowSymLinks INCLUDES IncludesNOEXEC
4. Restart apache
Finally, restart apache must not forget that some children's shoes at the beginning of the configuration of apache, often say how it does not work ah, often forget to restart.
5. Practice
With this configuration, we can introduce the html file into the html page, such as:
You can also use the file parameter:
What's the difference?
The include element can determine which files should be included by the file attribute or the virtual attribute. The file attribute is a file path relative to the current directory, that is, it cannot be an absolute path (starting with "/") or a path containing ".. /", that is, the included file can be in the same level directory or its subdirectory, but not in the next level directory. The virtual attribute, which is a URL relative to the supplied document, can start with "/" but must be on the same server as the provided document, and the virtual filename is the full path to the virtual directory on the Web site.
Generally speaking, virtual is equivalent to an absolute path (starting from the server root), while file is equivalent to a relative path (and files cannot be in the parent directory). So we usually use virtual to ok.
At this point, I believe you have a deeper understanding of "how to turn on SSI configuration under Apache to make html support include". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.