SSI ((Server Side Includes) and web server Qnap

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.
Post Reply
drons
Starting out
Posts: 10
Joined: Sat Sep 02, 2017 12:53 am

SSI ((Server Side Includes) and web server Qnap

Post by drons »

Hi
I'm transferring my site to Qnap from another NAS (Synology), and it needs the support of SSI. But SSI does not work in web server Qnap. Please help me if you know the solution.
Regards
User avatar
dolbyman
Guru
Posts: 35273
Joined: Sat Feb 12, 2011 2:11 am
Location: Vancouver BC , Canada

Re: SSI ((Server Side Includes) and web server Qnap

Post by dolbyman »

run a vm or container with full web package
drons
Starting out
Posts: 10
Joined: Sat Sep 02, 2017 12:53 am

Re: SSI ((Server Side Includes) and web server Qnap

Post by drons »

I already thought about container, but unfortunately my knowledge is not enough yet, to configure this service. Where can I read about setting up a web server in a container?
drons
Starting out
Posts: 10
Joined: Sat Sep 02, 2017 12:53 am

Re: SSI ((Server Side Includes) and web server Qnap

Post by drons »

The problem with SSI (Server Side Includes) in QTS 4.3.3 is that the apache server does not load the standard module mod_include.so
If you added the module yourself to /mnt/HDA_ROOT/.config/apache/extra/apache-default-modules.conf, this worked only until the web server or NAS was rebooted.
My son helped me to add the necessary module using autorun.sh. He wrote an excellent instruction for me. But I think it can be useful to someone else.

1. Create a directory and script to test and add the desired module to the config
1.1

Code: Select all

mkdir /share/<path_to_some_persistent_directory> 
where instead of <path_to_some_persistent_directory> you use the path that you chose yourself

1.2

Code: Select all

vim /share/<path_to_some_persistent_directory>/add_ssi_module.sh

Code: Select all

===========================================================
#!/bin/bash

if [ -z $(grep -o mod_include.so /etc/default_config/apache-default-modules.conf)]
        then echo "LoadModule include_module modules/mod_include.so" >> /etc/default_config/apache-default-modules.conf
        /etc/init.d/Qthttpd.sh restart
                else
        exit 1
fi
===========================================================
1.3

Code: Select all

chmod +x /share/<path_to_some_persistent_directory>/add_ssi_module.sh
2. Editing an autorun file
2.1

Code: Select all

mount $(/sbin/hal_app --get_boot_pd port_id=0)6 /tmp/config
2.2

Code: Select all

vim /tmp/config/autorun.sh

Code: Select all

===========================================================
#!/bin/sh

/bin/bash /share/<path_to_some_persistent_directory>/add_ssi_module.sh
===========================================================
2.3

Code: Select all

chmod +x /tmp/config/autorun.sh
itteam
Know my way around
Posts: 101
Joined: Thu Jul 25, 2013 1:25 am

Re: SSI ((Server Side Includes) and web server Qnap

Post by itteam »

THANK YOU for sharing this :)
[ TS-873U-RP @HQ ][ TS-220 + TS-221 +TS-419 U II @Satellite branches ] [ TS-212P + HS453-DX @Home ]
Post Reply

Return to “Web Server & Applications (Apache + PHP + MySQL / SQLite)”