0% found this document useful (0 votes)
153 views7 pages

Centos Conf

The document provides instructions for installing Java, Tomcat, and MySQL on a CentOS server and deploying a WAR file. It includes steps to download packages, configure environment variables, start services, test functionality, copy files between servers, and migrate a database. Key steps are: 1) Downloading and installing Java, Tomcat, and MySQL packages and setting related environment variables. 2) Copying the WAR file to the server, configuring Tomcat, and deploying the WAR file. 3) Migrating code, templates, properties files, and databases between servers.

Uploaded by

Shine Sam Shine
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
153 views7 pages

Centos Conf

The document provides instructions for installing Java, Tomcat, and MySQL on a CentOS server and deploying a WAR file. It includes steps to download packages, configure environment variables, start services, test functionality, copy files between servers, and migrate a database. Key steps are: 1) Downloading and installing Java, Tomcat, and MySQL packages and setting related environment variables. 2) Copying the WAR file to the server, configuring Tomcat, and deploying the WAR file. 3) Migrating code, templates, properties files, and databases between servers.

Uploaded by

Shine Sam Shine
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

1. install java a. insatll steps http://java.sun.com/javase/6/webnotes/install/jdk/install-linux.html#install-rpm b, download link https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US//USD/ViewFilteredProducts-SingleVariationTypeFilter c. command to be executed wget http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US//USD/VerifyItem-Start/jdk-6u11-linux-i586rpm.bin?BundledLineItemUUID=LZRIBe.lFxIAAAEfJn0mbQIt&OrderID=839IBe.l0OMAAAEfGX0 mbQIt&ProductID=abtIBe.ovJUAAAEdeDBGb7Et&FileName=/jdk-6u11-linux-i586-rpm.bin d.

run commands
chmod a+x jdk-6<version>-linux-i586-rpm.bin

./jdk-6<version>-linux-i586-rpm.bin

2. tomcat help http://linux-sxs.org/internet_serving/c140.html#DOWNLOAD http://edipage.wordpress.com/2008/09/22/install-sun-java-and-tomcat-on-centos-5/ a. downlaod tomcat http://tomcat.apache.org/download-60.cgi wget http://www.archicentral.com/mirrors/apache/tomcat/tomcat-6/v6.0.18/bin/apache-tomcat6.0.18.tar.gz b. coipy to installing position mkdir tomcat ............. under /usr/local

mv apache-tomcat-6.0.18.tar.gz /usr/local/tomcat

c. unzip the gz file. tar -zxvf apache-tomcat-6.0.18.tar.gz d create symbolic link ... not necessary .ln -s apache-tomcat-6.0.18 tomcat e.set env varibale export CATALINA_HOME=/usr/local/tomcat/tomcat export TOMCAT_HOME=$CATALINA_HOME export JRE_HOME=/usr/java/jdk1.6.0_11/jre export JAVA_HOME=/usr/java/jdk1.6.0_11 export NH_ENV="staging" cd ~ there is 4 file for bash name .bash_history .bash_logout .bash_profile .bashrc vi .bashrc. Make entry written above in this file. Or edit vi /etc/profile and then add all varibales and then run cmn source /etc/profile e. start the server , in usr/local/tomcat/tomcat/bin/startup.sh f: test by seing logs as well as asccessign web page at disable firewall : /usr/bin/system-config-securitylevel-tui (help http://www.crucialp.com/blog/2008/11/17/how-to-disable-firewall-or-selinux-in-centos-5/) http://192.168.0.225:8080/

For logs : tail -f -n 50 /usr/local/tomcat/tomcat/logs/catalina.out /usr/local/tomcat/tomcat/logs /usr/local/tomcat/tomcat/webapp/ /usr/local/tomcat/tomcat/bin 3. copy thc war file from build server to the machine and deploy it to tomcat scp [email protected]:/home/build/current_build/nethaggler/home/target/haggler-home0.0.1.war /root/webapp/home.war copy this file from this location under tomcat/webapp cp home.war /usr/local/tomcat/tomcat/webapps/ 3.1 User conf folder .. configure connection pooling for database. context.xml <!-- The contents of this file will be loaded for each web application --> <Context> <Resource name="jdbc/production_nethaggler" auth="Container" type="javax.sql.DataSource" username="Haggler" password="n3tzoo8" driverClassName="com.mysql.jdbc.Driver" maxWait="5000" url="jdbc:mysql://66.79.162.6:3306/production_haggle" maxActive="-1" maxIdle="2" /> <Resource name="jdbc/staging_nethaggler" auth="Container" type="javax.sql.DataSource" username="Haggler" password="n3tzoo8" driverClassName="com.mysql.jdbc.Driver" maxWait="5000" url="jdbc:mysql://66.79.162.6:3306/staging_haggle" maxActive="-1" maxIdle="2" /> <!-- Default set of monitored resources --> <WatchedResource>WEB-INF/web.xml</WatchedResource> <!-- Uncomment this to disable session persistence across Tomcat restarts --> <!-<Manager pathname="" /> --> <!-- Uncomment this to enable Comet connection tacking (provides events on session expiration as well as webapp lifecycle) --> <!-deploy it.

<Valve className="org.apache.catalina.valves.CometConnectionManagerValve" /> --> </Context> server.xml add two things . a.<Context path="" docBase="home" > </Context> b. for all <Connector change port 8080 to 80

3.2 send all required jars from server1 to new server and copy it in tomcat/lib copy mysql-connector-java-3.1.13-bin.jar into tomcat/lib directory scp [email protected]:/usr/local/apache-tomcat-6.0.14/lib/mysql-connector-java-3.1.13bin.jar /root/webapps/jars cp mysql-connector-java-3.1.13-bin.jar /usr/local/tomcat/tomcat/lib 3.3 now u can open nh wonly with ip address.. http://192.168.0.225/ 3.4 u may require to make an entry in etc.hosts 64.29.178.139 feed.linksynergy.com 63.123.248.17 aftp.linksynergy.com 3.4: to copy vendor resource scp vendor.properties [email protected]://usr/local/apache-tomcat-6.0.14/webapps/home/resource Errors for web SEVERE: Catalina.start: LifecycleException: service.getName(): "Catalina"; Protocol handler start failed: java.net.BindException: Address already in use<null>:80

solution : telnet <host> <port> netstat -l -n -p |grep 80 : to see process on port 80 /etc/init.d/httpd stop 3.5 shift all email templates :
Create directory under /home/ with root as user with name batch@localhost:/home/nethagglerScripts> scp *.* [email protected]:/home/nethagglerScripts/ nethagglerScripts.

localhost:/home/nethagglerScripts/NagOfferProcessor/configFiles # scp *.* [email protected]:/home/nethagglerScripts/NagOfferProcessor/configFiles/

Shifting database :

1. get the database stucture dump for production server. And upload the dump 2. Some table needs to have preinitialized data ,.. they are vendor; vendor_cj_map; nag_vendor; vendor_performics_map; vendor_linkshare_map; create an user with id 0 with following information. UPDATE `user` SET `EMAIL_ADDRESS`='[email protected]',`FIRST_NAME`='Steve',`PASSWORD`='111111',`D ATE_CREATED`='2009-02-24 05:02:32' WHERE `ID`=0 3. change the tomcat/conf/context.xml file to use new db system Installing mysql 1. As rpm .i386 : http://www.thegeekstuff.com/2008/07/howto-install-mysql-onlinux/http://www.idevelopment.info/data/MySQL/DBA_tips/Installing/LINUX4020_3.shtml 2 As tar http://www.washington.edu/computing/web/publishing/mysql-install.html a. Link to get the rpm for mysql server : http://dev.mysql.com/downloads/mysql/5.0.html#linux-rhel5x86-32bit-rpms

wget http://dev.mysql.com/get/Downloads/MySQL-5.0/MySQL-server-community-5.0.670.rhel5.i386.rpm/from/http://mirror.switch.ch/ftp/mirror/mysql/ b.link to get mysql client wget http://dev.mysql.com/get/Downloads/MySQL-5.0/MySQL-client-community-5.0.670.rhel5.i386.rpm/from/http://mirror.switch.ch/ftp/mirror/mysql/ 3 Remove the existing default MySQL that came with the Linux distribution
to find insatlled version rpm -qa | grep -i mysql

rpm -e mysql-5.0.45-7.el5.i386 --nodeps .better dont use nodeps : remove the dependent software in reverse order. 4 install both rpm : rpm -ivh MySQL-server-community-5.0.67-0.rhel5.i386.rpm MySQL-client-community-5.0.670.rhel5.i386.rpm 5. /usr/bin/mysqladmin -u root password 'root';
6. now u can acees mysql; Create a database and dump the mysql back up; source ./bakcupNAme.sql grant all on *.* to root@'%' identified by 'root'; now intilized the required table with data. Preintilize can be done after taking required table data from back up and feeding it.

Moving batch. 1. create deploy batch at centos. 2. move all sh from server1 to batch. 3. create all mailing template user . Create directory under /home/ with root as user with name nethagglerScripts. batch@localhost:/home/nethagglerScripts> scp *.* [email protected]:/home/nethagglerScripts/ 4. for reading vednor.properties . Update this file if we update this file. mkdir -p /usr/local/tomcat/webapps/home/resource/ at web : cd /usr/local/tomcat/webapps/home/resource/ scp vendor.properties [email protected]:/usr/local/tomcat/webapps/home/resource/ batch@localhost:/usr/local/tomcat/webapps/home/resource> scp *.* [email protected]:/usr/local/tomcat/webapps/home/resource/ 5. generate price drop and seo shuld be configured at web server under root cron

6. rest cron are configured at batch. 7. Database back up cron need to be configured too at DB server.

Maile Server

old mail.host=mail.nethaggler.com mail.port=587 mail.user=team mail.password=381d831cf96a33b4078a5082dd6c9e26 mail.truncate=false

new mail.host=74.208.161.48 mail.port=25 mail.user=team OR [email protected] OR testuser mail.password=ncert / a95d080f42e94535575d8eb385693222 tail -f /usr/local/psa/var/log/maillog user is: [email protected] / pass: ncert updated files U U U U U batch/src/main/resources/staging-nethaggler.properties batch/src/main/resources/production-nethaggler.properties home/src/main/webapp/WEB-INF/production-nethaggler.properties home/src/main/webapp/WEB-INF/staging-nethaggler.properties home/src/main/webapp/WEB-INF/nethaggler.properties

/etc/init.d/postfix stop

You might also like