Backend implementation of config objects
This commit is contained in:
parent
224372f0ad
commit
2d1a7d647c
13 changed files with 215 additions and 131 deletions
2
WebAdmin.iml
Normal file → Executable file
2
WebAdmin.iml
Normal file → Executable file
|
|
@ -12,7 +12,6 @@
|
|||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="ZUtil" exported="" />
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library name="lib">
|
||||
<CLASSES>
|
||||
|
|
@ -26,5 +25,6 @@
|
|||
<jarDirectory url="file://$MODULE_DIR$/lib" recursive="false" />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module" module-name="Zutil" exported="" />
|
||||
</component>
|
||||
</module>
|
||||
6
resources/WebContent/page/ConfigPage.tmpl
Normal file → Executable file
6
resources/WebContent/page/ConfigPage.tmpl
Normal file → Executable file
|
|
@ -17,7 +17,7 @@
|
|||
</td>
|
||||
{{/.getConfiguration()}}
|
||||
<td class="text-right">
|
||||
<button type="button" class="btn btn-primary btn-xs" title="Edit">
|
||||
<button type="button" class="btn btn-default btn-xs" title="Edit">
|
||||
<span class="glyphicon glyphicon-wrench" aria-hidden="true"></span>
|
||||
</button>
|
||||
{{^.enabled}}
|
||||
|
|
@ -26,11 +26,11 @@
|
|||
</button>
|
||||
{{/.enabled}}
|
||||
{{#.enabled}}
|
||||
<button type="button" class="btn btn-success btn-xs" title="Activate">
|
||||
<button type="button" class="btn btn-default btn-xs" title="Activate">
|
||||
<span class="glyphicon glyphicon-ok-circle" aria-hidden="true"></span>
|
||||
</button>
|
||||
{{/.enabled}}
|
||||
<button type="button" class="btn btn-danger btn-xs" title="Remove">
|
||||
<button type="button" class="btn btn-default btn-xs" title="Remove">
|
||||
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
|
||||
</button>
|
||||
</td>
|
||||
|
|
|
|||
2
src/wa/server/WAAbstractPage.java
Normal file → Executable file
2
src/wa/server/WAAbstractPage.java
Normal file → Executable file
|
|
@ -111,7 +111,7 @@ public class WAAbstractPage implements HttpPage{
|
|||
if(content != null) {
|
||||
if(!breadcrumb.isEmpty())
|
||||
content.set("nav", breadcrumb.get(breadcrumb.size() - 1));
|
||||
tmpl.set("content", content.compile());
|
||||
tmpl.set("content", content);
|
||||
}
|
||||
|
||||
out.print(tmpl.compile());
|
||||
|
|
|
|||
41
src/wa/server/page/ConfigPage.java
Normal file → Executable file
41
src/wa/server/page/ConfigPage.java
Normal file → Executable file
|
|
@ -23,9 +23,11 @@
|
|||
package wa.server.page;
|
||||
|
||||
import wa.server.WAContext;
|
||||
import wa.server.plugin.WAConfigEntry;
|
||||
import wa.server.plugin.WAServiceConfig;
|
||||
import wa.server.plugin.apache.ApacheConfigVirtualHost;
|
||||
import zutil.db.bean.Configurator;
|
||||
import zutil.db.bean.DBBean;
|
||||
import zutil.io.file.FileUtil;
|
||||
import zutil.log.LogUtil;
|
||||
import zutil.net.http.HttpHeaderParser;
|
||||
|
|
@ -65,14 +67,36 @@ public class ConfigPage implements WAPage{
|
|||
Map<String, String> request) {
|
||||
try {
|
||||
List<?> confObjs = config.getConfigData();
|
||||
ArrayList<Configurator> confList = new ArrayList<>();
|
||||
ArrayList<Configurator<WAConfigEntry>> confList = new ArrayList<>();
|
||||
for(Object obj : confObjs){
|
||||
confList.add(new Configurator(obj));
|
||||
}
|
||||
confList.add(new Configurator(new ApacheConfigVirtualHost.ApacheVirtualHostData()));
|
||||
confList.add(new Configurator(new ApacheConfigVirtualHost.ApacheVirtualHostData()));
|
||||
confList.add(new Configurator(new ApacheConfigVirtualHost.ApacheVirtualHostData()));
|
||||
|
||||
// Actions
|
||||
int index = Integer.parseInt(request.get("id"));
|
||||
Configurator<WAConfigEntry> target = findObj(confList, index);
|
||||
switch (request.get("action")){
|
||||
case "create":
|
||||
target = new Configurator(config.createConfig());
|
||||
case "modify":
|
||||
for(Configurator.ConfigurationParam param : target.getConfiguration()){
|
||||
if(request.containsKey(param.getName()))
|
||||
param.setValue(request.get(param.getName()));
|
||||
}
|
||||
target.applyConfiguration();
|
||||
break;
|
||||
case "delete":
|
||||
config.deleteConfig(index);
|
||||
break;
|
||||
case "enable":
|
||||
target.getObject().setEnabled(true);
|
||||
break;
|
||||
case "disable":
|
||||
target.getObject().setEnabled(false);
|
||||
break;
|
||||
}
|
||||
|
||||
// Prepare Output
|
||||
Templator tmpl = new Templator(FileUtil.find(TMPL_FILE));
|
||||
tmpl.set("params", Configurator.getConfiguration(
|
||||
config.getConfigClass()));
|
||||
|
|
@ -92,4 +116,13 @@ public class ConfigPage implements WAPage{
|
|||
Map<String, String> request) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private static Configurator<WAConfigEntry> findObj(List<Configurator<WAConfigEntry>> list, int id){
|
||||
for (Configurator<WAConfigEntry> conf : list) {
|
||||
if(conf.getObject().getId() == id)
|
||||
return conf;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
177
src/wa/server/page/WALogPage.java → src/wa/server/page/LogPage.java
Normal file → Executable file
177
src/wa/server/page/WALogPage.java → src/wa/server/page/LogPage.java
Normal file → Executable file
|
|
@ -1,85 +1,92 @@
|
|||
/*
|
||||
* Copyright (c) 2015 ezivkoc
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package wa.server.page;
|
||||
|
||||
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
|
||||
import zutil.net.http.HttpHeaderParser;
|
||||
import zutil.net.http.HttpPage;
|
||||
import zutil.net.http.HttpPrintStream;
|
||||
import zutil.parser.DataNode;
|
||||
import zutil.parser.json.JSONWriter;
|
||||
import zutil.struct.CircularBuffer;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Handler;
|
||||
import java.util.logging.LogRecord;
|
||||
|
||||
/**
|
||||
* Created by Ziver on 2015-09-22.
|
||||
*/
|
||||
public class WALogPage extends Handler implements HttpPage {
|
||||
private CircularBuffer<LogRecord> logBuffer;
|
||||
|
||||
@Override
|
||||
public void publish(LogRecord record) {
|
||||
if(super.isLoggable(record)){
|
||||
logBuffer.add(record);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void flush() {}
|
||||
@Override
|
||||
public void close() throws SecurityException {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void respond(HttpPrintStream out,
|
||||
HttpHeaderParser client_info,
|
||||
Map<String, Object> session,
|
||||
Map<String, String> cookie,
|
||||
Map<String, String> request) throws IOException {
|
||||
|
||||
DataNode logNode = new DataNode(DataNode.DataType.List);
|
||||
Iterator<LogRecord> it = logBuffer.iterator();
|
||||
for(int i=0; i<20 && it.hasNext(); ++i){
|
||||
LogRecord record = it.next();
|
||||
DataNode node = new DataNode(DataNode.DataType.Map);
|
||||
node.set("timestamp", record.getMillis());
|
||||
node.set("source", record.getLoggerName());
|
||||
node.set("msg", record.getMessage());
|
||||
logNode.add(node);
|
||||
}
|
||||
|
||||
DataNode root = new DataNode(DataNode.DataType.Map);
|
||||
root.add(logNode);
|
||||
JSONWriter writer = new JSONWriter(out);
|
||||
writer.write(root);
|
||||
writer.close();
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Copyright (c) 2015 ezivkoc
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
package wa.server.page;
|
||||
|
||||
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
|
||||
import wa.server.plugin.WALog;
|
||||
import zutil.net.http.HttpHeaderParser;
|
||||
import zutil.net.http.HttpPage;
|
||||
import zutil.net.http.HttpPrintStream;
|
||||
import zutil.parser.DataNode;
|
||||
import zutil.parser.json.JSONWriter;
|
||||
import zutil.struct.CircularBuffer;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Handler;
|
||||
import java.util.logging.LogRecord;
|
||||
|
||||
/**
|
||||
* Created by Ziver on 2015-09-22.
|
||||
*/
|
||||
public class LogPage extends Handler implements HttpPage {
|
||||
private CircularBuffer<LogRecord> logBuffer;
|
||||
private WALog log;
|
||||
|
||||
public LogPage(WALog log) {
|
||||
logBuffer = new CircularBuffer<>(500);
|
||||
this.log = log;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void publish(LogRecord record) {
|
||||
if(super.isLoggable(record)){
|
||||
logBuffer.add(record);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void flush() {}
|
||||
@Override
|
||||
public void close() throws SecurityException {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void respond(HttpPrintStream out,
|
||||
HttpHeaderParser client_info,
|
||||
Map<String, Object> session,
|
||||
Map<String, String> cookie,
|
||||
Map<String, String> request) throws IOException {
|
||||
|
||||
DataNode logNode = new DataNode(DataNode.DataType.List);
|
||||
Iterator<LogRecord> it = logBuffer.iterator();
|
||||
for(int i=0; i<20 && it.hasNext(); ++i){
|
||||
LogRecord record = it.next();
|
||||
DataNode node = new DataNode(DataNode.DataType.Map);
|
||||
node.set("timestamp", record.getMillis());
|
||||
node.set("source", record.getLoggerName());
|
||||
node.set("msg", record.getMessage());
|
||||
logNode.add(node);
|
||||
}
|
||||
|
||||
DataNode root = new DataNode(DataNode.DataType.Map);
|
||||
root.add(logNode);
|
||||
JSONWriter writer = new JSONWriter(out);
|
||||
writer.write(root);
|
||||
writer.close();
|
||||
}
|
||||
}
|
||||
14
src/wa/server/page/ServicePage.java
Normal file → Executable file
14
src/wa/server/page/ServicePage.java
Normal file → Executable file
|
|
@ -50,18 +50,21 @@ public class ServicePage implements WAPage {
|
|||
private ServiceStatusPage rootStatusPage;
|
||||
private ArrayList<WAService> services;
|
||||
private ArrayList<ServiceStatusPage> statusPages;
|
||||
private ArrayList<LogPage> logPages;
|
||||
private ArrayList<ConfigPage> configPages;
|
||||
|
||||
public ServicePage(PluginManager pluginManager){
|
||||
this.services = pluginManager.toArray(WAService.class);
|
||||
this.rootStatusPage = new ServiceStatusPage(pluginManager);
|
||||
this.statusPages = new ArrayList<>();
|
||||
this.logPages = new ArrayList<>();
|
||||
this.configPages = new ArrayList<>();
|
||||
|
||||
WANavigation nav = WANavigation.createRootNav(NAVIGATION_NAME);
|
||||
nav.setResource(this);
|
||||
for(WAService plugin : services) {
|
||||
statusPages.add(new ServiceStatusPage(plugin.getStatus()));
|
||||
logPages.add(new LogPage(plugin.getLog()));
|
||||
|
||||
WANavigation serviceNav = nav.createSubNav(plugin.getName());
|
||||
serviceNav.setResource(plugin);
|
||||
|
|
@ -91,12 +94,15 @@ public class ServicePage implements WAPage {
|
|||
else if ((index = services.indexOf(resource)) >= 0) {
|
||||
WAService obj = services.get(index);
|
||||
ServiceStatusPage statusPage = statusPages.get(index);
|
||||
LogPage logPage = logPages.get(index);
|
||||
|
||||
Templator tmpl = new Templator(FileUtil.find(TMPL_FILE));
|
||||
tmpl.set("service_status",
|
||||
statusPage.htmlResponse(context, client_info, session, cookie, request).compile());
|
||||
//tmpl.set("service_logs",
|
||||
// statusPage.htmlResponse(context, client_info, session, cookie, request).compile());
|
||||
if(statusPage != null)
|
||||
tmpl.set("service_status",
|
||||
statusPage.htmlResponse(context, client_info, session, cookie, request));
|
||||
if(logPage != null)
|
||||
tmpl.set("service_logs",
|
||||
statusPage.htmlResponse(context, client_info, session, cookie, request));
|
||||
return tmpl;
|
||||
}
|
||||
else{ // root page
|
||||
|
|
|
|||
19
src/wa/server/plugin/WAConfigEntry.java
Executable file
19
src/wa/server/plugin/WAConfigEntry.java
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
package wa.server.plugin;
|
||||
|
||||
import zutil.db.bean.DBBean;
|
||||
|
||||
/**
|
||||
* Created by Ziver on 2015-11-16.
|
||||
*/
|
||||
public abstract class WAConfigEntry extends DBBean{
|
||||
|
||||
private boolean enabled = true;
|
||||
|
||||
|
||||
public void setEnabled(boolean enabled){
|
||||
this.enabled = enabled;
|
||||
}
|
||||
public boolean isEnabled(){
|
||||
return enabled;
|
||||
}
|
||||
}
|
||||
7
src/wa/server/plugin/WALog.java
Executable file
7
src/wa/server/plugin/WALog.java
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
package wa.server.plugin;
|
||||
|
||||
/**
|
||||
* Created by Ziver on 2015-11-16.
|
||||
*/
|
||||
public class WALog {
|
||||
}
|
||||
5
src/wa/server/plugin/WAService.java
Normal file → Executable file
5
src/wa/server/plugin/WAService.java
Normal file → Executable file
|
|
@ -9,6 +9,11 @@ public interface WAService {
|
|||
*/
|
||||
public WAServiceStatus getStatus();
|
||||
|
||||
/**
|
||||
* @return a service log object or null if it is not possible to read logs
|
||||
*/
|
||||
public WALog getLog();
|
||||
|
||||
/**
|
||||
* @return a installer object that will install the service or null if the installer is not available
|
||||
*/
|
||||
|
|
|
|||
11
src/wa/server/plugin/WAServiceConfig.java
Normal file → Executable file
11
src/wa/server/plugin/WAServiceConfig.java
Normal file → Executable file
|
|
@ -12,12 +12,15 @@ public interface WAServiceConfig {
|
|||
/**
|
||||
* Read in current configuration data
|
||||
*/
|
||||
public void read() throws Exception;
|
||||
//public void read() throws Exception;
|
||||
|
||||
/**
|
||||
* Save configured data to disk or database
|
||||
*/
|
||||
public void save() throws Exception;
|
||||
//public void save() throws Exception;
|
||||
|
||||
public WAConfigEntry createConfig();
|
||||
public void deleteConfig(int id);
|
||||
|
||||
/**
|
||||
* Configure service with current configuration data
|
||||
|
|
@ -31,10 +34,10 @@ public interface WAServiceConfig {
|
|||
* configuration can be changed with the
|
||||
* {@link zutil.db.bean.Configurator} class.
|
||||
*/
|
||||
public List<?> getConfigData();
|
||||
public List<? extends WAConfigEntry> getConfigData();
|
||||
|
||||
/**
|
||||
* @return the class that contains the configuration data
|
||||
*/
|
||||
public Class<?> getConfigClass();
|
||||
public Class<? extends WAConfigEntry> getConfigClass();
|
||||
}
|
||||
|
|
|
|||
48
src/wa/server/plugin/apache/ApacheConfigVirtualHost.java
Normal file → Executable file
48
src/wa/server/plugin/apache/ApacheConfigVirtualHost.java
Normal file → Executable file
|
|
@ -1,6 +1,7 @@
|
|||
package wa.server.plugin.apache;
|
||||
|
||||
import wa.server.WAConstants;
|
||||
import wa.server.plugin.WAConfigEntry;
|
||||
import wa.server.plugin.WAServiceConfig;
|
||||
import wa.server.util.ConfigFileUtil;
|
||||
import zutil.db.DBConnection;
|
||||
|
|
@ -16,30 +17,30 @@ import java.util.List;
|
|||
|
||||
public class ApacheConfigVirtualHost implements WAServiceConfig{
|
||||
private static final String CONFIG_NAME = "Apache Virtual Host";
|
||||
private static final String APACHE_MAIN_CONFIG_FILE = "apache2/apache2.conf";
|
||||
private static final String APACHE_MAIN_CONFIG_FILE = "/apache2/apache2.conf";
|
||||
private static final String APACHE_SITE_AVAILABLE_PATH = "/apache2/site-available/";
|
||||
private static final String STATIC_PRE_CONF = "wa/server/plugin/apache/apache_default.config";
|
||||
|
||||
private List<ApacheVirtualHostData> vhosts = new ArrayList<>();
|
||||
private List<ApacheVirtualHostEntry> vhosts = new ArrayList<>();
|
||||
|
||||
|
||||
public ApacheConfigVirtualHost() throws Exception {
|
||||
DBConnection db = WAConstants.getDB();
|
||||
vhosts = DBBean.load(db, ApacheVirtualHostEntry.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return CONFIG_NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read() throws Exception {
|
||||
DBConnection db = WAConstants.getDB();
|
||||
vhosts = DBBean.load(db, ApacheVirtualHostData.class);
|
||||
}
|
||||
public WAConfigEntry createConfig(){
|
||||
return new ApacheVirtualHostEntry();
|
||||
}
|
||||
public void deleteConfig(int id){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save() throws Exception {
|
||||
DBConnection db = WAConstants.getDB();
|
||||
for(ApacheVirtualHostData vhost : vhosts){
|
||||
vhost.save(db);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure() throws Exception {
|
||||
|
|
@ -51,23 +52,23 @@ public class ApacheConfigVirtualHost implements WAServiceConfig{
|
|||
new FileInputStream(STATIC_PRE_CONF)));
|
||||
|
||||
// Write Vhost configuration
|
||||
for(ApacheVirtualHostData vhost : vhosts){
|
||||
for(ApacheVirtualHostEntry vhost : vhosts){
|
||||
vhost.configure();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<?> getConfigData() {
|
||||
public List<? extends WAConfigEntry> getConfigData() {
|
||||
return vhosts;
|
||||
}
|
||||
@Override
|
||||
public Class<?> getConfigClass() {
|
||||
return ApacheVirtualHostData.class;
|
||||
public Class<? extends WAConfigEntry> getConfigClass() {
|
||||
return ApacheVirtualHostEntry.class;
|
||||
}
|
||||
|
||||
|
||||
@DBTable(WAConstants.DB_TABLE_PREFIX + "_apache_vhost")
|
||||
public static class ApacheVirtualHostData extends DBBean{
|
||||
public static class ApacheVirtualHostEntry extends WAConfigEntry {
|
||||
@Configurable("Domain")
|
||||
protected String domain;
|
||||
protected transient String domain_old;
|
||||
|
|
@ -101,10 +102,11 @@ public class ApacheConfigVirtualHost implements WAServiceConfig{
|
|||
|
||||
public final void configure() throws IOException {
|
||||
if(domain != domain_old){ // Configuration file has changed name
|
||||
WAConstants.getConfigFile("apache2/enabled/"+ domain_old).delete();
|
||||
WAConstants.getConfigFile(APACHE_SITE_AVAILABLE_PATH+ domain_old).delete();
|
||||
domain_old = domain;
|
||||
}
|
||||
PrintStream out = new PrintStream(
|
||||
WAConstants.getConfigFile("apache2/enabled/"+ domain));
|
||||
WAConstants.getConfigFile(APACHE_SITE_AVAILABLE_PATH+ domain));
|
||||
|
||||
writeConfiguration(out);
|
||||
out.close();
|
||||
|
|
@ -129,8 +131,8 @@ public class ApacheConfigVirtualHost implements WAServiceConfig{
|
|||
}
|
||||
else {
|
||||
out.println("<VirtualHost *:80>");
|
||||
out.println(" ServerName " + domain + ":80");
|
||||
out.println(" DocumentRoot " + path);
|
||||
out.println(" ServerName "+ domain +":80");
|
||||
out.println(" DocumentRoot "+ path);
|
||||
out.println("</VirtualHost>");
|
||||
out.println("");
|
||||
}
|
||||
|
|
|
|||
10
src/wa/server/plugin/apache/ApacheService.java
Normal file → Executable file
10
src/wa/server/plugin/apache/ApacheService.java
Normal file → Executable file
|
|
@ -22,10 +22,7 @@
|
|||
|
||||
package wa.server.plugin.apache;
|
||||
|
||||
import wa.server.plugin.WAServiceConfig;
|
||||
import wa.server.plugin.WAInstaller;
|
||||
import wa.server.plugin.WAService;
|
||||
import wa.server.plugin.WAServiceStatus;
|
||||
import wa.server.plugin.*;
|
||||
import zutil.log.LogUtil;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
|
@ -53,6 +50,11 @@ public class ApacheService implements WAService {
|
|||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WALog getLog() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WAInstaller getInstaller() {
|
||||
if(installer == null)
|
||||
|
|
|
|||
4
src/wa/server/plugin/tomcat/TomcatConfigApplication.java
Normal file → Executable file
4
src/wa/server/plugin/tomcat/TomcatConfigApplication.java
Normal file → Executable file
|
|
@ -23,14 +23,14 @@ package wa.server.plugin.tomcat;
|
|||
|
||||
import java.io.PrintStream;
|
||||
|
||||
import wa.server.plugin.apache.ApacheConfigVirtualHost.ApacheVirtualHostData;
|
||||
import wa.server.plugin.apache.ApacheConfigVirtualHost.ApacheVirtualHostEntry;
|
||||
|
||||
|
||||
public class TomcatConfigApplication {
|
||||
|
||||
|
||||
|
||||
public static class TomcatApplicationData extends ApacheVirtualHostData {
|
||||
public static class TomcatApplicationEntry extends ApacheVirtualHostEntry {
|
||||
@Override
|
||||
public void writeConfiguration(PrintStream out) {
|
||||
out.println("<VirtualHost *:80>");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue