Translate with Google Translate

1.12.2012

how-to start apache on x64 window with a batch script

:: next_line_is_templatized
::File:StartApache.cmd
:: disable the echo
@echo off
 
:: this is part of the name of the file - not used
set Action=start
 
:: which component are we going to start
set Component=apache
 
 
:: the name of the Product next_line_is_templatized
set ProductName=morphus
 
:: the version of the current Product next_line_is_templatized
set ProductVersion=1.1.3
 
:: could be dev , test , dev , prod next_line_is_templatized
set ProductType=dev
 
:: who owns this Product / environment next_line_is_templatized
set ProductOwner=ysg
 
:: identifies an instance of the tool ( new instance for this version could be created by simply changing the owner )     
set EnvironmentName=%ProductName%.%ProductVersion%.%ProductType%.%ProductOwner%
 
:: where the Apache binaries are installed
set ApacheBinDir="C:\Program Files (x86)\Apache Software Foundation\Apache2.2\"
 
:: the full path to the Apache binary
set ApacheBin="C:\Program Files (x86)\Apache Software Foundation\Apache2.2\bin\httpd.exe"
 
:: the full path to the http.conf
set HttpdConf="C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\httpd.conf"
 
:: the full path to the 
set ApacheWorkingDir="C:\Program Files (x86)\Apache Software Foundation\Apache2.2\."
 
 
:: go the run dir
cd %~dp0
 
:: do 4 times going up
for /L %%i in (1,1,5) do pushd ..
 
:: The BaseDir is 4 dirs up than the run dir
set ProductBaseDir=%CD%
:: debug echo BEFORE ProductBaseDir is %ProductBaseDir%
:: remove the trailing \
IF %ProductBaseDir:~-1%==\ SET ProductBaseDir=%ProductBaseDir:~0,-1%
:: debug echo AFTER ProductBaseDir is %ProductBaseDir%
:: debug pause
 
 
:: The version directory of the Product 
set ProductVersionDir=%ProductBaseDir%\%ProductName%\%EnvironmentName%
 
 
:: where the error logs of this call are situated 
set ErrorLog=%ProductVersionDir%\data\log\StartApache.cmd.Error.%ProductName%.cmd.log
 
:: where the running of this 
set RunLog=%ProductVersionDir%\data\log\StartApache.cmd.%ProductName%.cmd.log
 
:: define a favorite editor 
set MyEditor=textpad
 
ECHO Check the variables 
 
:: truncate the run log
echo date is %date% time is %time% > %RunLog%
 
:: truncate the error log
echo date is %date% time is %time% > %ErrorLog%
 
:: uncomment this to debug all the vars 
:: debug set  >> %RunLog%
 
:: go to the Apache bin dir
cd %ApacheBinDir%
 
:: now open the run log
cmd /c start /max %MyEditor% %RunLog%
 
 
:: Action !!!
echo CFPoint1    OK    The run cmd script %0 is executed >> %RunLog%
echo CFPoint2    OK    The run cmd script %0 starts the apache binary with STDOUT and STDERR  to a single RunLog file >> %RunLog%
:: perl %PerlScript% %IniFile% >>%RunLog% 
%ApacheBin% -w -f %HttpdConf% -d %ApacheWorkingDir% >>%RunLog% 2>&1
 
:: open the run log
cmd /c start /max %MyEditor% %RunLog%
 
:: uncomment this line to wait for 5 seconds
:: ping localhost -n 5
 
:: uncomment this line to see what is happening 
:: PAUSE
 
:: Requirements: 
:: This script requires perl , text editor supporting <<textEditor>> <<FileNameToOpen>> cmd call syntax
 
 
:: VersionHistory
:: 0.1.0 --- ysg --- Initial creation copy from run-morphus
 
 

0 comments:

Post a Comment

- the first minus - Comments have to be moderated because of the spammers
- the second minus - I am very lazy at moderating comments ... hardly find time ...
- the third minus - Short links are no good for security ...
- The REAL PLUS : Any critic and positive feedback is better than none, so your comments will be published sooner or later !!!!

Blog Archive

My Blog List

Labels

perl (23) how-to (16) sql server 2008 (12) cmd windows batch (10) mssql (10) sql server 2005 (8) textpad (8) windows (8) Cheat Sheet (7) Unix (7) code generation (7) meta data mssql (7) metadata (7) excel (5) linux (5) tsql (5) utilities (5) energy (4) future (4) programs (4) settings (4) поуки (4) принципи (4) Focus Fusion (3) Solaris (3) cmd (3) cool programs (3) cygwin (3) economy (3) freeware (3) fusion (3) html (3) morphus (3) mssql 2005 (3) nuclear (3) parse (3) perl modules (3) script (3) shortcuts (3) sofware development (3) table (3) .Net (2) C# (2) China (2) Solaris Unix (2) ascii (2) cas (2) cheatsheet (2) columns (2) duplicates (2) example (2) file (2) free programs (2) generic (2) google code (2) logging (2) mssql 2008 (2) mysql (2) next big future (2) nsis (2) prediction (2) release management (2) security (2) sftp (2) sql (2) sqlserver 2005 (2) sqlserver 2008 (2) ssh (2) template (2) tools (2) vba (2) youtube videos (2) BSD license (1) Bulgaria (1) Dallas (1) Database role (1) Dense plasma focus (1) Deployment (1) ERP (1) ExcelToHtml (1) GDP (1) GUI (1) Google (1) GoogleCL (1) Hosting (1) IT general (1) IZarc (1) Java Web Start (1) Khan Academy (1) ListBox (1) MIT HYDROGEN VIRUS (1) OO (1) PowerShell (1) Run-time (1) SIWA (1) Services (1) Stacks (1) SubSonic (1) TED (1) abstractions (1) apache (1) apache 2.2 (1) application life cycle (1) architecture (1) archive (1) arguments (1) avatar (1) awk (1) backup (1) bash (1) bin (1) biofuels (1) biology (1) books (1) browser (1) bubblesort (1) byte (1) cas_sql_dev (1) chennai (1) class (1) claut (1) code generation sqlserver (1) command (1) command line (1) conf (1) configuration (1) console (1) conversion (1) copy-paste (1) csv (1) ctags (1) current local time (1) data (1) debt (1) diagram (1) digital (1) documentation (1) dos (1) dubai (1) e-cars (1) electric cars (1) electricity (1) errors (1) exponents (1) export (1) extract (1) fast export (1) fexp (1) findtag (1) firewall (1) for loop (1) functions (1) fusion research (1) german (1) helsinki (1) history (1) hop or flop (1) ideas (1) java (1) ksh (1) level (1) london (1) me (1) metacolumn (1) metadata functions (1) metaphonre (1) method (1) model (1) movie (1) n900 (1) nano (1) netezza (1) non-password (1) nord pol (1) one-to-many (1) open source (1) openrowset (1) outlook (1) parser (1) password (1) permissions (1) php (1) platform (1) ppm (1) predictions (1) prices (1) principles (1) project (1) prompt (1) proxy account (1) public private key (1) publish (1) publishing (1) putty (1) qt (1) read file (1) registry (1) relationship (1) rm (1) scp (1) sed (1) sh (1) silicon (1) sofware (1) sort (1) sql script (1) sql_dev (1) sqlcmd (1) sqlite (1) sqlite3 (1) src (1) sshd (1) stored procedure (1) stupidity (1) svn (1) sysinternals (1) tar (1) temp table (1) templates (1) teradata (1) terminal (1) test (1) theory (1) thorium (1) time (1) tip (1) tool (1) user (1) utils (1) vb (1) warsaw (1) wikipedia (1) windows programs (1) windows reinstall (1) wisdoms (1) worth-reading (1) xp_cmdshell (1) youtube (1)

Video Bar

Loading...

Search This Blog

Loading...