Starten Apache + Mysql

Pagina: 1
Acties:

  • _DeWie_
  • Registratie: November 2001
  • Laatst online: 10-04 16:23
Voor een applicatie wil ik op de pc van de gebruiker apache + mysql starten.
(de installatie van apache + mysql = vast,
sorry OS = WIN, en kent dus geen apachectl)

In de testfase moeten gebruikers nog eerst apache starten, en mysql starten.
(het verveldende hiervan is dat je 2 dosvesnters open houd)

Want ik graag zou willen is het volgende:

Er wordt een script opgestart (perl), deze :
1) start apache op
2) start mysql op
3) start een htmlpagina op

Het zou helemaal mooi zijn als op het moment dat 3) afgesloten wordt automatisch 1 + 2 worden gestopt.

Heeft iemand enig idee hoe dit te realiseren.

  • SchizoDuckie
  • Registratie: April 2001
  • Laatst online: 18-02-2025

SchizoDuckie

Kwaak

[search=apachectl]

Stop uploading passwords to Github!


Verwijderd

Op vrijdag 19 juli 2002 08:29 schreef _DeWie_ het volgende:

sorry OS = WIN, en kent dus geen apachectl)
Op vrijdag 19 juli 2002 08:50 schreef Papa Eend het volgende:
[search=apachectl]
hmmmzz :?

  • Tux
  • Registratie: Augustus 2001
  • Laatst online: 06:49

Tux

Wat voor Windows versie draait er op de clients?

Als je namelijk NT/2000/XP draait dan kan je ze gewoon als een service draaien.

The NS has launched a new space transportation service, using German trains which were upgraded into spaceships.


  • _DeWie_
  • Registratie: November 2001
  • Laatst online: 10-04 16:23
Service kan dus eigenlijk niet.
Werkt volgens mij niet op alle versies.
en ik wil geen software installeren.
Je zult door middel van de andere programma's het op moeten starten.

Maar als ik bijvoorbeeld :

[perl] system "/apache/apache.exe"

Krijg ik evengoed die lelijke doswindow en dat wil ik niet.
Vandaar.

Verwijderd

code:
1
2
3
4
5
6
7
#!c:\perl\bin\perl.exe

use Win32::GUI;
$hwnd = GUI::GetPerlWindow();
GUI::Hide($hwnd);

system "C:\\progra~1\\apache~1\\apache\\apache.exe";

Zo is ie bij mij toch echt wel weg :). Let wel ff op dat je een handler maakt waardoor alles netjes te beeindigen is, bijvoorbeeld met een trayicon...

  • Tux
  • Registratie: Augustus 2001
  • Laatst online: 06:49

Tux

Je kan toch ook de opstartcommando's in je autoexec.bat gooien (tenminste als de gebruikers win9x gebruiken)

The NS has launched a new space transportation service, using German trains which were upgraded into spaceships.


  • _DeWie_
  • Registratie: November 2001
  • Laatst online: 10-04 16:23
Heb het inmiddels mede dankzij lennert2002 aan de praat.
Voor de geinstreseerden :
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
use Win32;
use Config::IniFiles;
use Win32::Registry;
use Proc::Background;
use Win32::Process;
use Win32::GUI;

$hwnd = GUI::GetPerlWindow();
GUI::Hide($hwnd);

# INI
my $CONF = new Config::IniFiles( -file => "settings.ini" );

#starten van mysql
if ($CONF->val("options","startMysql") eq "1")
{
my $procMysqlStart = Proc::Background->new($CONF->val("mysql","start"),,);
#mysql heeft even de tijd nodig :)
sleep(2);
}

# starten van Apache
if ($CONF->val("options","startApache") eq "1")
{
my $procApacheStart = Proc::Background->new($CONF->val("apache","start"),,);
}

# ophalen van de browser
    my $htmlclass_regobj;
    my $htmlclass_name;
    $HKEY_CLASSES_ROOT->Open( '.html', $htmlclass_regobj ) ||
        ErrorQuit( Win32::FormatMessage( Win32::GetLastError() ) );
    $htmlclass_regobj->QueryValue( '', $htmlclass_name ) ||
        ErrorQuit( Win32::FormatMessage( Win32::GetLastError() ) );
    $htmlclass_regobj->Close();

    # Sommige browsers hebben een \0s
    $htmlclass_name =~ s/\0.*//;

    my $value;
    $HKEY_CLASSES_ROOT->Open( "$htmlclass_name\\Shell\\Open\\Command", $htmlclass_regobj ) ||
        ErrorQuit( Win32::FormatMessage( Win32::GetLastError() ) );
    $htmlclass_regobj->QueryValue( '', $value ) ||
        ErrorQuit( Win32::FormatMessage( Win32::GetLastError() ) );
    $htmlclass_regobj->Close();

    my ($command, $args);
    if( $value =~ /^"(.*?)"\s*(.*)/ or $value =~ /([^\s]+)\s*(.*)/ )
    {
      ($command, $args) = ($1, $2);
    }

    $command =~ s/"//g;

# ophalen van de browser
my $procWeb = Proc::Background->new($command, $CONF->val("options","defaultHTTP"),);

# lus voor het afvangen van het sluiten van de browser
while (1)
{
  if (!$procWeb->alive())
  {
    if ($CONF->val("options","startApache") eq "1")
    {
    my $procApacheStop = Proc::Background->new($CONF->val("apache","stop"),,);
    }
    if ($CONF->val("options","startMysql") eq "1")
    {
    my $procMysqlStop = Proc::Background->new($CONF->val("mysql","stop"),,);
    }
    exit();
  }
  sleep(2);
}
Pagina: 1