masterio
Sep 22 2006, 02:14 PM
Hi guys, this is a litte tutorial about how we start and stop the Apache and MySQL in Windows NT (2000, XP, 2003) via a batch file script. As we know in Windows NT based system Apache and MySQL installed as Windows Services. So we can stop and start it using NET command. For more information about DOS command, type HELP at command prompt. I assuming that your MySQL service name is "mysql" and your Apache (Apache 2.0.x) service name is "apache2". If you want to chek it click Start > Run > services.msc > OK. Windows IS NOT Case Sensitive. Let's get started!. 1. Open your command prompt by clicking Start > Run > cmd > OK 2. Type edit then press ENTER to start the EDIT program. 3. Type code below CODE @ECHO OFF
if "%1"=="start" goto start_server if "%1"=="stop" goto stop_server if "%1"=="" goto begin
:begin TITLE ::BATCH SCRIPT:: ECHO ---------------------------------------------------------------------------------- ECHO USAGE OF THIS SCRIPT: ECHO server.bat option1 [option2] ECHO WHERE option1 = start/stop (start or stopping server) ECHO option2 = yes/no (close the command prompt or not [optional]) ECHO ----------------------------------------------------------------------------------- goto end
:start_server TITLE ACTIVATING SERVER... ECHO ================================================= ECHO BATCH SCRIPT FOR ACTIVATING SERVER ECHO By Rio Astamal (masterio.trap17.com) ECHO ================================================= ECHO _ ECHO Activating MySQL Service . . . @NET START mysql ECHO _ ECHO Activating Apache HTTP Server Service. . . @NET START apache2 ECHO _ ECHO SERVER HAS BEEN STARTED! DATE /T TIME /T goto end
:stop_server TITLE STOPPING SERVER... ECHO ================================================== ECHO BATCH SCRIPT FOR STOPPING SERVER ECHO By Rio Astamal (masterio.trap17.com ECHO ================================================== ECHO _ ECHO Stopping Apache HTTP Server Service... @NET STOP apache2 ECHO _ ECHO Stopping MySQL Service. . . @NET STOP ECHO SERVER HAS BEEN SHUTTING DOWN! DATE /T TIME /T goto end
:end if "%2"=="yes" ( exit ) To save the file: 1. Press ALT-F > Save 2. Go to your Windows Directory, so we can start it from anywhere in command prompt 3. OK Usage: C:\>server.bat (to show the usage of the script) C:\>server.bat stop yes (close the command prompt after finished the task) C:\>server.bat start EXPLAINATION:If you create a batch file, Anything inside it is assumed as DOS command by command prompt. In that script, first, we make the ECHO command invisible by using @ECHO OFF command. Then we check the argument given by user. %1 is argument 1, %2 is argument 2 and so on. We use first argument(%1) to check what user want. Is he want to stop/start the server. We use argument2 (%2) to check wheter we close the command prompt or not after it. TITLE is used for changing the title of command prompt title bar. For starting service We can use NET START [service_name]. In our script we use @NET START to prevent DOS for echoing the command. For stopping service we can use NET STOP [service_name]. SUMMARYWith a batch file we can do alot of thing not just stop/starting service. But we can use it for renaming many files at once, deleting temporer directory and many more. For more tutorial you can googling!!. ENJOY...! 
Reply
Similar Topics
Keywords : starting, stopping, apache, mysql, server, batch, file
- New Gc Hyip Manager Pro Support Libertyreserve & V-money (decoded Php File) With License [SPAM]
(0)
A Web Server On Lan
(8) Hey friends .. I m new to the forum and would like to ask for help. I have just started writing
script for web pages. I can make fairly good pages using HTML, PHP and for the backend database I
use MySQL. I live in a college hostel and my computer is connected to a LAN having about 300
computers. What I want is to make my web pages available to the LAN users...when I try to do so a
message appears.. u don't have permission to view on this server. I m doing this just for
curiosity and fun. I think this would be quit simple.....I don't know much about netw....
Starting Pitching Market
(0) Lets Take a look at some possible starting pitcher options for the Yankees. Obviously the two big
names this summer are off the market, but lets look at who’s left. Greg Maddux: He isn’t the best
pitcher available but he is doing okay this year with a 3.90 ERA. I really think the Yankees should
get him if he’ll wave his no-trade clause. He probably wont cost as much as other pitchers. He will
also be great with helping out the Young kids. Darrell Rasner and Ian Kennedy are very similar
pitchers to Maddux, and Maddux being one of the smartest pitchers in the game, coul....
Internal File Transfer
(5) Is there some kind of file transfer utility that can be used within the intranet for file
transfers..? We have so much need for such an utility here in my work place.... The problem with
what we are using is very big... we are basically using skype in my workplace and the problem with
that is it happens with the internet... So whenever i transfer files via skype it occupies the
bandwidth.... which is very bad since we have a limited bandwidth connection. So... What i require
is a utility where the transfer happens within the network and not via the internet. So... if ....
Python Server
(1) Hi, i was interested in submitting a wiki engine to the host. The problem is that i was planning to
use moinmoin wiki which is written in pyhon. I would like to know if there is a way to make the host
support this wiki(python)?....
New Runescape Private Server Ham-scape.no-ip.org
(0) ya come to see its a good server and new and it is silab ham-scape.no-ip.org....
Free Software For File Recovery
RECUVA (3) Hi all, I was loking for a software to recover my lost files and I found this /biggrin.gif"
style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> And the best part is ,
its free Recuva - File Recovery Recuva (pronounced "recover") is a freeware Windows utility to
restore files that have been accidentally deleted from your computer. This includes files emptied
from the Recycle bin as well as images and other files that have been deleted by user error from
digital camera memory cards or MP3 players. It will even bring back files that have been d....
Where Is The Bookmarks File Stored With Ff2?
(4) My bookmarks are critical and lengthy. I'd like to save them to a flash drive, since my laptop
is ancient and it's been acting up lately. I went into the FireFox folder, but couldn't find
the bookmarks info anywhere. there's a bookmarks.html page, but it doesn't contain the
actual bookmarks. Where does FF2 store the bookmarks? Or is there an easier way to copy and paste
the bookmarks to another file? /huh.gif" style="vertical-align:middle" emoid=":huh:" border="0"
alt="huh.gif" /> 2 poor 4 a sig ....
How To Make Your Own Counter Strike Source Dedicated Server!
(6) Ok, so you want to host your own CSS Server on your computer eh? Well you will not need a lot of
things, and it is very simple. All you will need is time. /biggrin.gif"
style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> I did this tutorial
myself, from my experience when I made my own CSS Server. This is just a simple tutorial! It
ONLY covers the basics of making a CSS server! Lets Get Started! /laugh.gif"
style="vertical-align:middle" emoid=":lol:" border="0" alt="laugh.gif" /> 1. Download the HLDS
Update Tool from here . 2. On....
Two Lan Ports Problem
cant connect to counter-strike server (2) here....i think i know the problem...but i cant find the solution.... I use windows XP SP 2 ...Asus
motherboard.. I use integrated Ethernet port (NVIDIA nforce controller) to connect to the hostel LAN
and used the same connection to get internet (using proxy). I played counter-strike without any
problem... Everything worked fine until i took a direct ADSL internet connection... So i installed
a separate ethernet card (INTEX rtl8139D) which i use to connect to the internet... So now i have
two LAN ports ...one for internet and one for LAN... The problem is...i cant con....
Database With Mysql++
getting mySQL++ to work with trap17 (7) Hi, I'm trying to build an online game and figured the easiest way to do the server list would
be to make a mySQL database for it; however, I use the con() command on the IP i get from pinging my
website and I always get an abnormal program termination; however, it will work with the mySQL on my
own machine. The code is below: CODE #include <iostream> #include <iomanip>
#include <mysql++> #include "pass.h"//holds my password (i program at
school) int main(void) { Connection con("t3jem3_test","....
I Have Install Windows 2003 Server
I want multiple user to login my server (4) I have install windows 2003 server and some application like iis, share point, etc.my development
time want remote desktop for few user so I want multiple user to login my server but I have not
install active directory and I don’t want to install so tell me the best way to resolved the problem....
Dying In My Sleep?
forcing myself to wake up to avoid my heart from stopping? (22) I went to bed at around 10 am (because i was here on trap cause i'm an addict /laugh.gif"
style="vertical-align:middle" emoid=":lol:" border="0" alt="laugh.gif" />) and i fell asleep with no
problem. I don't know why this happens to me but sometimes when i hear a long beep in my head i
can feel my heart slowing down along with my breaths getting heavier and heavier. When this happens
i open my eyes and try to move but my body doesn't allow me to and my breathing becomes heavier
while i gasp for air. So i try to take deep breaths but it doesn't work so i ....
How Did You Overcome The Fear Of Starting A Business?
(18) Hello, Everyone. I've been wanting to start up my own business for years and finally decided
to take the plunge. I filed a resignation letter to the current company I'm connected with.
However, the more I research, the more overwhelmed I get! I begin to see all the risks and I
start finding myself backing out of my plan. I have always known that starting a business is
risky. However, now more than ever, I find myself obsessing over the risks and getting overwhelmed
by all the things I need to consider (e.g., should i sell online?, apparel or accessories....
Runescape Private Server
How to make your own private server and make runescape cash with it :) (52) First off you need a source: You can download one of these. QUOTE Cheezscape 80 -
http://www.megaupload.com/?d=W8NCP0YC Cheezscape Pk - http://www.megaupload.com/?d=SOK1SPVR
Project 16 V.6 Edit 8 - http://rapidshare.com/files/10028200...DIT_8.rar.html Project 16 v3 -
http://www.megaupload.com/?d=ZFYG6T8B Project 16 Blitz -
http://d.turboupload.com/d/1544978/P16_Blitz.rar.html Project16 V.6 Full Source -
http://files.filefront.com//;5486316;;/ Project16 V.6 Full Source -
http://www.megaupload.com/?d=IAO4H58V Project16 V.6 Full Source - http://rapidshar....
Runescape 2 Private Server Guide: Part 1
making a private server (16) According to RuneScape TOS, as long as your private server does not connect/interfere with the
actual server this 3rd party software is not breaking the real RuneScape TOS. Please use this
information accordingly. If any RuneScape representative feels that this post is against your TOS,
please contact Trap17 admins via PM or email. Thank you. This is part 1, focused on making a
private server and such, if you would like, i will post more on customization in other parts.
Overview: This guide will explain the basics for building your very own rs private server&....
How Do I Make My Own Private Online Server Please Help Me Out.thank You For Your Time.
(22) can someone tell me how to make my very own online private server.Please help me out.This is really
pissing me off since no one will help me out.Thank you for your time.....
Own Server
I would like to create my own server... (9) Howdy, i'm dreaming of an own website(that's why i'm on theis forum..) and I'm
searching for the files to create an own server... I would need to be able top have: PHP Mysql smtp
perl all the other usefull things can somewone help me, i've searched on google, yahoo and
altavista and I didn't find annything! Help me please... Greetz(to all females..I'm
available...) StYn0!....
Qupis : Free Hosting With Php, Mysql, Cpanel. (one Line Text Ad At Bottom)
a member of Xisto (41) Hello Members, We are proud to introduce a new member to Xisto group of sites.
Qupis : Free Web Hosting 150 MB space, 5000 MB Bandwidth, php,
mysql, CPanel (Latest). Emails, FTP, Addon domains, Parked Domains etc.
http://www.Qupis.com
Feel free to add your reviews and comments about it. -Trap17
Management ....
Informix To Sql Server (or How To Open .unl Files)
how to import .unl files into SQL Server 2000 without Informix softwar (2) Does anyone know how to import .unl files into SQLServer 2000? My boss gave me this task to migrate
an old database into SQLServer. I don't have informix installed since the files were sent to me
via email. All files have .unl extension and I don't have a clue how to view them. I've
tried opening them using excel but it can't be read. Does anyone know how to do this? Or at
least know how to open/view the file using excel or any other program that could be easily migrated
to sqlserver? Please, I need to migrate the files as soon as possible. Thanks....
Read File (.txt) On Another Website Using Jsp?
(3) in my jsp program,i need to read a file (.txt) on another website,how can i do this? thanks a lot.
shorten title ....
A Trap17 How-to Guide For Beginners
Something for those who can't get enough of the Trap17 Readme file (12) I am not entirely sure if this the right place to post about this, but here goes anyway... For
those who find themselves slightly (or considerably more than slightly) clueless about where to get
started after getting a hosting account, here is an user guide that might potentially help you
out. I wrote it out of three hours, so forgive me if it's clumsy, but I'm hoping that a few
people here may find it useful. Feedback is greatly appreciated /smile.gif"
style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> I'm planning to build on
a FAQ....
Private Server Ro .
How to create your own private Ragnarok-Online server !!! (157) I saw that there are a lot of people asking for how to create a private Ragnarok-Online server . so
now i decide to make this tutorial to to help these people ... i didn't have a server but my
friend had server and ihelped him to find pros and some tutos so , i learned with him how to create
a server ...stop making introduction ...let's go ... first you have to have minimum
requirements : ----Software :---- i think any windows should work, but i recommend Win Xp i
think you have alredy a Winrar *- Korean Ragnarok client *- Sakray patch (*i recommend the las....
How To Put Music In The Background Of A Powerpoint Presentation
without having the viewer download the music file (9) Well, i made this power poit presentation in memory of my grandfather as many of you kno, passed
away exactly a week ago....and i am trying to get this song to play as background music..and i did,
but there is one humongus problem... in order for the people who are viewing it to hear the
background music they have to download the music file as well ad the powerpoint presentation, which
on my DSL conntection taked almost 2 minutes, and i could just imagine what it will be for a dial-up
user (my grandma who wants to see it)... Some people may say, its impossible, but i kn....
Simple C File Handling In Action
Small code snipet which covers most of basic file handling and navigat (3) Yesterday I suddenly got a lot of work. The same work we try to push off, yes you are right all
formalities to get the code review incorporated and update all source code files with code review
headers. Imagine if you need to open 300 files one by one and append code review headers at the
end. Since most files are reviewed in groups of 20 to 30 files. We require one header to be placed
in say 20 to 30 files. To simplify I went back to my class assignment days and wrote this small c
utility to open all files passed on command line and open attach code review headers an....
Run A Lagg Free Server
(5) Found this article at http://cpnclan.home.comcast.net/ Plagarism. Warning issued. This is a
guide that will explain how to run a lag free game server such as a Counter-Strike: Source server.
Please use this guide at your own RISK!!!! Please leave feedback here. Also- you can
do these tweaks on any computer, even if you don't run a server. All of these tweaks will boost
performance. Specs- I recommend at least a 1.5ghz processor or faster. I also recommend 512 MB of
RAM or more. A Pentium 4 isn't much faster than a Celeron, but a Celeron is fi....
Transfer File Of Any Size Using Winsock Control
Winsock Help (5) This tutorial shows how to transfer file of any size using winsock control. - Open VB; - Select
standard exe; - Press Ctrl + t to show the add component window; - Select winsock control and
microsoft common dialog; - Add one winsock control in the project; - Name it winsock1; - If you want
to add chat then add another winsock and name it winsock2; - Insert another winsock object if you
want to add chat also; - Add a microsoft common dialog box; - Name it cd; - We will use this
winsock1 object to transfer the file and winsock2 for chat; ------------- The basic idea : ....
Import From Excel File Into Mysql Database
(7) Has anyone tried using the excel import function that comes with phpmyadmin
http://www.phpmyadmin.net/home_page/ - it does not require any additional plug-ins or scripts and
is fairly straightforward to use. In phpmyadmin, if you click on the database table which you wish
to import the data to , there is a link on the bottom left corner which says "insert data from a
text file into the table" - although it says text file it still can be used to import an excel file.
When you click on this link you will be taken to a page where you will be asked for the file name
(the....
My File Manager Is Working
(2) I tried to change the html for my site in file manager but it just has the default page - the one
when you activate your site. /sad.gif' border='0' style='vertical-align:middle' alt='sad.gif' />
How do i change files?....
Complete Login System
With PHP + MYSQL (56) Its an complete login sistem made and tested by me and I think itwill be very usefull for people who
are tryn to learn PHP. First, let's make register.php: CODE <?
include("conn.php"); // create a file with all the database connections
if($do_register){ // if the submit button were clicked if((!$name)
|| (!$email) || (!$age) || (!$login) ||
(!$password) || (!$password2)){ print "You can't let
any fields in blank....
Looking for starting, stopping, apache, mysql, server, batch, file
|
|
Searching Video's for starting, stopping, apache, mysql, server, batch, file
|
advertisement
|
|