重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
链接:https://pan.baidu.com/s/11X5CEWoVemxlGuNQqn9cuA
提取码:jn6l
创新互联长期为超过千家客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为宝塔企业提供专业的成都网站制作、做网站,宝塔网站改版等技术服务。拥有10多年丰富建站经验和众多成功案例,为您定制开发。
[root@localhost ~]# mkdir /abc //创建挂载点
[root@localhost ~]# mount.cifs //192.168.100.3/LAMP-C7 /abc //挂载
Password for root@//192.168.100.3/LAMP-C7:
[root@localhost ~]# cd /abc
[root@localhost abc]# ls //查看其中的包
apr-1.6.2.tar.gz Discuz_X2.5_SC_UTF8.zip MySQL-5.6.26.tar.gz
apr-util-1.6.0.tar.gz fiddler.exe php-5.6.11.tar.bz2
awstats-7.6.tar.gz httpd-2.4.29.tar.bz2
cronolog-1.6.2-14.el7.x86_64.rpm LAMP-php5.6.txt
[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 /opt
[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 //清除yum缓存
[root@localhost opt]# yum list //重新加载yum
//安装必要编译工具
[root@localhost opt]# yum -y install \
> gcc \
> gcc-c++ \
> make \
> pcre-devel \
> zlib-devel \
> expat-devel \
> pcre \
> perl
[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-cgi
[root@localhost httpd-2.4.29]# make
[root@localhost httpd-2.4.29]# make install
[root@localhost httpd-2.4.29]# vim /usr/local/httpd/conf/httpd.conf
到末行,填入下列内容
AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml text/jpg text/javascript text/png
DeflateCompressionLevel 9
SetOutputFilter DEFLATE
[root@localhost httpd-2.4.29]# /usr/local/httpd/bin/apachectl -t
Syntax OK
[root@localhost httpd-2.4.29]# /usr/local/httpd/bin/apachectl start
查看监听端口
[root@localhost httpd-2.4.29]# netstat -ntap | grep 80
tcp 0 0 192.168.45.135:80 0.0.0.0:* LISTEN 36794/httpd
关闭防火墙,和安全功能
[root@localhost httpd-2.4.29]# systemctl stop firewalld.service
[root@localhost httpd-2.4.29]# setenforce 0
[root@localhost htdocs]# cd /usr/local/httpd/bin/
[root@localhost bin]# ./apachectl -t -D DUMP_MODULES | grep "deflate"
deflate_module (shared)
打开fiddre软件进行抓包查看
查看自己共享文件夹中的图片,然后复制到网页文件目录下
[root@localhost bin]# cd /abc/
[root@localhost abc]# cp 123.jpg /usr/local/httpd/htdocs/
将图片添加到网页中
[root@localhost abc]# cd /usr/local/httpd/htdocs/
[root@localhost htdocs]# ls
123.jpg index.html
[root@localhost htdocs]# vim index.html
It works!
进行抓包,可以看到,图片也被抓到,并且在上传过程中,图片被压缩