Apache Server Operations Note (2)----use APXS to compile and install the Mod_txt module

Source: Internet
Author: User
<span id="Label3"></p><p><p>Mod_txt is a very interesting module that implements a text output filter that displays the TXT file you specify on the Page's head and tail on a page of the specified type.</p></p><p><p>On its homepage http://apache.webthing.com/mod_txt can get it.</p></p><p><p>The entire module is a file of less than 180 lines, very simple. Use wget to retrieve it.</p></p><p><p>1. Download the mod_txt.c source file and compile, install</p></p><pre><pre><span style="color: #0000ff;">wget</span> http:<span style="color: #008000;">//</span><span style="color: #008000;">apache.webthing.com/mod_txt/mod_txt.c</span><span style="color: #000000;"></span>/usr/local/apache2/bin/<span style="color: #000000;">apxs to compile # </span>/usr/local/apache2/<span style="color: #000000;">bin has been added to the environment variable [[email protected]:</span>~/downloads]# apxs-c-i mod_txt.c</pre></pre><p><p>This will download and compile, install the mod_txt, in The/usr/local/apache2/modules/directory of the new mod_txt.so File. Use</p></p><pre><pre><span style="color: #0000ff;">grep</span> txt/usr/local/apache2/conf/httpd.conf</pre></pre><p><p>command to see the following additions to the httpd.conf file:</p></p><p><p></p></p><p><p>The modules/mod_txt.so module is Loaded.</p></p><p><p>2. Previously added the Include conf/vhost/*.conf command at the end of the/usr/local/apache2/conf/httpd.conf file so that later you want to add a command to httpd.conf, just directly in the Conf/vhost /ADD. conf files to the Directory.</p></p><p><p>We add the following mod_txt.conf to the conf/vhost/directory, which reads as Follows:</p></p><p><p></p></p><p><p>The Textheader in the mod_txt.conf file indicates that when a Web connection accesses the TXT file on the server, the contents of the Header-file are added to the file header, and Textfooter indicates that the contents of the Footer-file are added at the end of the TXT file.</p></p><p><p>Now that the settings are not in effect, we restart the Apache Server:</p></p><p><p></p></p><p><p>3. Test Mod_txt Efficacy</p></p><p><p>(i) the Header-file and footer-file files have not been added to the conf/vhost/directory at this Time. We now add a Test.txt file under the server files Directory:</p></p><p><p></p></p><p><p>To browse using the host Browser:</p></p><p><p></p></p><p><p>The text is transmitted as is.</p></p><p><p>(ii) new Header-file and Footer-file in the Conf/vhost/directory:</p></p><p><p></p></p><p><p>Then use the host browser to View:</p></p><p><p></p></p><p><p>You can see that the contents of Header-file and Footer-file are added to the head and tail of The. txt file.</p></p><p><p>Apache Server Operations Note (2)----use APXS to compile and install the Mod_txt module</p></p></span>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.