nginx及tomcat访问图片及静态页面配置方法.docx

nginx及tomcat访问图片及静态页面配置方法.docx

  1. 1、本文档共6页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
nginx和tomcat访问图片和静态页面的配置方法【来源:小鸟云计算】小鸟云,免费12个月主机套餐,只为建站而生。生产环境下,有时候需要访问图片,正常需要应用ftp、nginx等配套使用,但是有时候为了简化,可以用以下的两种简单的访问,说实话,就是为了偷懒,但是效果是能有的,这就行了,所以今天做这个简化版的方便大家应急之用。第一种方法:nginx配置下1、创建文件路径:/article/139105.htm?123[root@localhost /]# mkdir /data/soft/ [root@localhost ~]# cd /data/soft/ [root@localhost soft]# mkdir html images?2、在images目录下面放入图片/article/139105.htmroot@localhost soft]# cd images/ [root@localhost images]# ll 总用量 80 -rw-r--r--. 1 root root 9503 4月 25 17:06 thPZFULFJN.jpg -rw-r--r--. 1 root root 16083 4月 25 17:06 thR2C5VCMZ.jpg -rw-r--r--. 1 root root 12218 4月 25 17:06 thRG3YX53T.jpg -rw-r--r--. 1 root root 15048 4月 25 17:06 thSUF51VTR.jpg -rw-r--r--. 1 root root 21799 4月 25 17:06 thVWSLF8ZE.jpg3、在html目录下面放入一个测试文件/article/139105.htm?12[root@localhost html]# cat index.html this is test page !!!!?4、安装nginx,并启动选用yum还是编译看自己喜好,我选择编译,自己制定安装模块解压pcre-8.34.tar.gz zlib-1.2.8.tar.gz openssl-1.0.1g.tar.gz三个包并安装/article/139105.htm?123456789tar -zxvf pcre-8.34.tar.gz cd pcre-8.34 /configure make make installtar -zxvf zlib-1.2.8.tar.gz cd zlib-1.2.8 /configure make make installtar -zxvf openssl-1.0.1g.tar.gz cd openssl-1.0.1g /config make make install安装Nginx/article/139105.htm?12345678910111213141516171819tar -zxvf nginx-1.9.0.tar.gz cd nginx-1.9.0 #./configure --prefix=/data/soft/nginx \ --user=www \ --group=www \ --with-mail \ --with-mail_ssl_module \ --with-http_ssl_module \ --with-http_flv_module \ --with-http_dav_module \ --with-http_sub_module \ --with-http_spdy_module \ --with-http_realip_module \ --with-http_addition_module \ --with-http_gzip_static_module \ --with-http_stub_status_module \ --with-pcre=/data/src/pcre-8.34 \ --with-zlib=/data/src/zlib-1.2.8 \ --with-openssl=/data/src/openssl-1.0.1g?编译并安装/article/139105.htm?123make make installgroupadd www useradd -g www www?修改nginx配置文件/article/139105.htm?1234567891011121314151617181920212223242526272829303132333435[root@localhost nginx]# vim conf/nginx.conf ?server { ?listen 80; ?server_name localhos

文档评论(0)

moon8888 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档