Questions tagged [server-side-includes]
Server Side Includes (SSI) is a simple interpreted server-side scripting language used almost exclusively for the Web. The most frequent use of SSI is to include the contents of one or more files into a web page on a web server.
51
questions
0
votes
0
answers
133
views
nginx not running ssi commands in .shtml file
I can't figure out why SSI is refusing to run. I'm on nginx 1.25.2, on Ubuntu 22.04
server {
listen x.x.x.x:443 ssl;
listen [::]:443 SSL;
# other lines
include /home/...
0
votes
1
answer
101
views
Get file exif data in NGINX
In the following code I'm setting some variables with info about the image (like the title, URL, etc.)
location /photo {
ssi on;
ssi_last_modified on;
set $photosrc /photos/$...
0
votes
1
answer
444
views
Showing images using a template .html file in NGINX
I'm using nginx to run my website's server. I'm currently using SSI (Server Side Includes) to have a common across the HTML files on my website which is working fine right now. So now I want to have ...
1
vote
1
answer
519
views
NGINX SSI working fine, but LAST_MODIFIED returning "(none)"?
I have NGINX SSI working fine in the virtualHosts file (code below) but LAST_MODIFIED is returning "(none)", although the NGINX docs for SSI state that the ssi_last_modified directive ...
0
votes
0
answers
333
views
Transfer Compression with Cloudfront and nginx SSI
Is there any way to enable GZIP / Brotli compression on Cloudfront if the origin is a nginx server with SSI (Server Side Includes) enabled?
The issue seems that nginx SSI drops the Content-Length ...
0
votes
1
answer
110
views
Best way to secure world-writable .shtml files written to by Perl?
The Perl script
I have a Perl script running on an old Debian 6 server (until I move to a new server) that opens an editable pane in an .shtml file, accepts only Creole markup input from a single ...
2
votes
1
answer
2k
views
nginx SSI: how to echo html?
As a sanity test, at the head of my HTML page, I'm trying to do a very simple SSI echo to indicate to the browser that SSI is working:
index.html:
<script>var ssi_enabled = false</script>...
3
votes
2
answers
3k
views
Passing Nginx custom header or variables to SSI
I'm building web app using SSI to reduce server usage as much as possible (since it small VPS), one of the issue I face is serving different contents/style to mobile users I use custom detect-mobile....
0
votes
0
answers
661
views
nginx gzip not working for ssi
I tried setting up gzip compression for server side included files in nginx.
I have enabled gzip compression in nginx.conf
This is the configuration that I have used:
gzip on;
gzip_vary on;
...
-1
votes
1
answer
719
views
Nginx Server Side Includes and url rewrite
I'm trying to do something that looks very difficult for me.
I need to embed a live blog remote HTML url inside my rails app and I don't want to use iframes for SEO.
I'm trying to use SSI.
I ...
1
vote
1
answer
2k
views
How to enable SSI in Ubuntu 16.04?
I have an html page with SSI and I was trying for enabling SSI in my apache (V 2.4.18) running on Ubuntu 16.04. As per the guidelines here, I tried editing /etc/apache2/apache2.conf file and now ...
2
votes
2
answers
2k
views
getting SSI's `exec` to work with apache
so i have an apache-2.4.25 (as packaged in Debian/stretch), and would like to use SSI's exec method.
<!--#exec cmd="ls" -->
Unfortunately this gives me an error:
[an error occurred while ...
0
votes
1
answer
2k
views
ssi on nginx, using variables and conditionals
I'm using nginx to server up my static pages. To make the menu dynamically change the class="active" on the respective page, I'm trying to use SSI variables. So I have this on the page itself:
<!--...
0
votes
0
answers
639
views
nginx SSI include, coming up as corrupts code?
I'm trying to get some SSI calls setup on a .html page with nginx. The following works fine:
<center><!--# include file="total.txt" -->
<br /><br /><a ...
5
votes
1
answer
730
views
Environment variables not available on server after mod_rewrite, but works locally
I am working on a site where I am using SSI to set a variable on an HTML page that gets parsed and the variable is then to be picked up by a script after a mod_rewrite rewrite. This works on my local ...
0
votes
2
answers
290
views
Enable Server Side Include for Apache on Extensionless URI?
Does anyone know how to enable SSI for URIs such as http//domain.com/page ?
(It is straightforward to enable SSI for URIs that have extensions, such as http//domain.com/page.html or http//domain.com/...
1
vote
2
answers
4k
views
DBD: Can't load driver file apr_dbd_mysql.so
I am using Apache 2 on a virtual machine running a LAMP stack (mysql version 5.6). When I try to restart the server I am getting this error;
DBD: Can't load driver file apr_dbd_mysql.so
I have made ...
0
votes
1
answer
450
views
Can I use the Nginx PageSpeed module together with SSI?
Is it possible to use the Nginx PageSpeed module together with SSI?
I can't get SSI up and running when PageSpeed is enabled.
But as soon as I disable PageSpeed, SSI works again:
location ~ .+\....
0
votes
2
answers
77
views
If a web root directory has a simlink that points to a folder one-level up, does that pose a security risk?
Assuming a Linux/Unix system. Not asking about any particular server software, just wondering in general. I want to use this to include javascript libraries or things like that in multiple sites or ...
0
votes
1
answer
2k
views
Apache 2.4 SSI on Ubuntu 13.04
I have an Ubuntu 13.04 server that had normal, stock Apache 2.2 with SSI working. I got a bug in my ear, and installed the ppa:rhardy/apache24x PPA to get my server upgraded Apache 2.4.
While it ...
1
vote
0
answers
1k
views
PHP SSI with NGINX
I've got a really old website I'd like try running on NGINX instead of Apache. This site consists of many flat HTML files with sporadic PHP SSIs, such as:
<!--#include virtual="/some_file.php" --&...
0
votes
1
answer
512
views
Automatically prepend executable Perl scripts using .htaccess (like php_value auto_prepend_file)?
I have previously built sites using PHP, where I automatically included header and footer html using the following lines in .htaccess on an Apache host:
php_value auto_prepend_file "/var/www/html/...
1
vote
1
answer
2k
views
Nginx ssi with proxy_cache hanging after first request
I am using Nginx's proxy cache for our dynamic pages and have recently integrated ssi. The first page load works fine but once the page is cached and another request comes through the page just hangs.
...
2
votes
1
answer
4k
views
NGINX SSI Not working
I'm having trouble getting SSI to work on NGINX. You can see the problem if you hit http://www.bakerycamp.com/test.shtml. Here is the contents of that file:
<!--# echo hi -->
If you hit this ...
1
vote
1
answer
539
views
IIS 6.1 Handlers for HTML, ASP, INC files
I have a legacy website in which .HTML, .ASP, and .INC files are being used. Problem is all pages have VBScript code not parsed by IIS and thus written on page as static text. I want to fix it. All ....
12
votes
1
answer
10k
views
SSI includes not working on Debian with Apache
I'm trying to get SSI to work on Debian running Apache, however the .shtml files are not being parsed. From a PHP file with phpinfo() I can see that the following show up in the loaded modules section:...
1
vote
1
answer
761
views
eAccelerator Causes PHP Include to Fail in Wordpress
SERVER: Linux CENTOS 6
PLESK 10.4.4
I have been installing Wordpress on many subdomains on our dedicated server. All of them run CRON jobs every 10 minutes.
Long story short, the time to load first ...
2
votes
1
answer
3k
views
How to include PHP file from a Virtual Directory on IIS?
I would like to know if there is a way to include PHP files from Virtual Directory to a PHP file in site's root.
For example I have siteroot:
siteroot\index.php
siteroot\other.php
and a separate ...
3
votes
2
answers
3k
views
Apache: Include Virtual SSI not working for CGI script
I have the following Server Side Includes within an .html file called test.html...
<!--#include virtual="/cgi-bin/myScript.cgi"-->
<!--#include virtual="/includes/myFile.html"-->
When I ...
3
votes
2
answers
3k
views
How can I get Apache2 to serve up .shtml files as Content-Type "text/html" and not "text.html"?
I'm working on a website, implemented as shtml, and when I try to load the home page (http://simplyclassicremodeling.com) from IE8, it says it can't open the file because it transferred as Content-...
2
votes
1
answer
1k
views
Unable to SSI include some CGI scripts
I have a page site.shtml on an Apache server in which I am trying to include a few CGI scripts, like so:
<p><pre><!--#include virtual="files/testfile" --></pre></p>
...
2
votes
2
answers
2k
views
nginx proxy caching and ssi
I am using nginx for caching requests from the upstream apache server, however I want few blocks inside to be fetched from apache all the time. I am hoping ssi can do this, but the SSI tags are ...
2
votes
1
answer
2k
views
Why does my SetEnvIfNoCase directive does not match requested URI?
I'm attempting to set up Apache such that various error pages display with headers/footers appropriate to the context of the error. If the user was requesting a corporate page, I want to show the ...
4
votes
2
answers
3k
views
Apache web server intermittently serves 403: "Directory index forbidden by Options directive" and 304
We have configured a web site with SSI for .html files on Apache/2.2.19 on CentOS 5.5 Linux. Works OK, but occasionally get 403 for the root page (index.html served as a directory index). No file ...
5
votes
3
answers
4k
views
How do I conditionally handle undefined SSI variables using Apache?
I want to include a header in a bunch of pages, like so:
header.html:
<html>
<head>
<title>My site</title>
</head>
To enable a page-specific title, I'm trying ...
0
votes
1
answer
186
views
Adding SSI support causes mod_dir "trailing slash" redirect to stop working
I have enabled SSI using the following directives in .htaccess
AddHandler server-parsed .html
AddOutputFilter INCLUDES html
However when I add these, the trailing slash redirects stop working.
For ...
1
vote
2
answers
2k
views
in an SSI include, can the file being included be redirected in an .htaccess file
I have some old html pages that have SSI includes in them to include certain html in all the pages.
So, the SSI looks something like this:
<!--#include virtual="/includes/noNav/footercode.html"--&...
0
votes
1
answer
121
views
php relative path not found
I'm migrating to a new server.
Before I could use: include/XXXX.php in /var/site/test.php.
Now I have use: /var/site/include/XXXX.php
I'm using:
Ubuntu 10.4
Apache2
PHP5
0
votes
1
answer
1k
views
PostgreSQL 9.0 HA load balancing between servers
Hey folks, I'm bashing my head to configure load balancing stuff between two database servers. I have no clue whether, I can find any mechanism to implement this. I already tried to implement Heart ...
2
votes
1
answer
155
views
Limit SSI capabilities to only include files
Is there a way to enable SSI on a server (running apache), but only allow the include element (<!--#include -->) and not any other?
3
votes
1
answer
2k
views
Is it ok to map the SSI handler to .html files in IIS?
I have a site built with static html files and I need to add a segment of markup to every page. The natural choice to accomplish this is to use server-side includes (SSI).
The SSI handler does not ...
4
votes
3
answers
8k
views
Why won't SSI work in IIS?
I can't get IIS to respect my SSI directives - it just outputs the #include directive as if it were regular old html.
Here's the relevant data points:
My file with the include directive is called ...
1
vote
2
answers
1k
views
SymLinks vs. PHP Includes (performance)
Which of these 2 is easier/faster for a Linux server running Apache to process?
A) A symlink pointing to a php file:
file-sym.php ---> file-orig.php
B) A PHP file (file-inc.php) including ...
2
votes
2
answers
7k
views
How to enable SSI for all html files?
I use MAMP to develop sites. I have each site in it's own folder in the htdocs folder. I manage one site that I need to use ssi directives on, because the host doesn't allow php includes.
I've un-...
0
votes
3
answers
108
views
Server impact of common shared files across hundreds of sites
I am working for a client running a HostGator Dedicated Server with hundreds of sites on it. Since there will be some common files between them I am contemplating doing the following:
creating a ...
2
votes
2
answers
2k
views
How can I enable SSI on HTML pages on GoDaddy (Windows hosting)?
I wish to enable SSI's (server-side includes) on my HTML pages on GoDaddy.
I want lines like this to be processed properly:
<!--#include virtual="/include/header.html"-->
Is this possible and ...
0
votes
2
answers
865
views
Apache SHTML including a PHP file
Following this question
HTAccess Directory Index with PHP-Files
I was able to create my index using a PHP file included in a SHTML file as follows
<!--#include virtual="/header.php" -->
This ...
2
votes
1
answer
936
views
HTAccess Directory Index with PHP-Files
I'm currently trying to fancy up my directory index a little - To do so, I already managed to create a decent layout around the created table - But now, I need to add some scripting, too.
As I'm most ...
5
votes
4
answers
13k
views
How do you enable SSI's in Apache?
I've found information on the web, but it just doesn't make sense to me. I'd like to know exactly what files I should go into, and precisely where and how I should modify them.
0
votes
3
answers
643
views
php include file
I have a common framework that resides in /var/www/fw/trunk path, and also have a virtual host that resides in /var/www/vhosts/aerosoftware.net/httpdocs/ on a http://aerosoftware.net/ domain.
I ...