BuildDeploy.bat

 cscript /nologo c:\Utils\stopjboss.vbs

 set JBOSS_DEPLOYMENT=c:\jboss\standalone\deployments
 set DEVELOPMENT_HOME=c:\projectName
 set BRANCH=BranchName\ReleaseNo
 
 del /q %JBOSS_DEPLOYMENT%\*.*
 cd %DEVELOPMENT_HOME%\%BRANCH%
 
 call mvn clean
 call mvn install -o
 
 IF EXISTS  %DEVELOPMENT_HOME%\%BRANCH%\SpringMVC.war (
  goto :startServer
 ) else (
  echo Build Failed
 )

 exit /b

:startServer
 copy %DEVELOPMENT_HOME%\%BRANCH%\SpringMVC.war %JBOSS_DEPLOYMENT%
 cscript /nologo c:\Utils\startjboss.vbs
goto :eof

startjboss.vbs

 Set WshShell = WScript.CreateObject("WScript.Shell")
 activateServer("Server")
 WshShell.SendKeys "%{d}"

 Function activateServer(windowName)
   WshShell.SendKeys "^{3}"
   WScript.Sleep 500
   WshShell.SendKeys windowName
   WScript.Sleep 500
   WshShell.SendKeys "{ENTER}"
 End Function

stopjboss.vbs

 Set WshShell = WScript.CreateObject("WScript.Shell")
 activateServer("Server")
 WshShell.SendKeys "%{s}"
 WScript.Sleep 5000

How it Works

  • We are using a VBScript to Start and Stop server by Sending Key Strokes to Eclipse(Shortcut Keys)
  • The mvn clean and mvn install is done in 2 different steps to make sure that clean of the war files happen before the new file is created since executing clean and install in single shot happened to give inconsistent results
  • Once the build is done we are checking whether the war file is created or we are assuming the build failed and we are not starting the server
  • The builddeploy.bat should be configured in External Tools Configuration
  • Workdirectory is the one which has pom.xml of the project
  • Assign a shortcut key to Run Last Run Build Configuration

In linux there the file access is based under three categories

 CurrentUser - Users in Group - Other Users
  drwxr-xr-x 


drwxr – CurrentUser can read, write and execute
xr – Users in Group can read and execute
x – Users can execute

 >>ls -l
-rw-r--r-- 1 root root    0 Apr 14 17:19 test.txt 

The test.txt file has only Read and Write access (rw) for Current User – Read access for Users in Group – Read access for other Users

 >>chmod u+x test.txt

Now the test.txt file has Execute access along with Read and Write as below

 >>ls -l
-rwxr--r-- 1 root root    0 Apr 14 17:19 test.txt

Giving Read wrtite to Group

 >>chmod g+r test.txt

Giving read right to Current User, Group Users and Other Users

 >>chmod a+r test.txt

Giving Execute right to Other Users

 >>chmod o+x test.txt

rwx – 111 7
r-x – 101 5
rw- – 110 6
rw- – 101 4
-wx – 011 3
-w- – 010 2
–x – 001 1
– 000 0

Example of binary format

 >>chmod 752  test.txt

Current User can rwx
Group User can r-x
Other User can -w-

Giving Multiple Permission for Multiple User Types at Once

 >>chmod u+r, o+x test.txt

How folders are organized
when you enter terminal the default location it takes is the location of the folder of the current user which
comes under /home/mugil(user logged In)

How to Login as a Root User

>> su
Password:

R
Logout of Root User

>> exit

Current Working Directory

>> pwd

Navigate Backward

>> cd ..
>> cd ../..

Navigate Forward

>> cd home/mugil

Home Directory

>> cd ~

Equivalent to Microsoft User Directory i.e My Documents

How to reset admin password

>> sudo passwd

How to Find Directory Files info

>> ls -l

Touch- Creates a Time Stamp

>> touch test.txt

If the file does not exist it creates new once else it updates just the time

Make new Directory

>> mkdir NewFolder

Moving File within folder that exist

>> mv test.txt NewFolder/

Copying File within folder that exist
Copies test.txt to NewFolder

>> cp test.txt NewFolder/

Copies test.txt to one folder above

>> cp test.txt ..

Deleting File that exist

>> rm test.txt 

Deleting File in folder that is not empty
-r recursive

>> rm -r NewFolder/

After installing apache in CentOS it would go to Apache 2 Test Page.

To locate this directory you need to go to /var/www/
In this directory you can create your file which you needs to run.

To set up Virtual Host navigate to /etc/httpd/conf/httpd.conf file

Open the file in gedit or editor of your preference.

Add the lines below

<VirtualHost *:80>
   DocumentRoot /var/www/sample/
   ServerName virtualhost1
</VirtualHost>

The document root points out to sample older in www directory

The server name is virtual host name you type in URL

You should also add the code in /etc/hosts file

127.0.0.1    virtualhost1

 

Once this is done dont forget to restart apache server in terminal by typing service httpd.restart

Now you are ready to go now.Open the browser and type http://virtualhost1/

Cheers!!!