SanCi

WebStation misc
虚拟主机配置文件/usr/local/etc/apache24/site-enabled/httpd-vhost....
扫描右侧二维码阅读全文
11
2018/10

WebStation misc

虚拟主机配置文件
/usr/local/etc/apache24/site-enabled/httpd-vhost.conf

@appstore/WebStation/misc/VirtualHost-apache24.mustache

VirtualHost-apache24.mustache

{{> /var/packages/WebStation/target/misc/apache_web_error_page}}

{{#hosts}}
{{#apache24}}
<VirtualHost{{#port.http}} *:{{.}}{{/port.http}}{{#port.https}} *:{{.}}{{/port.https}}>{{#fqdn}}
    ServerName {{fqdn}}
    SetEnv HOST {{fqdn}}{{/fqdn}}
    DocumentRoot "{{root}}"
    <IfModule dir_module>
        DirectoryIndex {{#index}} {{.}}{{/index}}
    </IfModule>
    <Directory "{{root}}">
        Options MultiViews FollowSymLinks ExecCGI
        AllowOverride All
        <IfModule authz_core_module>
            Require all granted
        </IfModule>
    </Directory>

    <FilesMatch "\.(php[345]?|phtml)$">
        {{#php_handler}}SetHandler "proxy:unix:/run/php-fpm/{{php_handler}}.sock|fcgi://localhost"{{/php_handler}}
        {{^php_handler}}Redirect 500{{/php_handler}}
    </FilesMatch>
</VirtualHost>
{{/apache24}}
{{/hosts}}

VirtualHost-apache22.mustache

{{> /var/packages/WebStation/target/misc/apache_web_error_page}}

{{#port_info.apache22}}
NameVirtualHost *:{{.}}{{/port_info.apache22}}

{{#fcgi_handlers}}
    <IfModule fastcgi_module>
        FastCgiExternalServer /vhost-{{.}} -socket /run/php-fpm/{{.}}.sock -idle-timeout 3600
        ScriptAlias /vhost-{{.}}.fcgi /vhost-{{.}}
    </IfModule>
{{/fcgi_handlers}}

{{#hosts}}
{{#apache22}}

<VirtualHost{{#port.http}} *:{{.}}{{/port.http}}{{#port.https}} *:{{.}}{{/port.https}}>{{#fqdn}}
    ServerName {{fqdn}}
    SetEnv HOST {{fqdn}}{{/fqdn}}
    DocumentRoot "{{root}}"
    <IfModule dir_module>
        DirectoryIndex {{#index}} {{.}}{{/index}}
    </IfModule>
    <Directory "{{root}}">
        Options MultiViews FollowSymLinks ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
{{#php}}
    <IfModule fastcgi_module>
        AddHandler default-handler .htm .html .shtml
        AddHandler php-fastcgi .php .php3 .php4 .php5 .phtml
        AddType text/html .php .php3 .php4 .php5 .phtml
        Action php-fastcgi /vhost-{{php_handler}}.fcgi
    </IfModule>
{{/php}}

</VirtualHost>
{{/apache22}}
{{/hosts}}

该部分仅登录用户可见

http://httpd.apache.org/docs/2.4/mod/core.html#virtualhost
http://httpd.apache.org/docs/2.2/mod/core.html#virtualhost


随机一言(显示内容与本文关)
Last modification:October 11th, 2018 at 04:37 am
If you think my article is useful to you, please feel free to appreciate

Leave a Comment