I did use the Create() method for
Win32::Process to start Apache in the background. Be sure you're using the flags CREATE_NO_WINDOW and DETACHED_PROCESS (or'ed together, like so:
CREATE_NO_WINDOW|DETACHED_PROCESS
so that the whole call looks similar to:
my $apache_obj;
Win32::Process::Create(
$apache_obj,
"\\ws\\server\\Apache\\Apache.exe",
"apache -f $apache_dir\\httpd.conf",
0,
CREATE_NO_WINDOW|DETACHED_PROCESS,
"."
) || die "Starting webserver: $!\n";
There are some other things to think about like how you get the working directory set up, where your Apache config will be, whether it all stays on the CD or if you use a temporary directory, and a few more issues. Using the proper flags should get your process detached and windowless, though. See the
Win32::Process documentation for even more flags. You might want to cross-check those against some Microsoft docs, too, but I don't recall exactly where those docs are.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.