To configure SSI
What is? shtml?
Use SSI(Server Side Include) Of html File extension ,SSI(Server Side Include), Often referred to as " Server side embedded " Or call it " Server side contains ", It's something like ASP Web page making technology based on server . The default extension is .stm、.shtm and .shtml.
What is? SSI?
SSI It's English Server Side Includes Abbreviation , Translated into Chinese, it means that the server contains . Technically speaking ,SSI Is in the HTML In file , Commands or pointers that can be called through comment lines .SSI It has powerful functions , Just use a simple SSI Command can realize the content update of the whole website , Dynamic display of time and date , And perform shell and CGI Scripts and other complex functions . Website maintenance often encounters a problem is , The structure of the website has been fixed , But in order to update a little content and had to redo a large number of pages .SSI Provides a simple 、 Effective ways to solve this problem , It puts the basic structure of a website in a few simple HTML In file ( Templates ), In the future, all we have to do is send the text to the server , Let the program automatically generate web pages according to the template , This makes it easy to manage large websites

How to configure Apache Support SSI?
Apache Not supported by default SSI Of , We need to change httpd.conf To configure . Here I am. windows Platform Apache 2.0.x For example , open conf In the catalog httpd.conf file , Search for “AddType text/html .shtml”, find :

# AddType text/html .shtml
# AddOutputFilter INCLUDES .shtml
Put these two lines in front of # Get rid of .

And then the search “Options Indexes FollowSymLinks”
Add... After the line you found “ Includes”
To change the line to Options Indexes FollowSymLinks Includes
be familiar with apache manual You may find it easier .
preservation httpd.conf, Lifting apache that will do
So we're done with Apache SSI Set up .

verification SSI Configuration is successful
Create a new file in the server directory ssitest.shtml
The content of the document is
<!--#echo var="DATE_LOCAL" -->
echo The element simply feeds back the value of a variable . There are many standard variables , Including CGI All environment variables that are valid for the program . in addition , You can also use it set Element defines your special variables .
Open to get the following
Tuesday, 26-Aug-2008 10:25:53 China standard time
Represents the configuration SSI success , If there is no such output , Please check APACHE Whether the version or configuration is correct

Another example :
If you want to include a standard footer , Suppose the content of the footers is as follows , Name it footer.html
<div style="border:1px solid #333;background:lightyellow;padding:10px;font-size:12px">
Copyright rabbitlxb,All rights reserved.
</div>
stay ssitest.shtml The following statement is used in the file
<!--#include virtual="footer.html" -->
The results are shown in the figure below
How to make your Apache Server support SSI
You can see ,footer.html The content of is introduced into ssitest.html It's in

--------------------------------------------------------------------------------------------
The following attachment should be a lot like me PHP People in the program are more concerned about , You can have a look if you are interested , Of course , You can solve problems by yourself , It's not a problem
--------------------------------------------------------------------------------------------
attach :
CSDN Someone on the street asked if they could SSI Order follows PHP Execute under the same instruction , The answer is No , But I think it should be possible , because APACHE Determine which script to execute based on the file suffix , Such as configuration files httpd.conf There's a passage in :、
AddType application/x-httpd-php .php
If the suffix of the document is PHP To execute one of the php Script
therefore , We can add this sentence
AddType application/x-httpd-php .shtml
Give Way apache know shtml Suffixes are also executed PHP Script , This is because the configuration above already tells APACHE With shtml Suffix file to execute ssi Instructions , Plus this configuration , restart APACHE, With shtml The end of the file can be executed at the same time ssi and PHP Instructions , such , The next thing we need to do is to put SSI and php Instructions are written to the same file , Then specify the file suffix as shtml Everything OK La

Finally, in the actual project, it is found that according to the above configuration volt Template Introduction .shtml The file still doesn't show the head and bottom :
Finally, it was changed to :
AddType text/html .shtml
AddOutputFilter INCLUDES .php
</IfModule>

This is fine , The main points are as follows .php

How to make your Apache Server support SSI

(2008-08-26 10:14:00)

label :

gossip

 
What is? shtml? 
   Use SSI(Server Side Include) Of html File extension ,SSI(Server Side Include), Often referred to as " Server side embedded " Or call it " Server side contains ", It's something like ASP Web page making technology based on server . The default extension is  .stm、.shtm  and  .shtml. 
What is? SSI? 
  SSI It's English Server Side Includes Abbreviation , Translated into Chinese, it means that the server contains . Technically speaking ,SSI Is in the HTML In file , Commands or pointers that can be called through comment lines .SSI It has powerful functions , Just use a simple SSI Command can realize the content update of the whole website , Dynamic display of time and date , And perform shell and CGI Scripts and other complex functions . Website maintenance often encounters a problem is , The structure of the website has been fixed , But in order to update a little content and had to redo a large number of pages .SSI Provides a simple 、 Effective ways to solve this problem , It puts the basic structure of a website in a few simple HTML In file ( Templates ), In the future, all we have to do is send the text to the server , Let the program automatically generate web pages according to the template , This makes it easy to manage large websites

How to configure Apache Support SSI? 
Apache Not supported by default SSI Of , We need to change httpd.conf To configure . Here I am. windows Platform Apache 2.0.x For example , open conf In the catalog httpd.conf file , Search for “AddType text/html .shtml”, find :

# AddType text/html .shtml 
  # AddOutputFilter INCLUDES .shtml 
   Put these two lines in front of # Get rid of  .

And then the search “Options Indexes FollowSymLinks” 
   Add... After the line you found “ Includes” 
   To change the line to  Options Indexes FollowSymLinks Includes 
   be familiar with apache manual You may find it easier . 
   preservation httpd.conf, Lifting apache that will do  
   So we're done with Apache SSI Set up .

verification SSI Configuration is successful  
Create a new file in the server directory ssitest.shtml 
The content of the document is  
<!--#echo var="DATE_LOCAL" --> 
echo The element simply feeds back the value of a variable . There are many standard variables , Including CGI All environment variables that are valid for the program . in addition , You can also use it set Element defines your special variables . 
Open to get the following  
Tuesday, 26-Aug-2008 10:25:53  China standard time  
Represents the configuration SSI success , If there is no such output , Please check APACHE Whether the version or configuration is correct

Another example : 
If you want to include a standard footer , Suppose the content of the footers is as follows , Name it footer.html 
<div style="border:1px solid #333;background:lightyellow;padding:10px;font-size:12px"> 
Copyright rabbitlxb,All rights reserved. 
</div> 
stay ssitest.shtml The following statement is used in the file  
<!--#include virtual="footer.html" --> 
The results are shown in the figure below  
 
You can see ,footer.html The content of is introduced into ssitest.html It's in  
 
 
--------------------------------------------------------------------------------------------
The following attachment should be a lot like me PHP People in the program are more concerned about , You can have a look if you are interested , Of course , You can solve problems by yourself , It's not a problem
--------------------------------------------------------------------------------------------
attach :
CSDN Someone on the street asked if they could SSI Order follows PHP Execute under the same instruction , The answer is No , But I think it should be possible , because APACHE Determine which script to execute based on the file suffix , Such as configuration files httpd.conf There's a passage in :、
AddType application/x-httpd-php .php
If the suffix of the document is PHP To execute one of the php Script
therefore , We can add this sentence
AddType application/x-httpd-php .shtml
Give Way apache know shtml Suffixes are also executed PHP Script , This is because the configuration above already tells APACHE With shtml Suffix file to execute ssi Instructions , Plus this configuration , restart APACHE, With shtml The end of the file can be executed at the same time ssi and PHP Instructions , such , The next thing we need to do is to put SSI and php Instructions are written to the same file , Then specify the file suffix as shtml Everything OK La

 
 
Finally, in the actual project, it is found that according to the above configuration volt Template Introduction .shtml The file still doesn't show the head and bottom :
Finally, it was changed to :

AddType text/html .shtml
AddOutputFilter INCLUDES .php
</IfModule>

This is fine , The main points are as follows .php

Windows Of Apache Support SSI More articles on configuration

  1. Windows Next Apache+mod_python+Django To configure

    Windows Next Apache+mod_python+Django To configure Apache First install Apache, The version I installed was 2.2.*: Python python It must be installed , The version I installed was 2.5 Of ...

  2. windows Next apache+https Environment configuration

    windows Next apache+https Environment configuration turn https://www.cnblogs.com/sandaizi/p/7519370.html 1. Modify the configuration file conf/httpd.conf, Go to ...

  3. apache and nginx Support SSI To configure

    Today, a new language format has been discovered :.shtml One . Preface SSI It's something like ASP Web page making technology based on server . Before sending content to the browser , have access to " Server side contains (SSI)" The command will text . chart ...

  4. Windows operating system Apache Configuration under the server PHP

    stay Apache web On the server PHP Before the project , It needs to be configured accordingly , The server can resolve php Text , Normal display php Dynamic page content . It's going on php Before configuration, it is already in Windows It's installed under the system Apache The server ...

  5. Windows Next apache php wordpress To configure

    2. Use notepad to open httpd.conf config file. Make use the line "LoadModule rewrite_module mod ...

  6. Apache Support .htaccess Configuration method

    open httpd.conf After the file is opened with a text editor , lookup   The code is as follows Copy code Options FollowSymLinks AllowOverride None Change it to : Options FollowSy ...

  7. windows Next apache+php+mysql To configure

    Apache 2.4.10( file :httpd-2.4.10-win64-VC11.zip) php 5.6.26 ( file :php-5.6.25-Win32-VC11-x64.zip) mysql 5. ...

  8. windows below apache Virtual host configuration

    <VirtualHost > ServerAdmin www.test2.com DocumentRoot "D:/PHP/Apache/htdocs/testSite2&quo ...

  9. Linux Next apache Support PHP To configure

    https://www.cnblogs.com/qiuxiao/p/6815350.html https://www.cnblogs.com/polestar/p/6086552.html

Random recommendation

  1. android Image caching

    One .Picasso https://github.com/square/picasso Picasso yes Square The company's open source Android Picture loading framework on the platform , Simple and easy to use , In a word, we can add pictures to the project ...

  2. tomcat Concurrent

    Tomcat The maximum concurrent number of is configurable , In practice , Maximum concurrency with hardware performance and CPU Quantity has a lot to do with . Better hardware , More processors will make Tomcat Support more concurrency . Tomcat default HTTP The implementation is blocking ...

  3. volatile brief introduction

    volatile brief introduction java The language provides a slightly weaker memory synchronization mechanism , namely volatile Variable . It is used to ensure that other threads are informed of the update operation of variables , Ensure that the new value can be synchronized to the main memory immediately , And immediately refresh from memory before each use . When a variable is declared as ...

  4. Visual Studio 2015 RC Medium ASP.NET New features and problem fixes

    ( This article is also published in my official account of WeChat "dotNET Daily essays ") Microsoft is in Build It was announced at the conference Visual Studio 2015 RC, It also indicates Visual Studio 201 ...

  5. python_ How to build a package

    step : (1) The name of the package is drawing (2)drawing Build modules in color and shape View : remarks : (1) E:/python_script/ Has been added to the system variable path in (2) When creating a package , ...

  6. BICEP Unit test plan - arithmetic - test

    One .6 A specific part worth testing , They can improve your testing skills Right- Is the result right ? B- Whether all the boundary conditions are correct ? I- Can you check the reverse correlation ? C- Can you cross check the results by other means ? E- Can you force ...

  7. uvalive 4589 Asteroids

    The question : Give two convex hulls , The convex hull can rotate , Find the shortest distance between the centers of gravity of convex hull . Ideas : Obviously, when two convex hulls stick together , Shortest distance . therefore , Find the center of gravity first , Then find the shortest distance from the center of gravity to each surface . Three dimensional convex hull + How to find the center of gravity How to find the center of gravity : In the convex hull , Any enumeration , stay ...

  8. How to use CURL And explain JSON

    CURL *curl; CURLcode res; struct curl_slist *headers=NULL; // init to NULL is important headers = cu ...

  9. centos7 build SVN+Apache+IF.svnadmin Realization web management SVN

    Read the directory 1. Introduce 2. Software preparation 3. establish SVN Server Warehouse 4.  configuration setup PHP&IF.SVNadmin 5. Start the service 1. Introduce The company recently wanted to Windows server Platform ...

  10. AJAX Learning notes ( One ) Basic knowledge of

    One .HTTP agreement 1.HTTP: The rules of computer communication through the network , Used for browsers to send requests to servers . 2.HTTP It's a stateless protocol , Stateless means that the server does not keep any connection related information , The browser client sends a request to the server , ...