Web Servers on Windows - running Apache from CD

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers on Windows > February 2004 > running Apache from CD





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author running Apache from CD
Michael Powe

2004-02-19, 1:36 am

i would like to run apache from a cd. i installed it (win2k), selecting
the option to run it from the command line on port 8080, copied the
install directory to another partition and uninstalled the original. i
changed httpd.conf to point to writable directories for htdocs, cgi-bin
and logs. for testing purposes, i then made the apache directory
read-only. i run apache from the commandline thus:

$ apache -e debug

it shows only that it is loading the modules, then it bails out without
further messages. this is version 2.0.48.

any thoughts on how i can make this work would be appreciated.

thanks.

mp
Brian K. White

2004-02-19, 11:36 am

When I run Process Explorer from (SysInternals) it shows an open that
Apache.exe has an open handle on "C:\Program Files\Apache Group\Apache2".
This may be your problem. Apache may not run correctly if it cannot get a
handle to that directory. Also keep in mind that sometimes file handles are
opened indirectly do to the internal workings of Windows. (Many times, a
program will have an open handle to a directory if it has created, updated
or deleted files in the directory.) My suggestion is to try everything else
as read only but leave the Apache2 directory and everything above it alone.

--Brian K. White

"Michael Powe" <michael+hervieu@trollope.org> wrote in message
news:c12fi90nr2@enews4.newsguy.com...
> i would like to run apache from a cd. i installed it (win2k), selecting
> the option to run it from the command line on port 8080, copied the
> install directory to another partition and uninstalled the original. i
> changed httpd.conf to point to writable directories for htdocs, cgi-bin
> and logs. for testing purposes, i then made the apache directory
> read-only. i run apache from the commandline thus:
>
> $ apache -e debug
>
> it shows only that it is loading the modules, then it bails out without
> further messages. this is version 2.0.48.
>
> any thoughts on how i can make this work would be appreciated.
>
> thanks.
>
> mp



Michael Powe

2004-02-19, 11:35 pm

>>>>> "Brian" == Brian K White <nospam@foxfire74.com> writes:

Brian> When I run Process Explorer from (SysInternals) it shows an
Brian> open that Apache.exe has an open handle on "C:\Program
Brian> Files\Apache Group\Apache2". This may be your problem.
Brian> Apache may not run correctly if it cannot get a handle to
Brian> that directory. Also keep in mind that sometimes file
Brian> handles are opened indirectly do to the internal workings
Brian> of Windows. (Many times, a program will have an open
Brian> handle to a directory if it has created, updated or deleted
Brian> files in the directory.) My suggestion is to try
Brian> everything else as read only but leave the Apache2
Brian> directory and everything above it alone.

thank you, i will try that.

mp

--
cat: /home/powem/.signature: No such file or directory
Jim Patterson

2004-02-20, 2:35 pm

Michael Powe wrote:
> i would like to run apache from a cd. i installed it (win2k), selecting
> the option to run it from the command line on port 8080, copied the
> install directory to another partition and uninstalled the original. i
> changed httpd.conf to point to writable directories for htdocs, cgi-bin
> and logs. for testing purposes, i then made the apache directory
> read-only. i run apache from the commandline thus:
>
> $ apache -e debug


You might want to try the "-d <server-root>" option. This should change
the defaults for everything to be relative to the new root you specify.
One thing it could be getting messed up on is the PID file, where it
writes its process ID for apachectl to find it (see the PidFile directive).

If that still doesn't help, you could see what files it is opening using
FILEMON (http://www.sysinternals.com/ntw2k/source/filemon.shtml). If it
is a file permissions issue, FILEMON should be able to pinpoint it
pretty quickly.


--
Jim Patterson
Ottawa, CANADA
jorge

2004-02-25, 11:35 am

I have a cd with apache 2.0.47 on it with php and perl, and it run
fine under 2k and up. but i do have some sneaky triks i use
1. i set apache to use c:\wwwroot as document root, i put all the log,
and pit file in there too.
how o do this?
a vbscirpt, the copies the wwwroot folder from cd to the hd
here is the scitp:
Wscript.Echo "Files are now being copied..."
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.CopyFolder "\server", "c:\server"
Dim o,d
Set oFs = CreateObject ("Scripting.FileSystemObject")
strFolder = "c:\server\apache"
set oDir = oFs.GetFolder(strFolder)
o=0: d=0
ScanAllSubDirs oDir

Sub ScanAllSubDirs (oFolder)
For each oFile in oFolder.files
DimReadOnly oFile
Next
For each oSubFolder in oFolder.subFolders
DimReadOnly oSubFolder
ScanAllSubDirs oSubFolder
Next
End sub

Sub DimReadOnly (ByRef objDat)
o=o+1
If objDat.Attributes MOD 2=1 then
objDat.Attributes = objDat.Attributes-1
d=d+1
End If
End Sub
Wscript.Echo "Installing Apache Services..."
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run("%SystemRoot%\system32\cmd.exe /k
c:\server\apache\bin\apache.exe -D SSL -k install")
WshShell.Run("c:\server\mysql\bin\mysqld-max-nt --install")
Wscript.Echo "Creating Schortcuts..."
Set Shell = CreateObject("WScript.Shell")
DesktopPath = Shell.SpecialFolders("Desktop")
Set link = Shell.CreateShortcut(DesktopPath & "\Start Apache.lnk")
link.Arguments = " -k start"
link.Description = "Start Apache"
link.HotKey = ""
link.IconLocation = "c:\server\apache\bin\apache.exe,0"
link.TargetPath = "c:\server\apache\bin\apache.exe"
link.WindowStyle = 1
link.WorkingDirectory = "c:\server\apache\bin"
link.Save
Set link2 = Shell.CreateShortcut(DesktopPath & "\Stop Apache.lnk")
link2.Arguments = "-k stop"
link2.Description = "Stop Apache"
link2.HotKey = ""
link2.IconLocation = "c:\server\apache\bin\apache.exe,0"
link2.TargetPath = "c:\server\apache\bin\apache.exe"
link2.WindowStyle = 1
link2.WorkingDirectory = "c:\server\apache\bin"
link2.Save
Set link3 = Shell.CreateShortcut(DesktopPath & "\restart Apache.lnk")
link3.Arguments = "-k restart"
link3.Description = "restart Apache"
link3.HotKey = ""
link3.IconLocation = "c:\server\apache\bin\apache.exe,0"
link3.TargetPath = "c:\server\apache\bin\apache.exe"
link3.WindowStyle = 1
link3.WorkingDirectory = "c:\server\apache\bin"
link3.Save
Wscript.Echo "Apache Has been installed!"
Wscript.Echo "Perl is installed to c:\server\perl\bin\perl.exe"
Wscript.Echo "Mysql is installed: root/nopassword"

as you ca see i also install my sql and oter programs
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com