You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jens Kallup <ka...@web.de> on 2019/01/26 00:08:17 UTC

substitute not working

Hello,

I came not on done after much wasting time.
I would use SSI, but it did not work.
The directives in the config will not parsed.
Neither php, shtml, or else.

# here a snippet of my apache2.conf

User  www-data
Group www-data

LoadModule auth_basic_module       mod/mod_auth_basic.so
LoadModule authn_file_module       mod/mod_authn_file.so
LoadModule authz_core_module       mod/mod_authz_core.so
LoadModule authz_host_module       mod/mod_authz_host.so
LoadModule authz_user_module       mod/mod_authz_user.so
LoadModule authz_groupfile_module  mod/mod_authz_groupfile.so
LoadModule include_module          mod/mod_include.so
LoadModule alias_module            mod/mod_alias.so
LoadModule mime_module             mod/mod_mime.so
LoadModule mime_magic_module       mod/mod_mime_magic.so
LoadModule negotiation_module      mod/mod_negotiation.so
LoadModule filter_module /usr/lib/apache2/modules/mod_filter.so
LoadModule dir_module              mod/mod_dir.so
LoadModule substitute_module       mod/mod_substitute.so
LoadModule env_module              mod/mod_env.so
LoadModule autoindex_module        mod/mod_autoindex.so
LoadModule cache_module            mod/mod_cache.so
LoadModule proxy_module            mod/mod_proxy.so
LoadModule proxy_http_module       mod/mod_proxy_http.so
LoadModule headers_module          mod/mod_headers.so
LoadModule deflate_module          mod/mod_deflate.so
LoadModule reqtimeout_module       mod/mod_reqtimeout.so
LoadModule rewrite_module          mod/mod_rewrite.so
LoadModule status_module           mod/mod_status.so
LoadModule ext_filter_module       mod/mod_ext_filter.so
LoadModule sed_module              mod/mod_sed.so
#
LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
LoadModule mpm_prefork_module /usr/lib/apache2/modules/mod_mpm_prefork.so



# and here my default vhost:
#ExtFilterDefine c-to-html mode=output \
#    intype=text/c outtype=text/html \
#    cmd="/http/cmd/enscript.pl"

<VirtualHost *:80>
     ServerAdmin kallup.jens@web.de
     ServerName localhost
#    ServerAlias www.kallup.solutions

     DocumentRoot "/html/public/"

     AddLanguage de .de
     AddLanguage en .en

     LanguagePriority  de en
     AddDefaultCharset UTF-8

     FilterProvider SSI INCLUDES "%{HANDLER} = 'server-parsed'"
     FilterChain    SSI

     FilterDeclare  gzip CONTENT_SET
     FilterProvider gzip inflate "%{req:Accept-Encoding} !~ /gzip/"
     FilterChain    gzip

#    FilterDeclare  filter_kallup
#    FilterProvider filter_kallup SUBSTITUTE resp=Content-Type text/html
#    FilterProvider filter_kallup INCLUDES   resp=Content-Type text/html
#    FilterChain    filter_kallup SUBSTITUTE 's|</body>|<!--#include 
virtual="/inc/footer.html" -->|ni'

#    Alias /inc/footer.html /inc/footer.php

     AddType text/html      shtml
     AddHandler server-parsed .shtml
     AddOutputFilter INCLUDES .shtml

     AddOutputFilterByType SUBSTITUTE text/html
     Substitute "s|<body*>|<body><div class='siteheader'>Eine 
Werbung<hr></div>|i"
     Substitute "s|</body>|<div id='sitefooter'><hr><?php if ((include 
$_SERVER['DOCUMENT_ROOT'].'/inc/footer.html') == FALSE) { echo 'ERROR, 
can't display page !!!'; die;} ?></div>|i"

# here, the line above (php) will not handled as php, response is 
raw/plain text
# the same for <!--#include file ...

     Alias /img /www/html/public/img/
     <Directory /www/html/public/img/>
         Options Indexes FollowSymLinks MultiViews
         AllowOverride None
         Require all granted
     </Directory>
     <Directory /js/>
         Options Indexes FollowSymLinks MultiViews
         DirectoryIndex index.html index.php
         AllowOverride None
         Require all granted
     </Directory>
     <Directory /css/>
         Options Indexes FollowSymLinks MultiViews
         AllowOverride None
         Require all granted
     </Directory>

     <Directory />
         Options +Includes +FollowSymLinks +MultiViews
         DirectoryIndex index.html index.php
         AllowOverride None
         Require all granted

     AddOutputFilterByType DEFLATE text/plain
     AddOutputFilterByType DEFLATE text/html
     AddOutputFilterByType DEFLATE text/xml
     AddOutputFilterByType DEFLATE text/css
     AddOutputFilterByType DEFLATE application/xml
     AddOutputFilterByType DEFLATE application/xhtml+xml
     AddOutputFilterByType DEFLATE application/rss+xml
     AddOutputFilterByType DEFLATE application/javascript
     AddOutputFilterByType DEFLATE application/x-javascript
         AddOutputFilterByType DEFLATE application/x-httpd-php .phz

         AddEncoding gzip phz
         AddHandler  application/x-httpd-php .phz
         AddType     application/x-httpd-php .phz
         <FilesMatch "\.phz$">
                 ForceType text/html
                 Header set Content-Encoding: gzip
     </FilesMatch>

     Header append Vary User-Agent env=!dont-vary



#    SetOutputFilter c-to-html
#    AddType text/c .c

     </Directory>

     TransferLog  /http/www/access.log
     ErrorLog     /http/www/error.log
     CustomLog    /http/www/access.log combined

     LogLevel warn

</VirtualHost>


can you send a working vhost file?
tia

Jens