home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 8 / CDACTUAL8.iso / share / os2 / varios / apache / virtppp.cmd < prev    next >
Encoding:
Text File  |  1996-01-22  |  5.2 KB  |  148 lines

  1. /* virtppp.cmd */
  2.  
  3. /*
  4. Version:     1.0b
  5. Date:        Jan 21, 1996
  6. By:          Jack Snodgrass - jack@cyberloans.com
  7.  
  8. The following Rexx .cmd file will set up a number of PPP ports ( default is
  9. 1... max is 10 because of a OS/2 PPP Limitation ) ( The warp server GA
  10. code should increase this max of 10 to 32. )There are a couple of
  11. assumptions.
  12.  
  13.    1). You have have a loopback port defined and it's IP Address is
  14.        127.0.0.1. Do an 'ifconfig lo' to make sure you've got this
  15.        set up. If you don't make sure and do a 'ifconfig lo 127.0.0.1'
  16.        and then route your own ip address to the loopback port... i.e.
  17.        'route add host my-ipaddress 127.0.0.1 0' Both of these lines are in
  18.        my '\mptn\bin\setup.cmd' file.
  19.  
  20.     2). You have a dedicated IP Address for each Virtual Host for your Web
  21.        Server. If you don't have an IP Address for each virtual host, you
  22.        can't use a Virtual Host. Your lan ( or ISP ) needs to know to route
  23.        all of your Virtual Host IP Addresses to your system. You 'may' be
  24.        able to do an 'ARP PUB' ( arp publish ) for each IP Address, but I
  25.        haven't tried that. All of my IP Addresses are routed to my main
  26.        OS/2 box.
  27.  
  28.     3). You find the lines:
  29.  
  30.         yourbase   = 'xxx.xxx.xxx'
  31.         youroffset = 'x'
  32.         comport    = 'comx'
  33.  
  34.         in this file and put your info in in the quotes. The quotes
  35.         ARE required. See the comments prior to the lines for an
  36.         explanation.
  37.     
  38.     NOTE: You can use an SIO virtual port instead of a real COM port.
  39.     I use the line:
  40.         DEVICE=C:\SIO.SYS (4, INTERNET, NONE)
  41.         to define COM4 as a virtual COM port. I use COM4 to define all of
  42.         my Virtual PPP ports.
  43.  
  44.  
  45.     4). You already have the Virtual Host stuff in the httpd.conf file
  46.        configured.
  47.  
  48.     5). Guess that about covers it. To test this ( the routing of the
  49.        virtual PPP Ports out, you need to do a ping on each IP Address
  50.        both locally and from a remote system. If the ping does not come
  51.        back to you, then your are NOT going to get the httpd virtual
  52.        host stuff to work. Figure out why ping doesn't work first.
  53.  
  54.     6). If you get an error from httpd about running out of file handles,
  55.         OR httpd traps in DOSCALLS.DLL when you start... you need to
  56.         issue the command SET EMXOPT=-h25 to add 25 file handles to your
  57.         httpd session. If you want to add more, then use a bigger
  58.         number than 25.
  59.  
  60.     7). Now... that is it I think. Let me know if you have any updates to
  61.         these instructions. Jack - jack@cyberloans.com
  62. */
  63.  
  64. parse arg inargs
  65. parse var inargs . '-c' cnt .
  66. parse var inargs . '-s' start .
  67.  
  68. if cnt = "" & start = "" then signal helpme
  69. if cnt \= "" then
  70.    if datatype(cnt) \= 'NUM' then signal helpme
  71. if start \= "" then
  72.    if datatype(start) \= 'NUM' then signal helpme
  73.  
  74. if cnt = "" then cnt = 1
  75. if cnt > 10 then cnt = 10
  76.  
  77. if start = "" then start = 0;
  78.  
  79. /* Load the REXXUTIL Function package. */
  80.    call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  81.    call SysLoadFuncs
  82.  
  83. /*************************************************************************\
  84.  yourbase is the first 3 octects of your IP Address. ex 111.222.111
  85.  youroffset is the start of the last octect where your PPP ports will
  86.  start. So.... if your going to use 111.222.111.1 - 111.222.111.4, then
  87.  you need:
  88.  yourbase   = '111.222.111'
  89.  youroffset = '1';
  90.  below.
  91.  
  92.  comport is the com port that you want to use for this.
  93.  
  94. \*************************************************************************/
  95. yourbase   = 'xxx.xxx.xxx'
  96. youroffset = 'x'
  97. comport    = 'comx'
  98.  
  99. if yourbase = 'xxx.xxx.xxx' then do
  100.    Say 'You must edit this file and customize it for your site!'
  101.    Say 'yourbase was not changed correctly.'
  102.    exit
  103. end
  104.  
  105. if youroffset = 'x' then do
  106.    Say 'You must edit this file and customize it for your site!'
  107.    Say 'youroffset was not changed correctly.'
  108.    exit
  109. end
  110.  
  111. if comport = 'comx' then do
  112.    Say 'You must edit this file and customize it for your site!'
  113.    Say 'comport was not changed correctly.'
  114.    exit
  115. end
  116.  
  117. do x = start to (cnt + start - 1)
  118.    ppp = 'ppp' || x
  119.    'start "'|| ppp || '" ppp' comport 'silent'
  120.    rc = syssleep(1)
  121.    'ifconfig' ppp yourbase || '.' || youroffset + x '131.131.131.'|| x + 1
  122.    rc = syssleep(1)
  123.    'route add' yourbase || '.' || youroffset + x '127.0.0.1 0'
  124.    rc = syssleep(1)
  125. end
  126. exit
  127.  
  128. HelpMe:
  129.    Say 'There is not much help... Sorry. There are two arguments than can'
  130.    say 'be passed to the program. You must supply one or both of them.'
  131.    say''
  132.    say '"-c count" where count is the number of ppp sessions you want'
  133.    say 'to start.'
  134.    say ''
  135.    say '"-s start" where start is the nuber of ppp sessions you have'
  136.    say 'currently running. i.e. if you don''t use PPP, then start will be'
  137.    say '0.'
  138.    say ''
  139.    say 'So... if you want to have 4 PPP sessions going and you already have'
  140.    say 'ppp0 active with a PPP Link, you need to do:'
  141.    say 'virtppp -c 4 -s 1'
  142.    say ''
  143.    say 'Check the .cmd comments or Send e-mail to jack@cyberloans.com if you'
  144.    say 'need more help.'
  145.    say ''
  146.    say 'Thanks - Jack Snodgrass - jack@cyberloans.com'
  147. exit
  148.