十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
链接:https://pan.baidu.com/s/11X5CEWoVemxlGuNQqn9cuA
提取码:jn6l
[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!
进行抓包,可以看到,图片也被抓到,并且在上传过程中,图片被压缩
另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。