Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Apache compression

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Apache compressed Apache installation package

Link: https://pan.baidu.com/s/11X5CEWoVemxlGuNQqn9cuA

Extraction code: jn6l

1. Install and configure Apache service 1.1.Through sharing Mount the Apache installation package to the virtual machine [root@localhost ~] # mkdir / abc / / create a mount point [root@localhost ~] # mount.cifs / / 192.168.100.3/LAMP-C7 / abc / / mount Password for root@//192.168.100.3/LAMP-C7: [root@localhost ~] # cd / abc [root@localhost abc] # ls / / Check the package apr-1.6.2.tar.gz Discuz_X2.5_SC_UTF8.zip mysql-5.6.26.tar.gzapr-util-1.6.0.tar.gz fiddler.exe php-5.6.11.tar.bz2awstats-7.6.tar.gz httpd-2.4.29.tar.bz2cronolog-1.6.2-14. El7.x86_64.rpm LAMP-php5.6.txt1.2 、 Decompress the source package Pressurized to / opt/ [root@localhost abc] # tar zvxf apr-1.6.2.tar.gz-C / opt [root@localhost abc] # tar zvxf apr-util-1.6.0.tar.gz-C / opt [root@localhost abc] # tar jxvf httpd-2.4.29.tar.bz2-C / opt1.3, mobile cross-platform components And install the necessary compilation tools [root@localhost abc] # cd / opt/ [root@localhost opt] # mv apr-1.6.2 httpd-2.4.29/srclib/apr [root@localhost opt] # mv apr-util-1.6.0 httpd-2.4.29/srclib/apr-util [root@localhost opt] # yum clean all / / clear the yum cache [root@localhost opt] # yum list / / reload yum / / install the necessary compilation tools [root@localhost opt] # yum-y install\ > gcc\ > gcc-c++\ > make\ > pcre-devel\ > zlib-devel\ > expat-devel\ > pcre\ > perl1.4, Configure configure [root@localhost opt] # cd / opt/httpd-2.4.29/ [root@localhost httpd-2.4.29] #. / configure\ >-- prefix=/usr/local/httpd\ >-- enable-so\ >-- enable-deflate\ >-- enable-expires\ >-- enable-rewrite\ >-- enable-charset-lite\ >-- enable-cgi1.5 compile and install [root@localhost httpd-2.4.29] # make [root@localhost httpd-2.4.29] # make install2 、 Make the compression setting 2.1 and see if the compression module is started And configure [root@localhost httpd-2.4.29] # vim / usr/local/httpd/conf/httpd.conf

To the last line, fill in the following

AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml text/jpg text/javascript text/png DeflateCompressionLevel 9 SetOutputFilter DEFLATE

2.2 Test to see if the command is correct, and enable the service [root@localhost httpd-2.4.29] # / usr/local/httpd/bin/apachectl-tSyntax OK [root@localhost httpd-2.4.29] # / usr/local/httpd/bin/apachectl start

View listening port

[root@localhost httpd-2.4.29] # netstat-ntap | grep 80tcp 0 192.168.45.135 ntap 80 0.0.0.0 LISTEN 36794/httpd

Turn off the firewall and security features

[root@localhost httpd-2.4.29] # systemctl stop firewalld.service [root@localhost httpd-2.4.29] # setenforce 02.3 Verification Module [root@localhost htdocs] # cd / usr/local/httpd/bin/ [root@localhost bin] #. / apachectl-t-D DUMP_MODULES | grep "deflate" deflate_module (shared) 3. Test in windows10

Open fiddre software to grab the package and check it.

Go back to the virtual machine and add a picture

View the pictures in your shared folder, and then copy them to the web file directory

[root@localhost bin] # cd / abc/ [root@localhost abc] # cp 123.jpg / usr/local/httpd/htdocs/

Add a picture to a web page

[root@localhost abc] # cd / usr/local/httpd/htdocs/ [root@localhost htdocs] # ls123.jpg index.html [root@localhost htdocs] # vim index.htmlIt works!

Return to win10 and connect to refresh the web page again.

When you grab the package, you can see that the picture is also caught, and during the upload process, the picture is compressed.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report