open source apache conf manager for NT idiots like me

I am working with a gent who has held my hand from 10000 miles away at this site to fix my conf file so it actually runs (see three weeks thread...what-a-name) and for those running NT here's the beta ... you are welcome to it. Once it works I'll port it to perl and offer it here if you want...

1 rem (c) 2003 kckclass - makeconf.bas v 1.0 webhostingtalk.com retard - open source - free to use - compiled with qbasic/dos
2 rem reads customer.dat (domain name list) and a copy of the httpd.conf file, like h.cfg and
3 rem rebuilds h.cfg with new virtual host blocks. totally untested and scrappy - not fit for release but hey, it's yours.
10 MYH$=COMMAND$:IF MYH$="" THEN CLSopen source apache conf manager for NT idiots like meRINT"usage: MAKECONF filename where filename is the mirrored editable httpd.conf file such as h.cfg"open source apache conf manager for NT idiots like meRINT"use DOS file naming formats 12345678.123 max"open source apache conf manager for NT idiots like meYSTEM
20 DIM CUST$(200)open source apache conf manager for NT idiots like meIM VLINES$(19):HLIM=19
30 VLINES$(1)="<VirtualHost _default_:*>"
40 VLINES$(2)=" DocumentRoot c:/hosting/bigdrivehosting.com/web"
50 VLINES$(3)=" ServerName www.bigdrivehosting.com"
60 VLINES$(4)=" DirectoryIndex index.html index.htm index.shtml index.html.var"
70 VLINES$(5)=" ScriptAlias /cgi-bin/ /hosting/bigdrivehosting.com/web/userscripts"
80 VLINES$(6)=" Options Includes"
90 VLINES$(7)=" <Directory "+CHR$(34)+"c:/hosting/bigdrivehosting.com/web/data"+CHR$(34)+">"
100 VLINES$(8)=" AllowOverride FileInfo AuthConfig Limit"
110 VLINES$(9)=" Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec"
120 VLINES$(10)=" <Limit GET POST OPTIONS>"
130 VLINES$(11)=" Order allow,deny"
140 VLINES$(12)=" Deny from all"
150 VLINES$(13)=" </Limit>"
160 VLINES$(14)=" <LimitExcept GET POST OPTIONS>"
170 VLINES$(15)=" Order deny,allow"
180 VLINES$(16)=" Allow from all"
190 VLINES$(17)=" </LimitExcept>"
200 VLINES$(18)=" </Directory>"
210 VLINES$(19)="</VirtualHost>"
220 REM control *********************************************************
230 GOSUB 280:REM LOAD CUSTOMERS
240 GOSUB 380:REM LOAD MYH - CURRENT EDITABLE HTTPD.CONF FILE I.E. H.CFG
250 GOSUB 470:REM CREATE V HOST SECTION IN FILE
260 GOSUB 620:REM COPY makeconf.tmp to myh
270 SYSTEM
280 REM ****************************************
290 REM read customer.dat
300 REM ****************************************
310 OPEN "I",#1,"customer.dat":REM stored in same directory as myh$
320 LINE INPUT#1,I$:IF EOF(1) THEN EO=1
330 IF MID$(I$,1,1)="#" THEN GOTO 350
340 CUST=CUST+1:CUST$(CUST)=I$
350 IF EO=0 THEN GOTO 320
360 CLOSE
370 RETURN
380 REM ****************************************
390 REM read myh$ and build .tmp
400 REM ****************************************
410 CLOSE:OPEN "I",#1,MYH$:EO=0:OPEN "O",#2,"makeconf.tmp"open source apache conf manager for NT idiots like meOV$="N"
420 LINE INPUT#1,I$:IF EOF(1) THEN EO=1
430 IF I$="<VirtualHost _default_:*>" THEN DOV$="Y"
440 IF DOV$="N" THEN PRINT#2,I$:IF EO=0 THEN GOTO 420
450 RETURN
470 REM ****************************************
480 REM adds virtual host customers
490 FOR CUSTPTR=0 TO CUST
500 PRINT#2," "
510 FOR VLINES=1 TO HLIM
520 O$=VLINES$(VLINES):NEWO$=""
530 FOR CP=1 TO LEN(O$)
540 IF CUSTPTR>0 THEN IF MID$(O$,CP,19)="bigdrivehosting.com" THEN NEWO$=NEWO$+CUST$(CUSTPTR):CP=CP+18:GOTO 570
550 IF CUSTPTR>0 THEN IF MID$(O$,CP,9)="_default_" THEN NEWO$=NEWO$+CUST$(CUSTPTR):CP=CP+8:GOTO 570
560 NEWO$=NEWO$+MID$(O$,CP,1)
570 NEXT CP
580 PRINT#2,NEWO$
590 NEXT VLINES
600 NEXT CUSTPTR
610 RETURN
620 REM ****************************************
630 REM read .tmp and rewrite myh$ - last step
640 CLOSE:OPEN "I",#1,"makeconf.tmp":OPEN "O",#2,MYH$:EO=0
650 LINE INPUT#1,I$:IF EOF(1) THEN EO=1
660 PRINT#2,I$:IF EO=0 THEN GOTO 650
670 RETURN


it reads a customer file called customer.dat like

bigdrivehosting.com
eduhosting.org
craigsworld.org
isopdesigns.org
#cutesurfers.com

# before cutesurfers disables that vblock build.

It also reads an editable httpd.conf file like h.cfg - a mirror on my system

Now bear in mind the default vblock at the top was designed by a retard, is probably really messed up and has yet to work so this is v1.0.

Author would appreciate any feedback... especially top section reviews and modifications

p.s. cute... colon P above makes a little green happy face and colon D makes a happy face with teeth... translate as you go.

 

 

 

 

Top