Monday, June 9, 2008

FILE .BAT UNTUK STARTUP DALAM UNISERVER

REDIRECT DALAM UNISERVER

Berbeda dengan Xampp atau AppServ yang bisa diseting agar webserver otomatis berjalan saat komputer dinyalakan, pada UniformServer ato Uni server ini kita harus menyalakan webserver dengan cara menjalankan sebuah file .bat (Server_Start.bat). File ini letaknya di dalam folder Uniform Server. Dengan double klik file tersebut (ato shorcut-nya) maka akan dijalankan perintah-perintah yang terdapat dalam file tersebut.


Isi dari file tersebut adalah seperti dibawah ini..


: Name: Start Server File

: Created By: The Uniform Server Development Team

: Edited Last By: Olajide Olaolorun (empirex)

: Comment: After start, go to apanel directly.

: To Developers: Implemented %www%, and %apanel% :)


@echo off


rem use: start mysql console - to start mysql at server start and display console

rem use: start mysql - to start mysql at server start

rem use: start nomysql console - to display console


udrive\home\admin\program\pskill.exe Apache.exe


if errorlevel 2 goto :PAUSE


if not errorlevel 1 goto :STARTED


set Disk=%1


if "%Disk%"=="" set Disk=w


rem create the disk

subst %Disk%: "udrive"


if errorlevel 1 goto :HINT

set apachepath=\usr\local\apache2\

set apacheit=%Disk%:%apachepath%bin\Apache.exe -f %apachepath%conf\httpd.conf -d %apachepath%.

set programit=%Disk%:\home\admin\program\

set closeit=%programit%close.bat %Disk%


%Disk%:

cd \usr\local\php

start \usr\local\mysql\bin\mysqld-opt.exe --defaults-file=/usr/local/mysql/bin/my-small.cnf

CLS

echo The server is working on the disk %Disk%:\ [http/127.0.0.1/apanel/]

set www=\www\

set apanel=\home\admin\www\

start %apanel%\redirect.html


if "%3"=="console" goto :CONSOLE

start %programit%uniserv.exe "%apacheit%" "%closeit%"

goto :END


:CONSOLE

%apacheit%

%closeit%

goto :END


:HINT

CLS

echo The disk %Disk% is busy. Use start.bat [disk letter]

goto :PAUSE


:STARTED

CLS

echo ERROR!!!

echo One of the instances of Apache server is started. Use stop.bat


:PAUSE

:echo .

:pause


:END



Pada intinya perintah yang ada dalam file ini digunakan untuk menyalakan Apache, dan MySQL. Membuat sebuah partisi baru dalam harddisk dan meredirect ke halaman tertentu.

No comments: