[ Index ] |
|
Code source de vtiger CRM 5.0.2 |
1 echo off 2 set mysql_dir=MYSQLINSTALLDIR 3 set mysql_username=MYSQLUSERNAME 4 set mysql_password=MYSQLPASSWORD 5 set mysql_port=MYSQLPORT 6 set mysql_bundled=MYSQLBUNDLEDSTATUS 7 set apache_dir=APACHEINSTALLDIR 8 set apache_bin=APACHEBIN 9 set apache_conf=APACHECONF 10 set apache_port=APACHEPORT 11 set apache_bundled=APACHEBUNDLED 12 set apache_service=APACHESERVICE 13 14 15 echo %WINDIR% 16 set FIND_STR="%WINDIR%\system32\findstr.exe" 17 set SLEEP_STR="%WINDIR%\system32\ping.exe" 18 goto initiate 19 20 :initiate 21 rem if true means , vtiger crm mysql is being used 22 if "test" == "%1test" goto start1 23 set VTIGER_HOME=%1 24 goto start2 25 26 :start1 27 cd .. 28 set VTIGER_HOME=%cd% 29 :start2 30 31 if %apache_bundled% == true goto checkBundledApache 32 if %apache_bundled% == false goto checkUserApache 33 34 :checkBundledApache 35 echo "APACHEBUNDLED" 36 cd /d %apache_dir% 37 if %apache_service% == true goto StartApacheService 38 start bin\Apache -f conf\httpd.conf 39 IF ERRORLEVEL 1 goto stopservice 40 goto checkmysql 41 42 :StartApacheService 43 echo "" 44 echo "making an attempt to kill any existing vtigercrm service" 45 echo "" 46 bin\apache -k stop -n vtigercrm501 47 bin\apache -k uninstall -n vtigercrm501 48 echo "Uninstalling apache service again for confirmation after sleeping for 10 seconds" 49 echo "" 50 %SLEEP_STR% -n 10 127.0.0.1>nul 51 bin\apache -k stop -n vtigercrm501 52 bin\apache -k uninstall -n vtigercrm501 53 echo "" 54 echo "" 55 echo "Installing vtigercrm501 apache service after sleeping for 10 seconds" 56 echo "" 57 %SLEEP_STR% -n 10 127.0.0.1>nul 58 bin\apache -k install -n vtigercrm501 -f conf\httpd.conf 59 echo "" 60 echo "Starting vtigercrm501 apache service" 61 echo "" 62 bin\apache -n vtigercrm501 -k start 63 IF ERRORLEVEL 1 goto stopservice 64 goto checkmysql 65 66 :checkUserApache 67 netstat -anp tcp >port.txt 68 %FIND_STR% "\<%apache_port%\>" port.txt 69 if ERRORLEVEL 1 goto apachenotrunning 70 %FIND_STR% "\<%apache_port%\>" port.txt >list.txt 71 %FIND_STR% "LISTEN.*" list.txt 72 if ERRORLEVEL 1 goto apachenotrunning 73 echo "" 74 echo "Apache is running" 75 echo "" 76 goto checkmysql 77 78 :apachenotrunning 79 echo "" 80 echo "" 81 echo "Apache in the location %apache_dir% is not running. Start Apache and then start vtiger crm" 82 echo "" 83 echo "" 84 set /p pt=Press Any Key to Continue... 85 goto end 86 87 :checkmysql 88 cd /d %mysql_dir%\bin 89 echo %cd% 90 91 echo "" 92 echo "Checking the whether the MySQL server is already running" 93 echo "" 94 mysql --port=%mysql_port% --user=%mysql_username% --password=%mysql_password% -e "show databases" > NUL 95 IF ERRORLEVEL 1 goto startmysql 96 echo "" 97 echo "" 98 ECHO "MySQL is already started and running" 99 echo "" 100 echo "" 101 goto checkdatabase 102 103 104 :startmysql 105 echo "" 106 echo "Starting MySQL on port specified by the user" 107 echo "" 108 start mysqld-nt -b .. --skip-bdb --log-queries-not-using-indexes --log-slow-admin-statements --log-error --low-priority-updates --log-slow-queries=vtslowquery.log --datadir=../data --port=%mysql_port% 109 %SLEEP_STR% -n 11 127.0.0.1>nul 110 mysql --port=%mysql_port% --user=%mysql_username% --password=%mysql_password% -e "show databases" > NUL 111 IF ERRORLEVEL 1 goto notstarted 112 echo "" 113 echo "Started MySQL on port specified by the user" 114 echo "" 115 goto checkdatabase 116 117 118 :checkdatabase 119 echo "" 120 echo "check to see if vtigercrm501 database already exists" 121 echo "" 122 mysql --port=%mysql_port% --user=%mysql_username% --password=%mysql_password% -e "show databases like 'vtigercrm501'" | "%WINDIR%\system32\find.exe" "vtigercrm501" > NUL 123 IF ERRORLEVEL 1 goto dbnotexists 124 echo "" 125 ECHO "vtigercrm501 database exists" 126 echo "" 127 goto end 128 129 130 :dbnotexists 131 echo "" 132 ECHO "vtigercrm501 database does not exist" 133 echo "" 134 echo %cd% 135 echo "" 136 echo "Proceeding to create database vtigercrm501 and populate the same" 137 echo "" 138 mysql --user=%mysql_username% --password=%mysql_password% --port=%mysql_port% -e "create database if not exists vtigercrm501" 139 echo "" 140 echo "vtigercrm501 database created" 141 echo "" 142 goto end 143 144 :notstarted 145 echo "" 146 echo "" 147 ECHO "Unable to start the MySQL server at port %mysql_port%. Check if the port is free" 148 echo "" 149 echo "" 150 set /p pt=Press Any Key to Continue... 151 goto end 152 153 :stopservice 154 echo "" 155 echo "" 156 echo "" 157 echo "********* Service not started as port # %apache_port% occupied ******* " 158 echo "" 159 echo "" 160 echo "" 161 echo "" 162 echo "********* I am sorry. I am not able to start the product as the apache port that you have specified: port # %apache_port% seems to be occupied ******* " 163 echo "" 164 echo "" 165 echo "You could give me a different port number if you wish by doing the following ...." 166 echo "" 167 echo "" 168 echo "********* Open the apache/conf/httpd.conf file, search for 'Listen' and change the port number ******* " 169 echo "" 170 echo "" 171 echo "" 172 echo "" 173 echo "********* Change the apache port in startvTiger.bat and stopvTiger.bat too and then access the product from the browser in the following manner http://localhost:apacheport******* " 174 echo "" 175 echo "" 176 echo "Thank You" 177 echo "" 178 echo "" 179 set /p pt=Press Any Key to Continue... 180 goto end 181 182 183 :end 184 cd /d %VTIGER_HOME%\bin 185 186
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 10:22:19 2007 | par Balluche grâce à PHPXref 0.7 |