DSM 7.2 virtual host (still) doesnt execute php code

Currently reading
DSM 7.2 virtual host (still) doesnt execute php code

Last edited:
Last edited:
You might want to check if the DirectoryIndex directives include the right index.php or whatever extensions you are using. I added index.cgi to mine.

I think there was another apache24 template file that related to the main site. So you could check it too.
 
Last edited:
Sorry for late reply: this is part of thetemplate file in /var/packages/WebStation/target/misc and in /volume1/@appstore/WebStation/misc/apache24_service_template.mustache.
It doesnt work

Apache config:
<VirtualHost{{#http_port}} *:{{.}}{{/http_port}}{{#https_port}} *:{{.}}{{/https_port}}>{{#fqdn}}
    ServerName {{fqdn}}
    SetEnv HOST {{fqdn}}{{/fqdn}}
    DocumentRoot "{{root}}"


    LogLevel info
    ErrorLogFormat "{{id}};%t;%a;%l;\"%M\""
    ErrorLog "/var/packages/WebStation/var/log/apache24_error_log"


    {{> @apache_rule@ }}


    Include conf-enabled/.webstation.error_page.default.conf


    {{#fastcgi.sock}}
    <Proxy "unix:{{fastcgi.sock}}|fcgi://{{id}}">
        ProxySet timeout={{read_timeout}}
    </Proxy>
    {{/fastcgi.sock}}


    <Directory "{{root}}">
        DirectoryIndex index.php
        Options MultiViews FollowSymLinks ExecCGI
        AllowOverride All
        <IfModule authz_core_module>
            Require all granted
        </IfModule>


        <IfModule dir_module>
            DirectoryIndex {{#index}} {{.}}{{/index}}
        </IfModule>


        {{#fastcgi}}
        <FilesMatch "\.(php[345]?|phtml)$">
            {{#managed_by_docker}}
            ProxyFCGISetEnvIf "true" SCRIPT_FILENAME "{{#chroot}}{{.}}{{/chroot}}%{reqenv:SCRIPT_NAME}"
            {{/managed_by_docker}}
            {{#fastcgi.sock}}
            SetHandler "proxy:fcgi://{{id}}"
            {{/fastcgi.sock}}
            {{#fastcgi.url}}
            SetHandler "proxy:fcgi://{{.}}"
            {{/fastcgi.url}}
        </FilesMatch>{{/fastcgi}}


    </Directory>
   
    {{#uwsgi}}
    <IfModule proxy_uwsgi_module>
        ProxyPass / "unix:{{uwsgi.sock}}|uwsgi://{{uwsgi.id}}/"
    </IfModule>
    {{/uwsgi}}
</VirtualHost>


{{#mdns}}
<VirtualHost{{#http_port}} *:{{.}}{{/http_port}}{{#https_port}} *:{{.}}{{/https_port}}>{{#fqdn}}
    ServerName {{fqdn}}.local
    SetEnv HOST {{fqdn}}.local{{/fqdn}}
    DocumentRoot "{{root}}"


    LogLevel info
    ErrorLogFormat "{{id}};%t;%a;%l;\"%M\""
    ErrorLog "/var/packages/WebStation/var/log/apache24_error_log"


    {{> @apache_rule@ }}


    Include conf-enabled/.webstation.error_page.default.conf


    {{#fastcgi.sock}}
    <Proxy "unix:{{fastcgi.sock}}|fcgi://{{id}}">
        ProxySet timeout={{read_timeout}}
    </Proxy>
    {{/fastcgi.sock}}


    <Directory "{{root}}">
        DirectoryIndex index.php
        Options MultiViews FollowSymLinks ExecCGI
        AllowOverride All
        <IfModule authz_core_module>
            Require all granted
        </IfModule>


        <IfModule dir_module>
            DirectoryIndex {{#index}} {{.}}{{/index}}
        </IfModule>
 
It's a bit hit and miss, what I did was to review the site configuration files that were created in /usr/local/etc/apache24/sites-available: compare them to the template files in /var/packages/WebStation/target/misc, see if I could find which template had been used. Then I modified the templates, and stopped/started WebStation to force the recreation of the sites files. If you can't find the right configuration file then try above in /usr/local/etc/apache24/ to find other files.

In the DirectoryIndex directive I would either append various index.php/cgi/php5 etc. to see if that fixed it. Or I think you can add a second directive with them.

There is also the option to try using .htaccess files placed in the top-level folder of the virtual hosts.

I've only hacked these to enable Perl CGI, never needed to use PHP.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

  • Question
I am new to Synology Web Station. I have a static IP address. I have 4 domains. I have the router port...
Replies
0
Views
563
This wasn't mentioned as fixed in the release notes of WebStation 4.2.1-0492, and it wasn't. Reapplied the...
Replies
3
Views
5,649
Hi Shanti, I found the same issue, I tried to install my wordpress on Apache2.4 or Nginx, but I have the...
Replies
2
Views
6,834
D
So I take it you are manually connecting to port 5000/5001 in your browser right? Ever since I installed...
Replies
5
Views
12,597
For some reason best known to Synology, in the newest version of Web Station in DSM 7.2 they decided to...
Replies
1
Views
405
Hello Imcon, that is great that you found a solution. Could teach me how to create multiple databases...
Replies
4
Views
5,802

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending threads

Back
Top