提交 60aa7ecc 编写于 作者: S sanluan

增加apache服务配置模板

上级 7d4cacb1
......@@ -376,6 +376,7 @@ page.site.default_dept=Technical Department
page.sql.example.1=Replace the attachment URL in the body of the article
page.server_config=Third-party WEB server configuration
page.server_config.nginx=Nginx configuration
page.server_config.apache=Apache configuration
page.server_config.site=Site configuration
page.server_config.static=Static site configuration
page.server_config.nginx_description=The following Nginx configuration is dynamically generated based on your site's current configuration information and the bound domain name
......
......@@ -376,6 +376,7 @@ page.site.default_dept=\u6280\u8853\u90E8\u9580
page.sql.example.1=\u672C\u6587\u306B\u3042\u308B\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB\u306EURL\u3092\u7F6E\u304D\u63DB\u3048\u308B
page.server_config=\u30B5\u30FC\u30C9\u30D1\u30FC\u30C6\u30A3\u306EWEB\u30B5\u30FC\u30D3\u30B9\u30B3\u30F3\u30D5\u30A3\u30B0
page.server_config.nginx=Nginx\u30B3\u30F3\u30D5\u30A3\u30B0
page.server_config.apache=Apache\u30B3\u30F3\u30D5\u30A3\u30B0
page.server_config.site=\u30B5\u30A4\u30C8\u30B3\u30F3\u30D5\u30A3\u30B0
page.server_config.static=\u30B9\u30BF\u30C6\u30A3\u30C3\u30AF\u30B5\u30A4\u30C8\u30B3\u30F3\u30D5\u30A3\u30B0
page.server_config.nginx_description=\u4EE5\u4E0B\u306ENginx\u30B3\u30F3\u30D5\u30A3\u30B0\u306F\u30B5\u30A4\u30C8\u306E\u73FE\u5728\u306E\u30B3\u30F3\u30D5\u30A3\u30B0\u60C5\u5831\u53CA\u3073\u30D0\u30A4\u30F3\u30C9\u3055\u308C\u305F\u30C9\u30E1\u30A4\u30F3\u540D\u306B\u3088\u3063\u3066\u30C0\u30A4\u30CA\u30DF\u30C3\u30AF\u306B\u751F\u6210\u3055\u308C\u307E\u3059
......
......@@ -378,6 +378,7 @@ page.sql.description=\u4EC5\u80FD\u6267\u884C\u5355\u6761SQL
page.sql.example.1=\u66FF\u6362\u6587\u7AE0\u6B63\u6587\u4E2D\u7684\u9644\u4EF6\u7F51\u5740
page.server_config=\u7B2C\u4E09\u65B9WEB\u670D\u52A1\u914D\u7F6E
page.server_config.nginx=Nginx\u914D\u7F6E
page.server_config.apache=Apache\u914D\u7F6E
page.server_config.site=\u7AD9\u70B9\u914D\u7F6E
page.server_config.static=\u9759\u6001\u7AD9\u70B9\u914D\u7F6E
page.server_config.nginx_description=\u4EE5\u4E0BNginx\u914D\u7F6E\u6839\u636E\u60A8\u7684\u7AD9\u70B9\u5F53\u524D\u914D\u7F6E\u4FE1\u606F\u53CA\u7ED1\u5B9A\u7684\u57DF\u540D\u52A8\u6001\u751F\u6210
......
<@_sysSite id=siteId><#assign a=object/></@_sysSite>
<@_disk>
<#assign
realRootPath=rootPath?replace('\\','/')
dynamicPath=a.dynamicPath?keep_after('//')?keep_before('/')?keep_before(':')
dynamicLocation=a.dynamicPath?keep_after('//')?keep_after('/')
dynamicPort=a.dynamicPath?keep_after('//')?keep_before('/')?keep_after(':')
sitePath=a.sitePath?keep_after('//')?keep_before('/')?keep_before(':')
siteLocation=a.sitePath?keep_after('//')?keep_after('/')
sitePort=a.sitePath?keep_after('//')?keep_before('/')?keep_after(':')
/>
</@_disk>
<div class="pageFormContent" layoutH>
<dl class="nowrap">
<dt><@t.page 'site'/>:</dt>
......@@ -10,18 +21,8 @@
<dl class="nowrap">
<dt><@t.page 'server_config.nginx'/>:</dt>
<dd>
<textarea class="code" mode="nginx"><@_disk>
<#assign
rootPath=rootPath?replace('\\','/')
dynamicPath=a.dynamicPath?keep_after('//')?keep_before('/')?keep_before(':')
dynamicLocation=a.dynamicPath?keep_after('//')?keep_after('/')
dynamicPort=a.dynamicPath?keep_after('//')?keep_before('/')?keep_after(':')
sitePath=a.sitePath?keep_after('//')?keep_before('/')?keep_before(':')
siteLocation=a.sitePath?keep_after('//')?keep_after('/')
sitePort=a.sitePath?keep_after('//')?keep_before('/')?keep_after(':')
/>
<#if dynamicPath!=sitePath||dynamicPort!=sitePort||dynamicPath=sitePath&&dynamicLocation!=siteLocation||a.useSsi>
<@_sysDomainList advanced=true siteId=siteId>
<textarea class="code" mode="nginx">
<@_sysDomainList advanced=true siteId=siteId>
#${a.name} <@t.page 'server_config.site'/>
server {
listen ${dynamicPort?has_content?then(dynamicPort,80)};
......@@ -54,24 +55,23 @@ server {
<#if a.useSsi>
location /include/ {
alias ${rootPath}/web/site_${siteId}/include/;
alias ${realRootPath}/web/site_${siteId}/include/;
}
</#if>
<#if dynamicPath=sitePath&&dynamicLocation!=siteLocation>
#${a.name} <@t.page 'server_config.static'/>
location ${siteLocation?has_content?then('/'+siteLocation,'/')} {
alias ${rootPath}/web/site_${siteId}/;
alias ${realRootPath}/web/site_${siteId}/;
index index.html;
}
<#else>
location ${dynamicLocation?has_content?then('/'+dynamicLocation,'/')}webfile/ {
alias ${rootPath}/web/site_${siteId}/webfile/;
alias ${realRootPath}/web/site_${siteId}/webfile/;
index index.html;
}
</#if>
}
</@_sysDomainList>
</#if>
</@_sysDomainList>
<#if dynamicPath!=sitePath||dynamicPort!=sitePort||!(dynamicPath=sitePath&&dynamicLocation!=siteLocation)>
#${a.name} <@t.page 'server_config.static'/>
server {
......@@ -84,18 +84,18 @@ server {
<#if siteLocation?has_content>
location /include/ {
alias ${rootPath}/web/site_${siteId}/include/;
alias ${realRootPath}/web/site_${siteId}/include/;
}
</#if>
</#if>
location ${siteLocation?has_content?then('/'+siteLocation,'/')} {
alias ${rootPath}/web/site_${siteId}/;
alias ${realRootPath}/web/site_${siteId}/;
index index.html;
add_header Access-Control-Allow-Origin *;
}
}
</#if></@_disk></textarea>
</#if></textarea>
<span class="info"><@t.page 'server_config.nginx_config_description'/></span>
</dd>
</dl>
......@@ -110,6 +110,66 @@ upstream cms {
<span class="info"><@t.page 'server_config.nginx_common_description'/></span>
</dd>
</dl>
<dl class="nowrap">
<dt><@t.page 'server_config.apache'/>:</dt>
<dd>
<textarea class="code" mode="xml">
#${a.name} <@t.page 'server_config.site'/>
<Directory "${realRootPath}/web/site_${siteId}/">
AllowOverride None
Options Indexes FollowSymLinks Includes
Require all granted
</Directory>
<VirtualHost *:${dynamicPort?has_content?then(dynamicPort,80)}>
ServerName ${dynamicPath}
<@_sysDomainList advanced=true siteId=siteId>
<#if page.totalCount gt 0>
ServerAlias <#list page.list as d><#if d.name!=dynamicPath&&d.name!=sitePath>${d.name}</#if><#if d.wild> *.${d.name}</#if><#sep> </#list>
</#if>
</@_sysDomainList>
<#if a.useSsi>
alias /include/ "${realRootPath}/web/site_${siteId}/include/"
AddType text/html .html .shtml
AddOutputFilter INCLUDES .html .shtml
</#if>
ProxyRequests off
ProxyPreserveHost On
ProxyPass ${dynamicLocation?has_content?then('/'+dynamicLocation,'/')} http://localhost:8080${dynamicLocation?has_content?then('/'+dynamicLocation,'/')}
ProxyPassReverse ${dynamicLocation?has_content?then('/'+dynamicLocation,'/')} http://localhost:8080${dynamicLocation?has_content?then('/'+dynamicLocation,'/')}
<#if dynamicPath=sitePath&&dynamicLocation!=siteLocation>
#${a.name} <@t.page 'server_config.static'/>
Alias "/${siteLocation}" "${realRootPath}/web/site_${siteId}/"
<#else>
Alias "${dynamicLocation?has_content?then('/'+dynamicLocation,'/')}webfile/" "${realRootPath}/web/site_${siteId}/webfile/"
</#if>
</VirtualHost>
<#if dynamicPath!=sitePath||dynamicPort!=sitePort||!(dynamicPath=sitePath&&dynamicLocation!=siteLocation)>
#${a.name} <@t.page 'server_config.static'/>
<VirtualHost *:${sitePort?has_content?then(sitePort,80)}>
ServerName ${sitePath}
<#if a.useSsi>
<#if siteLocation?has_content>
alias /include/ "${realRootPath}/web/site_${siteId}/include/"
AddType text/html .html .shtml
AddOutputFilter INCLUDES .html .shtml
</#if>
</#if>
<#if siteLocation?has_content>
Alias "/${siteLocation}/" "${realRootPath}/web/site_${siteId}/"
<#else>
DocumentRoot "${realRootPath}/web/site_${siteId}/"
</#if>
<IfModule headers_module>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</VirtualHost>
</#if>
</textarea>
</dd>
</dl>
<dl class="nowrap">
<dt><@t.page 'server_config.tomcat'/>:</dt>
<dd><textarea class="code" mode="xml">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册