{"id":678,"date":"2015-04-13T21:31:07","date_gmt":"2015-04-14T06:31:07","guid":{"rendered":"http:\/\/blog.box.kr\/?p=678"},"modified":"2015-04-13T21:31:07","modified_gmt":"2015-04-14T06:31:07","slug":"linux-installing-tomcat-8-on-a-centos-7","status":"publish","type":"post","link":"https:\/\/blog.box.kr\/?p=678","title":{"rendered":"[Linux] Installing Tomcat 8 on a CentOS 7"},"content":{"rendered":"<h1 class=\"entry-title\"><b>UPDATE SYSTEM<\/b><\/h1>\n<div class=\"entry-content\">\n<p>First thing to do is to <code>SSH<\/code> to your <a title=\"CentOS VPS\" href=\"http:\/\/www.rosehosting.com\/centos-vps.html\">CentOS 7 VPS<\/a>, fire up a <code>screen<\/code> session and update your system using <code>yum<\/code>:<\/p>\n<pre>## screen -U -S tomcat8-centos7\n## yum update<\/pre>\n<p>You may also want to install a text editor like <code>nano<\/code> or <code>vim<\/code><\/p>\n<pre>## yum install vim nano<\/pre>\n<p>&nbsp;<\/p>\n<h3><b>SETUP JAVA<\/b><\/h3>\n<p><strong>Tomcat 8<\/strong> requires JAVA 7+ in order to run. We are going to<strong> install the <a href=\"http:\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/index.html\" target=\"_blank\">latest version<\/a> of Oracle\u2019s JAVA JDK 8<\/strong>. At the time of writing this article, the latest version of JAVA is <code>8u25<\/code> and can be downloaded and installed using the commands below:<\/p>\n<h4>DOWNLOAD JAVA<\/h4>\n<p>for 32-bit (x86) systems:<\/p>\n<pre>## wget --no-cookies \n--no-check-certificate \n--header \"Cookie: oraclelicense=accept-securebackup-cookie\" \n\"http:\/\/download.oracle.com\/otn-pub\/java\/jdk\/8u25-b17\/jdk-8u25-linux-i586.rpm\" \n-O \/opt\/jdk-8-linux-i586.rpm<\/pre>\n<p>for 64-bit (x86_64) systems:<\/p>\n<pre>## wget --no-cookies \n--no-check-certificate \n--header \"Cookie: oraclelicense=accept-securebackup-cookie\" \n\"http:\/\/download.oracle.com\/otn-pub\/java\/jdk\/8u25-b17\/jdk-8u25-linux-x64.rpm\" \n-O \/opt\/jdk-8-linux-x64.rpm<\/pre>\n<h4>INSTALL JAVA<\/h4>\n<p>for 32-bit (x86) systems:<\/p>\n<pre>## yum install \/opt\/jdk-8-linux-i586.rpm<\/pre>\n<p>for 64-bit (x86_64) systems:<\/p>\n<pre>## yum install \/opt\/jdk-8-linux-x64.rpm<\/pre>\n<h4>CONFIGURE JAVA<\/h4>\n<p>configure the JAVA package using the <code>alternatives<\/code> command:<\/p>\n<pre>## JDK_DIRS=($(ls -d \/usr\/java\/jdk*))\n## JDK_VER=${JDK_DIRS[@]:(-1)}\n\n## alternatives --install \/usr\/bin\/java java \/usr\/java\/\"${JDK_VER##*\/}\"\/jre\/bin\/java 20000\n## alternatives --install \/usr\/bin\/jar jar \/usr\/java\/\"${JDK_VER##*\/}\"\/bin\/jar 20000\n## alternatives --install \/usr\/bin\/javac javac \/usr\/java\/\"${JDK_VER##*\/}\"\/bin\/javac 20000\n## alternatives --install \/usr\/bin\/javaws javaws \/usr\/java\/\"${JDK_VER##*\/}\"\/jre\/bin\/javaws 20000\n## alternatives --set java \/usr\/java\/\"${JDK_VER##*\/}\"\/jre\/bin\/java\n## alternatives --set javaws \/usr\/java\/\"${JDK_VER##*\/}\"\/jre\/bin\/javaws\n## alternatives --set javac \/usr\/java\/\"${JDK_VER##*\/}\"\/bin\/javac\n## alternatives --set jar \/usr\/java\/\"${JDK_VER##*\/}\"\/bin\/jar<\/pre>\n<h4>VERIFY JAVA<\/h4>\n<p>You may want to check if JAVA has been properly setup on your <a title=\"CentOS Linux VPS\" href=\"https:\/\/www.rosehosting.com\/\" target=\"_blank\">CentOS Linux VPS<\/a> using:<\/p>\n<pre>## java -version<\/pre>\n<p>&nbsp;<\/p>\n<h3><b>SETUP TOMCAT<\/b><\/h3>\n<h4>TOMCAT USER<\/h4>\n<p>Before proceeding with the Tomcat installation, let\u2019s first <strong>create a separate system user<\/strong> which will run the Tomcat server:<\/p>\n<pre>## useradd -r tomcat8 --shell \/bin\/false<\/pre>\n<h4>DOWNLOAD TOMCAT<\/h4>\n<p>Next, <strong>download the latest version of Tomcat 8<\/strong> available at <a href=\"http:\/\/tomcat.apache.org\/download-80.cgi\" target=\"_blank\">http:\/\/tomcat.apache.org\/download-80.cgi<\/a> . You can use <code>wget<\/code> to download it in <code>\/tmp<\/code>, for example:<\/p>\n<pre>## wget http:\/\/mirror.tcpdiag.net\/apache\/tomcat\/tomcat-8\/v8.0.15\/bin\/apache-tomcat-8.0.15.tar.gz -P \/tmp<\/pre>\n<h4>INSTALL TOMCAT<\/h4>\n<p>Extract the contents of the Tomcat archive you just downloaded to <code>\/opt<\/code>, create a symbolic link of tomcat directory to <code>\/opt\/tomcat-latest<\/code> and setup proper ownership using the following commands:<\/p>\n<pre>## tar -zxf \/tmp\/apache-tomcat-*.tar.gz -C \/opt\n## ln -s \/opt\/apache-tomcat-8.0.15 \/opt\/tomcat-latest\n## chown -hR tomcat8: \/opt\/tomcat-latest \/opt\/apache-tomcat-*<\/pre>\n<h4>START TOMCAT<\/h4>\n<p>Create the following systemd unit file in <code>\/etc\/systemd\/system\/tomcat8.service<\/code><\/p>\n<pre>[Unit]\nDescription=Tomcat8\nAfter=network.target\n\n[Service]\nType=forking\nUser=tomcat8\nGroup=tomcat8\n\nEnvironment=CATALINA_PID=\/opt\/tomcat-latest\/tomcat8.pid\nEnvironment=TOMCAT_JAVA_HOME=\/usr\/java\/default\nEnvironment=CATALINA_HOME=\/opt\/tomcat-latest\nEnvironment=CATALINA_BASE=\/opt\/tomcat-latest\nEnvironment=CATALINA_OPTS=\nEnvironment=\"JAVA_OPTS=-Dfile.encoding=UTF-8 -Dnet.sf.ehcache.skipUpdateCheck=true -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+UseParNewGC -XX:MaxPermSize=128m -Xms512m -Xmx512m\"\n\nExecStart=\/opt\/tomcat-latest\/bin\/startup.sh\nExecStop=\/bin\/kill -15 $MAINPID\n\n[Install]\nWantedBy=multi-user.target<\/pre>\n<p>With the unit file in place, run the following commands to start the Tomcat servce:<\/p>\n<pre>## systemctl daemon-reload\n## systemctl restart tomcat8\n## systemctl enable tomcat8<\/pre>\n<h4>ACCESS TOMCAT<\/h4>\n<p>&nbsp;<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>UPDATE SYSTEM First thing to do is to SSH to your CentOS 7 VPS, fire up a screen session and update your system using yum: ## screen -U -S tomcat8-centos7 ## yum update You may also want to install a text editor like nano or vim ## yum install vim nano &nbsp; SETUP JAVA Tomcat 8 requires JAVA 7+ in order to run. We are going to install the latest version of Oracle\u2019s JAVA JDK 8. At the time of writing this article, the latest version of JAVA is 8u25 and can be downloaded and installed using the commands below: DOWNLOAD JAVA for 32-bit (x86) systems: ## wget &#8211;no-cookies &#8211;no-check-certificate &#8211;header &#8220;Cookie: oraclelicense=accept-securebackup-cookie&#8221; &#8220;http:\/\/download.oracle.com\/otn-pub\/java\/jdk\/8u25-b17\/jdk-8u25-linux-i586.rpm&#8221; -O \/opt\/jdk-8-linux-i586.rpm for 64-bit (x86_64) systems: ## wget &#8211;no-cookies &#8211;no-check-certificate &#8211;header &#8220;Cookie: oraclelicense=accept-securebackup-cookie&#8221; &#8220;http:\/\/download.oracle.com\/otn-pub\/java\/jdk\/8u25-b17\/jdk-8u25-linux-x64.rpm&#8221; -O \/opt\/jdk-8-linux-x64.rpm INSTALL JAVA for 32-bit (x86) systems: ## yum install \/opt\/jdk-8-linux-i586.rpm for 64-bit (x86_64) systems: ## yum install \/opt\/jdk-8-linux-x64.rpm CONFIGURE JAVA configure the JAVA package using the alternatives command: ## JDK_DIRS=($(ls -d \/usr\/java\/jdk*)) ## JDK_VER=${JDK_DIRS[@]:(-1)} ## alternatives &#8211;install \/usr\/bin\/java java \/usr\/java\/&#8221;${JDK_VER##*\/}&#8221;\/jre\/bin\/java 20000 ## alternatives &#8211;install \/usr\/bin\/jar jar \/usr\/java\/&#8221;${JDK_VER##*\/}&#8221;\/bin\/jar 20000 ## alternatives &#8211;install \/usr\/bin\/javac javac \/usr\/java\/&#8221;${JDK_VER##*\/}&#8221;\/bin\/javac 20000 ## alternatives &#8211;install \/usr\/bin\/javaws javaws \/usr\/java\/&#8221;${JDK_VER##*\/}&#8221;\/jre\/bin\/javaws 20000 ## alternatives &#8211;set java \/usr\/java\/&#8221;${JDK_VER##*\/}&#8221;\/jre\/bin\/java ## alternatives &#8211;set [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"ngg_post_thumbnail":0,"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[5],"tags":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5q9Zn-aW","jetpack-related-posts":[{"id":894,"url":"https:\/\/blog.box.kr\/?p=894","url_meta":{"origin":678,"position":0},"title":"How To Install Cassandra on CentOS 7","date":"2015-06-16","format":false,"excerpt":"Apache Cassandra is a NoSQL database intended for storing large amounts of data in a decentralized, highly available cluster. NoSQL refers to a database with a data model other than the tabular relations used in relational databases such as MySQL, PostgreSQL, and Microsoft SQL. Pre-Flight Check These instructions are intended\u2026","rel":"","context":"In &quot;\uae30\uc220&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":762,"url":"https:\/\/blog.box.kr\/?p=762","url_meta":{"origin":678,"position":1},"title":"Install and configure Nginx, MariaDB &amp; PHP-FPM in CentOS 7 (RHEL7)","date":"2015-05-08","format":false,"excerpt":"https:\/\/stavrovski.net\/blog\/install-and-configure-nginx-mariadb-php-fpm-in-centos-7-rhel7 \u00a0 The following is a quick-N-dirty write-up on\u00a0how to install and configure the LEMP stack (Nginx, MariaDB and PHP-FPM) in\u00a0CentOS 7. I use this as a reference\/guide whenever I need to deploy the\u00a0LEMP stack\u00a0on RHEL based machines. TABLE OF CONTENTS Enable EPEL Repository Update CentOS 7 Install and configure\u2026","rel":"","context":"In &quot;Linux&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":864,"url":"https:\/\/blog.box.kr\/?p=864","url_meta":{"origin":678,"position":2},"title":"How to Install Git 2.4.2 on CentOS\/Redhat 7,6,5 and Fedora 20\/19","date":"2015-05-27","format":false,"excerpt":"http:\/\/tecadmin.net\/install-git-2-0-on-centos-rhel-fedora\/ Git has released 2.4.2\u00a0version on May 26, 2015.It has lots of noticeable changes over git 1.9 release. Git is a free and open source distributed version control system . It is designed to handle a small to very large projects with speed and efficiency. To know more about read\u2026","rel":"","context":"In &quot;\uae30\uc220&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":454,"url":"https:\/\/blog.box.kr\/?p=454","url_meta":{"origin":678,"position":3},"title":"RED5 &amp; FFMPEG &amp; FFserver \uc2a4\ud2b8\ub9ac\ubc0d \uc11c\ubc84 \uad6c\ucd95\ud558\uae30","date":"2014-12-18","format":false,"excerpt":"\u00a0 http:\/\/blog.syszone.co.kr\/2498?category=17 \u00a0 \uc791\uc131\uc790 : \uc11c\uc9c4\uc6b0(alang@syszone.co.kr) \uc791\uc131\uc77c : 2009\ub144 1\uc6d4 5\uc77c 4.1 FFMPEG\ub85c \uc778\ucf54\ub529 \ud658\uacbd \uad6c\ucd95\ud558\uae30 - \uae30\ubcf8 \ud504\ub85c\uadf8\ub7a8 \uc124\uce58 # yum install ruby # yum install ncurses-devel* # yum install lame # yum install libogg # yum install libvorbis # yum install flvtool2 # yum install ffmpeg - \ucf54\ub371\u2026","rel":"","context":"In &quot;\uae30\uc220\uc790\ub8cc&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":899,"url":"https:\/\/blog.box.kr\/?p=899","url_meta":{"origin":678,"position":4},"title":"Cassandra cpp driver install","date":"2015-06-16","format":false,"excerpt":"http:\/\/datastax.github.io\/cpp-driver\/topics\/building\/ \u00a0 Building Supported Platforms The driver is known to work on CentOS\/RHEL 5\/6\/7, Mac OS X 10.8\/10.9 (Mavericks and Yosemite), Ubuntu 12.04\/14.04 LTS, and Windows 7 SP1. It has been built using GCC 4.1.2+, Clang 3.4+, and MSVC 2010\/2012\/2013. Dependencies Driver CMake libuv (1.x or 0.10.x) OpenSSL (optional) NOTE:\u2026","rel":"","context":"In &quot;\uae30\uc220&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":673,"url":"https:\/\/blog.box.kr\/?p=673","url_meta":{"origin":678,"position":5},"title":"[Linux]Install MariaDB 10.0 on CentOS linux using YUM command","date":"2015-04-13","format":false,"excerpt":"Adding the MariaDB YUM Repository We highly recommended to use custom\u00a0MariaDB YUM\u00a0repository to install. Create a repo file under\/etc\/yum.repos.d\/MariaDB.repo, Copy and paste following line under MariaDB repository: Add repository on Centos 6.5 32-bit # vi \/etc\/yum.repos.d\/MariaDB.repo and paste following line: # MariaDB 10.0 CentOS repository list - created 2014-03-12 12:46\u2026","rel":"","context":"In &quot;\uae30\uc220\uc790\ub8cc&quot;","img":{"alt_text":"Connect to MariaDB 10.0","src":"https:\/\/i0.wp.com\/lintut.com\/wp-content\/uploads\/2014\/03\/639x352xScreenshot-from-2014-03-12-141810.png.pagespeed.ic.DHQ-h4Kmpx.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts\/678"}],"collection":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=678"}],"version-history":[{"count":0,"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts\/678\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}