ssi

Blocking external access to directory but allowing SSI access (or, How does the `FilesMatch` directive actually work?)

余生长醉 提交于 2019-12-02 07:32:50
On an old site, where i was using PHP, I had a .htaccess in directory /noaccess as follows: # /noaccess/.htaccess <FilesMatch "^.*$"> order allow,deny deny from all </FilesMatch> And I had a PHP file like, <html> <body> <?php include('noaccess/blah.ssi'); ?> </body> </html> This works fine and the contents of blah.ssi is visible. However, on my current site I'm using SSI and the following: <html> <body> <!--#include virtual="noaccess/blah.ssi" --> </body> </html> does not work. The logs show unable to include "noaccess/blah.ssi" . Remove the FilesMatch directive and it works. So I'm obviously

ngnix下conf通用设置方法(php fastcgi)

你。 提交于 2019-12-01 22:40:10
核心做法: 涉及三类配置文件 1. 基础文件 conf/nginx.conf # 说明:nginx默认会引用该文件,该文件会做最通用的参数设置 2. fastcgi参数文件 conf/fastcgi.conf # 说明:fastcgi会设置所有站点通用参数 3. 站点文件 如:conf/vhost/a.com.conf 可以有多个,放在vhost文件夹下 彼此引用说明 在基础文件conf/nginx.conf中插入include *.conf 引用站点文件 站点文件中合适位置插入include fastcgi.conf 设置fastcgi,如果要覆盖参数,可以在引用再赋值一次即可 nginx配置文件里指令的继承关系:Nginx配置文件分为好多块,常见的从外到内依次是「http」、「server」、「location」等等,缺省的继承关系是从外到内,也就是说内层块会自动获取外层块的值作为缺省值 值得参考的文章: http://huoding.com/2013/10/23/290 详细说明: nginx.conf中设置基础参数,内容如下: #用户及用户组设置 user www www; worker_processes 1; #错误级别的日志设置 error_log logs/error.log; #其他级别的日志设置 #error_log logs/error.log notice;

Apache中配置SSI

﹥>﹥吖頭↗ 提交于 2019-12-01 06:44:04
SSI是英文Server Side Includes的缩写,翻译成中文就是服务器端包含的意思。从技术角度上说,SSI就是在HTML文件中,可以通过注释行调用的命令或指针。 SSI功能非常强大(这个是别人说的)。在我看来,它的作用也就是实现静态网页的局部动态更新。但就是这一点,帮了我们很大的忙。尤其是在多个静态网页包含了同样的内容的时候。如果这一部分内容需要更新,在不使用SSI包含功能的时候,就需要把所有的静态网页更新一遍。这是一个非常繁琐又容易出错的工作。这个时候SSI就派上用场了。把静态页中需要更新的部分单独拿出来,写入html文件中,然后将这个文件使用<!--include virtual=""-->形式包含到所有的静态文件,一般是.shtml文件。这样,只要更新这个html文件的内容,所有.shtml文件的内容就跟着变化了。可谓是一劳永逸。 在Apache中配置SSI 1、开启mime_module, 即找到 #LoadModule mime_module modules/mod_mime.so ,去掉前面的#号。如果已经去掉了,忽略这条。 2、添加类型,在mime_module内部添加所有可能包含的类型 <IfModule mime_module> AddType text/html .shtml .html .htm .tpl .ssi AddOutputFilter

Use web.config to allow server-side includes in HTML files (IIS)

不想你离开。 提交于 2019-11-30 20:24:35
In IIS 7.5, is it possible to use web.config alone to enable SSI processing for files that have the .html extension? Specifically, I don't want to use the default SSI extension, .shtml . Reason: I don't want to change the extensions. Doing so would lead to broken links in search engine results. Also, my motivation for doing this in web.config is because this is a shared server . Presuming that your hoster has enabled SSI's and delegated Read/Write permissions for handler mappings then this should work: <configuration> <system.webServer> <handlers> <add name="SSINC-html" path="*.html" verb="*"

Get URL and parameters with SSI

[亡魂溺海] 提交于 2019-11-30 13:23:39
I have to get URL and parameters with SSI (only with SSI), but I can't find any solution. For example: http://www.test.com/abc.html?data=something And I have to get value of parameter "data". <!-- set default value for SSI variable "data" --> <!--#set var="data" value="" --> <!-- get "data" value from URL --> <!--#if expr="$QUERY_STRING = /data=([a-zA-Z0-9]+)/" --> <!--#set var="data" value="$1" --> <!--#endif --> <!-- print the "data" value --> <!--#echo var="data" --> old question I know, but I just came across it while doing some SSI stuff myself. I'm sure you've fixed your problem by now,

搭建公司私有MAVEN仓库过程

ぐ巨炮叔叔 提交于 2019-11-30 07:04:57
一、下载maven https://maven.apache.org/download.cgi 二、下载nexus 百度网盘地址: https://pan.baidu.com/s/1hr4yG0c 或者:https://sonatype-download.global.ssl.fastly.net/nexus/3/nexus-3.9.0-01-unix.tar.gz 三、安装maven 1.1 将文件解压到D:\apache-maven-3.5.4目录下: 1.2 新建环境变量MAVEN_HOME,赋值D:\apache-maven-3.5.4: 1.3 编辑环境变量Path,追加%MAVEN_HOME%\bin\; 1.4 至此,maven已经完成了安装,我们可以通过DOS命令检查一下我们是否安装成功: 1.5 设置maven环境变量,避免maven内存溢出,MAVEN_OPTS: -Xms128m -Xms512m。 1.6 设置全局settings.xml中的本地仓库地址: D:\Maven\.m2\repository,并执行mvn help:system,生成.m2目录。恢复全局settings.xml中的设置,即全部默认,然后拷贝一份到.m2文件夹下面,来设置用户变量settings.xml。这一步主要是生成一个.m2文件夹,将来用于存放settings.xml,生成

PHP security exploit - list content of remote PHP file?

别来无恙 提交于 2019-11-29 21:08:44
I'm trying to exploit some web vulnerabilities in a sample website running inside a VM (it is not available on the web - only for educational purposes). I have a php file named setupreset.php which has the information about MySQL configs, setup and passwords used to setup the website. This is in the same directory as the rest of the php files (index, products, forum, etc...). This is the code of index.php, for reference: <?php include ("includes/header.php"); // Grab inputs $page = $_GET[page]; if ($page=="") { include("home.html"); } else { include ($page . '.php'); } include ("includes

Get URL and parameters with SSI

﹥>﹥吖頭↗ 提交于 2019-11-29 19:05:34
问题 I have to get URL and parameters with SSI (only with SSI), but I can't find any solution. For example: http://www.test.com/abc.html?data=something And I have to get value of parameter "data". 回答1: <!-- set default value for SSI variable "data" --> <!--#set var="data" value="" --> <!-- get "data" value from URL --> <!--#if expr="$QUERY_STRING = /data=([a-zA-Z0-9]+)/" --> <!--#set var="data" value="$1" --> <!--#endif --> <!-- print the "data" value --> <!--#echo var="data" --> 回答2: old question

Why SSI condition != || != doesn't work?

让人想犯罪 __ 提交于 2019-11-29 16:30:40
I can't get working this conditional expression <!--#if expr="$DOCUMENT_NAME!=index.html || $DOCUMENT_NAME!=links.html" --> while this one without ! before = works perfect <!--#if expr="$DOCUMENT_NAME=index.html || $DOCUMENT_NAME=links.html" --> What's the problem? I get no error simply != doesn't work though || with other condition but works for single condition. This is because = and != are hardly the same operator. Note that, by De Morgan's law (which I also explained in this old post ), a != b || c != d is equivalent to a = b && c = d which is never true for x = a && x = b where a != b .

Is it possible to perform Includes with flask?

亡梦爱人 提交于 2019-11-29 09:03:39
Say I have a template layout saved in template.html. This template includes a banner, side navigation, content container, and footer. Can I use flask to break up these page elements in such a way that I can have files such as banner.html, sidenavigation.html, etc. and render these different files within template.html? From: http://jinja.pocoo.org/docs/templates/#include template.html {% include 'banner.html' %} {% include 'sidenavigation.html' %} {% include 'content.html' %} {% include 'footer.html' %} plaes By default, Flask uses Jinja2 as its template engine. See Jinja's Template Designer