diff --git a/qse/cmd/http/httpd.c b/qse/cmd/http/httpd.c index ce2b928d..37e43984 100644 --- a/qse/cmd/http/httpd.c +++ b/qse/cmd/http/httpd.c @@ -779,7 +779,7 @@ static int load_loccfg (qse_httpd_t* httpd, qse_xli_list_t* list, loccfg_t* cfg) } pair = qse_xli_findpairbyname (httpd_xtn->xli, list, QSE_T("index")); - if (!pair) pair = qse_xli_findpairbyname (httpd_xtn->xli, QSE_NULL, QSE_T("default.index")); + if (!pair) pair = qse_xli_findpairbyname (httpd_xtn->xli, QSE_NULL, QSE_T("server-default.index")); if (pair && pair->val->type == QSE_XLI_STR) { const qse_char_t* tmpptr, * tmpend; @@ -801,7 +801,7 @@ static int load_loccfg (qse_httpd_t* httpd, qse_xli_list_t* list, loccfg_t* cfg) } pair = qse_xli_findpairbyname (httpd_xtn->xli, list, QSE_T("cgi")); - if (!pair) pair = qse_xli_findpairbyname (httpd_xtn->xli, QSE_NULL, QSE_T("default.cgi")); + if (!pair) pair = qse_xli_findpairbyname (httpd_xtn->xli, QSE_NULL, QSE_T("server-default.cgi")); if (pair && pair->val->type == QSE_XLI_LIST) { /* TODO: more sanity check... this can be done with xli schema... if supported */ @@ -879,7 +879,7 @@ static int load_loccfg (qse_httpd_t* httpd, qse_xli_list_t* list, loccfg_t* cfg) } pair = qse_xli_findpairbyname (httpd_xtn->xli, list, QSE_T("mime")); - if (!pair) pair = qse_xli_findpairbyname (httpd_xtn->xli, QSE_NULL, QSE_T("default.mime")); + if (!pair) pair = qse_xli_findpairbyname (httpd_xtn->xli, QSE_NULL, QSE_T("server-default.mime")); if (pair && pair->val->type == QSE_XLI_LIST) { qse_xli_list_t* mimelist = (qse_xli_list_t*)pair->val; @@ -1214,7 +1214,7 @@ static qse_httpd_server_t* attach_server (qse_httpd_t* httpd, int num, qse_xli_l } pair = qse_xli_findpairbyname (httpd_xtn->xli, list, QSE_T("ssl")); - if (!pair) pair = qse_xli_findpairbyname (httpd_xtn->xli, QSE_NULL, QSE_T("default.ssl")); + if (!pair) pair = qse_xli_findpairbyname (httpd_xtn->xli, QSE_NULL, QSE_T("server-default.ssl")); if (pair && pair->val->type == QSE_XLI_STR) dope.flags |= QSE_HTTPD_SERVER_SECURE; dope.detach = free_server_config; @@ -1348,7 +1348,7 @@ static int load_config (qse_httpd_t* httpd) } /* load the global default */ - pair = qse_xli_findpairbyname (httpd_xtn->xli, QSE_NULL, QSE_T("default")); + pair = qse_xli_findpairbyname (httpd_xtn->xli, QSE_NULL, QSE_T("server-default")); if (pair && pair->val->type == QSE_XLI_LIST) { if (load_loccfg (httpd, (qse_xli_list_t*)pair->val, &httpd_xtn->dflcfg) <= -1) diff --git a/qse/cmd/http/httpd.conf b/qse/cmd/http/httpd.conf index 626ac392..8921ce4b 100644 --- a/qse/cmd/http/httpd.conf +++ b/qse/cmd/http/httpd.conf @@ -5,14 +5,19 @@ # string to be used as a httpd name name = "QSEHTTPD v1"; +################################################ +# default server configuration +################################################ server-default { # default ssl certificate file #ssl-cert-file = "/etc/qse/cert.pem"; # default ssl private key file #ssl-key-file = "/etc/qse/key.pem"; + #################################################################### # document root - root = "/"; + #################################################################### + root = "/var/www"; realm = "default realm"; auth = "username:password"; @@ -33,7 +38,9 @@ server-default { @include "httpd-mime.conf"; } + #################################################################### # control access to directories + #################################################################### dir-access { #prefix ".xxxx" = ok; #suffix ".xxxx" = ok; @@ -41,8 +48,10 @@ server-default { #other = noent; } + #################################################################### # control access to normal files. # cgi scripts are not control by these. + #################################################################### file-access { #prefix "index.html." = ok; suffix ".html" = ok; @@ -53,16 +62,28 @@ server-default { #other = noent; } - dir-head = ""; - - # the directory listing shows the httpd name in the footer. - # you can override it with dir-foot. + #################################################################### + # directory listing includes this string in the tag of the + # generated html page. + #################################################################### + #dir-head = ""; + + #################################################################### + # directory listing shows the httpd name in the footer. you can + # override it with dir-foot. + #################################################################### #dir-foot = "QSEHTTPD v1"; - error-head = ""; + #################################################################### + # the error page includes this string in the tag of the + # generated html page. + #################################################################### + #error-head = ""; - # an error page shows the httpd name in the footer. - # you can override it with error-foot. + #################################################################### + # the error page shows the httpd name in the footer. you can + # override it with error-foot. + #################################################################### #error-foot = "QSEHTTPD v1"; } diff --git a/qse/lib/http/httpd-dir.c b/qse/lib/http/httpd-dir.c index 36a0102d..cc3d6aa5 100644 --- a/qse/lib/http/httpd-dir.c +++ b/qse/lib/http/httpd-dir.c @@ -592,7 +592,7 @@ qse_httpd_task_t* qse_httpd_entaskdir ( data.path.len = qse_mbslen(data.path.ptr); data.qpath.ptr = qse_htre_getqpath(req); data.qpath.len = qse_mbslen(data.qpath.ptr); - data.head.ptr = dir->head? dir->head: QSE_MT(""); + data.head.ptr = dir->head? dir->head: QSE_MT(""); data.head.len = qse_mbslen(data.head.ptr); data.foot.ptr = dir->foot? dir->foot: qse_httpd_getname(httpd); data.foot.len = qse_mbslen(data.foot.ptr); diff --git a/qse/lib/http/httpd-std.c b/qse/lib/http/httpd-std.c index 46504a13..88a8705f 100644 --- a/qse/lib/http/httpd-std.c +++ b/qse/lib/http/httpd-std.c @@ -2115,7 +2115,7 @@ static int format_error ( server_xtn = qse_httpd_getserverxtn (httpd, client->server); if (server_xtn->query (httpd, client->server, QSE_NULL, QSE_NULL, QSE_HTTPD_SERVERSTD_ERRHEAD, &head) <= -1) head = QSE_NULL; - if (head == QSE_NULL) head = QSE_MT(""); + if (head == QSE_NULL) head = QSE_MT(""); if (server_xtn->query (httpd, client->server, QSE_NULL, QSE_NULL, QSE_HTTPD_SERVERSTD_ERRFOOT, &foot) <= -1) foot = QSE_NULL; if (foot == QSE_NULL) foot = qse_httpd_getname(httpd);