Showing posts with label server. Show all posts
Showing posts with label server. Show all posts

Maven Installation

 Search Maven package  
 apt-cache search maven  

 Install it  
 sudo apt-get install maven  

 Verification  
 mvn -version  

 Where is Maven installed  
 The command apt-get install the Maven in /usr/share/maven  
 The Maven configuration files are stored in /etc/maven  

Installation of Tomcat7 : using port 80

 Installation Tomcat using apt-get  
 sudo apt-get install tomcat7  

 Install the package using apt-get  
 sudo apt-get install tomcat7-docs  
 sudo apt-get install tomcat7-examples  
 sudo apt-get install tomcat7-admin  

 The above instruction is more than enough to install the tomcat. If any error happened please follow the below the instructions.  
 Setup the JDK path for Tomcat   
 sudo nano /etc/default/tomcat7 : add the JDK path inside the file  
 Set the path   
 sudo nano ~/.bashrc  
 export CATALINA_HOME=/usr/share/tomcat7  

 Stop Server:  
 sudo /etc/init.d/tomcat7 stop  

 Start Server:  
 sudo /etc/init.d/tomcat7 start  

 Folder locations of tomcat :  
 Tomcat bin and lib file location :  
 /usr/share/tomcat7  

 Tomcat xml file :  
 /etc/tomcat7  

 Tomcat config and webapp files:  
 /var/lib/tomcat7/  

 Tomcat JDK and Path Setup   
 sudo nano /etc/default/tomcat7  

 To Run Tomcat on port 80  
 <Connector port="8080" protocol="HTTP/1.1"  
 connectionTimeout="20000" redirectPort=  
 "8443" />  
 Change 8080 to 80 in /config/server.xml file  
  AND  

 Remove the comment using :  
 sudo nano /etc/default/tomcat7 and   
 change #AUTHBIND=no  
 as AUTHBIND=yes  

 To remove all the files   
 sudo apt-get purge libtomcat7-java tomcat6 tomcat6-admin tomcat6-docs tomcat6-examples tomcat7 tomcat7-admin tomcat7-common tomcat7-docs tomcat7-examples tomcat7-user  
 To check what are the process running on port 80  
 netstat -tulpn | grep :80  
 Server.XML user name and password  
 <role rolename="manager-gui"/>  
 <user username="Dhanu" password="" roles="manager-gui"/>  
 <role rolename="admin-gui"/>  
 <user username="Dhanu" password="" roles="admin-gui"/> 
 
 NOTE:  
 Change the Heap memory in tomcat :  
 sudo nano /etc/default/tomcat7 and change the line on -Xms value  
 JAVA_OPTS="-Djava.awt.headless=true -Xmx2048m -XX:+UseConcMarkSweepGC"  
 In Default It’s limited to 128MB.   

Deployment of Apache Tomcat 7 in Amazon server


 Before Installation Check your java Jdk installed or not.  
 Step 1:  
 Download the Apache tomcat 7 from the bellow link,  
 Step2:  
 md5sum apache-tomcat-[#].tar.gz  
 Next, extract the package:  
 tar xvzf apache-tomcat-[#].tar.gz  
 And move the extracted folder into a dedicated directory:  
 sudo mv apache-tomcat-[#] /usr/local/apache  
 Step3: Set the path   
 vi ~/.bashrc  
 export CATALINA_HOME=/usr/local/apache  
 Log out and log back into bash to have your changes take effect.  
 Step4: Start tomcat  
 sudo /usr/local/apache/bin/startup.sh  
 Step 5 : Check  
 Go to web browser and type ,  
 http://localhost:8080  

Deployment of Glassfish In amazon server

GlassFish is an open-source application server project started by Sun Microsystems for the Java EE platform and now sponsored by Oracle Corporation. The supported version is called Oracle GlassFish Server. GlassFish is free software, dual-licensed under two free software licences: the Common Development and Distribution License (CDDL) and the GNU General Public License (GPL) with the classpath exception.

GlassFish is the reference implementation of Java EE and as such supports Enterprise JavaBeans, JPA, JavaServer Faces, JMS, RMI, JavaServer Pages, servlets, etc. This allows developers to create enterprise applications that are portable and scalable, and that integrate with legacy technologies. Optional components can also be installed for additional services.




 Step 1:   
 Connect the Amazon server through terminal using DNS and the KEY.  
 To connect with amazon server:  
 ssh -i <key_path> <username>@<ip_adress_server>  
 First of all we need to check the java dependencies.  
 sudo apt-get update  
 sudo apt-get remove openjdk-6-jre-headless  
 sudo apt-get install sun-java6-jdk sun-java6-jre sun-java6-javadb  
 sudo apt-get autoremove  
 Step 2:  
 go to terminal in Ubuntu  
 go to your home directory in terminal   
 enter wget http://download.java.net/glassfish/4.0/release/glassfish-4.0.zip to download the glassfish in to your server.  
 Step 3:  
 Configure and change default port for Glassfish if tomcat already use port 8080.Because usually it use the port 4848.If you need as default please avoid thid Step 3.  
 vim glassfishv3/glassfish/domains/domain1/config/domain.xml  
 <network-listeners>  
 <network-listener port="8081" protocol="http-listener-1" transport="tcp" name="http-listener-1" thread-pool="http-thread-pool" />  
 <network-listener port="8181" protocol="http-listener-2" transport="tcp" name="http-listener-2" thread-pool="http-thread-pool" />  
 <network-listener port="4848" protocol="admin-listener" transport="tcp" name="admin-listener" thread-pool="http-thread-pool" />  
 </network-listeners>  
 Step 4:  
 Running by Glassfish  
 ./glassfishv3/glassfish/bin/asadmin start-domain --verbose  
 Step5:  
 Go to your-domain:8081 to see web page and your-domain:4848 for administrator pages  
 Glassfish Controls :  
 Create domain  
 Start and Stop Domain  
 Delete Domain  
 Enable secure Admin  

 Error may occur:  
 Solution:  
 http://charleech.wordpress.com/2012/03/23/glassfish-version-3-1-2-secure-admin-must-be-enabled-to-access-the-das-remotely/  
 http://coders-kitchen.com/tag/secure-admin-must-be-enabled-to-access-the-das-remotely/