if(current->sslcert != NULL) free(current->sslcert);
current->sslcert = cm_strdup(r[1]);
}
+ } else if(cm_strcaseequ(r[0], "ServerRoot")) {
+ if(r[1] == NULL) {
+ cm_log("Config", "Missing path at line %d", ln);
+ stop = 1;
+ } else {
+ chdir(r[1]);
+ }
} else if(cm_strcaseequ(r[0], "DocumentRoot")) {
if(r[1] == NULL) {
cm_log("Config", "Missing path at line %d", ln);
CreateDirectory "$INSTDIR\etc"
CreateDirectory "$INSTDIR\www"
CreateDirectory "$INSTDIR\www\icons"
+ CreateDirectory "$INSTDIR\modules"
CreateDirectory "$INSTDIR\bin"
+ SetOutPath "$INSTDIR"
+ File /oname=LICENSE.txt "../LICENSE"
SetOutPath "$INSTDIR\bin"
File "tewi.exe"
+ SetOutPath "$INSTDIR\modules"
+ File "../Module/*.dll"
SetOutPath "$INSTDIR\etc"
- File /oname=tewi.conf.default "../example-win.conf"
+ SetOverWrite off
+ File /oname=tewi.conf "../example-win.conf"
SetOutPath "$INSTDIR\www"
File /oname=index.html "../itworks.html"
SetOutPath "$INSTDIR\www\icons"
File "../Icons/*.png"
+ SetOverWrite on
CreateDirectory "$SMPROGRAMS\Tewi HTTPd"
+ CreateShortcut "$SMPROGRAMS\Tewi HTTPd\License.lnk" "$INSTDIR\LICENSE.txt" ""
CreateShortcut "$SMPROGRAMS\Tewi HTTPd\Start Tewi HTTPd.lnk" "$INSTDIR\bin\tewi.exe" ""
CreateShortcut "$SMPROGRAMS\Tewi HTTPd\Start Tewi HTTPd (verbose).lnk" "$INSTDIR\bin\tewi.exe" "-v"
CreateShortcut "$SMPROGRAMS\Tewi HTTPd\Uninstall Tewi HTTPd.lnk" "$INSTDIR\uninstall.exe" ""
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tewi HTTPd" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteUninstaller "$INSTDIR\uninstall.exe"
-
- MessageBox MB_ICONEXCLAMATION|MB_OK "Example config is installed as $INSTDIR\etc\tewi.conf.default,$\r$\nBut Tewi HTTPd will try to use $INSTDIR\etc\tewi.conf."
SectionEnd
Section "Uninstall"
tw_http_error(s, sock, 403, name, port);
} else if(S_ISDIR(st.st_mode)) {
if(req.path[strlen(req.path) - 1] != '/') {
+ cm_log("Server", "Accessing directory without the slash at the end");
char* headers[3] = {"Location", cm_strcat(req.path, "/"), NULL};
_tw_process_page(s, sock, tw_http_status(308), NULL, NULL, NULL, 0, headers, 0, 0);
free(headers[1]);
-# $Id$
-# This is an example config
-
-Listen 80
-#ListenSSL 443
-
-#SSLKey key.pem
-#SSLCertificate cert.pem
-
-MIMEType all application/octet-stream
-MIMEType .html text/html
-MIMEType .txt text/plain
-MIMEType .png image/png
-
-Icon all /icons/unknown.png
-Icon text/* /icons/text.png
-Icon image/* /icons/image.png
-Icon misc/dir /icons/folder.png
-Icon misc/parent /icons/parent.png
-
-DirectoryIndex index.html
-
-Readme README
-
-DocumentRoot C:/Tewi/www
-
-BeginDirectory C:/Tewi/www
- Allow all
-EndDirectory
+# $Id$\r
+# This is an example config\r
+\r
+ServerRoot C:/Tewi\r
+\r
+Listen 80\r
+#ListenSSL 443\r
+\r
+#SSLKey key.pem\r
+#SSLCertificate cert.pem\r
+\r
+MIMEType all application/octet-stream\r
+MIMEType .html text/html\r
+MIMEType .txt text/plain\r
+MIMEType .png image/png\r
+\r
+Icon all /icons/unknown.png\r
+Icon text/* /icons/text.png\r
+Icon image/* /icons/image.png\r
+Icon misc/dir /icons/folder.png\r
+Icon misc/parent /icons/parent.png\r
+\r
+DirectoryIndex index.html\r
+\r
+Readme README\r
+\r
+DocumentRoot C:/Tewi/www\r
+\r
+BeginDirectory C:/Tewi/www\r
+ Allow all\r
+EndDirectory\r