CentOS下搭建java web运行环境

xiaoxiao2021-02-28  2

现更新地址:http://www.yiyehu.tech/archives/2018/03/06/set-up-the-java-web-running-environment-under-centos

买了一个阿里云服务器,搭建个web环境。 系统:CentOS 7.3 64位

mysql安装

CentOS7下解决yum install mysql-server 异常:No package mysql-server available.问题wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpmrpm -ivh mysql-community-release-el7-5.noarch.rpmyum list mysql-server 获取可选mysql资源yum install mysql-server (可以用 mysql-server 带上对应的版本号,用镜像的全称进行安装。 )启动mysql服务:service mysqld start查看mysql 服务启动ps -ef|grep mysqld 查看关于mysql的进程。mysql的日志文件:more /var/log/mysqld.logmysql安装后密码为空 mysql -uroot -p 即可进入SET PASSWORD FOR ‘root’@‘localhost’ = PASSWORD(‘newpass’); ###打开防火墙systemctl status firewalld 查看防火墙状态service firewalld startchkconfig firewalld onfirewall-cmd --zone=public --add-port=80/tcp --permanentfirewall-cmd --zone=public --add-port=3306/tcp --permanentfirewall-cmd --reload

###java环境

下载jdk-8.rpmrpm -ivh jdk-7u79-linux-x64.rpm修改环境变量 nano /etc/profilesource /etc/profile ###tomcat环境搭建cd /usr/local/src/ wget http://www.aminglinux.com/bbs/data/attachment/forum/apache-tomcat-8.5.28.tar.gz 下载tomcat到/usr/local/srctar zxvf apache-tomcat-8.5.28.tar.gzmv apache-tomcat-8.5.28/* /usr/local/tomcatrm -r apache-tomcat-8.5.28cp -p /usr/local/tomcat/bin/catalina.sh /etc/init.d/tomcat修改文件:nano /etc/init.d/tomcat在第二行添加

chkconfig: 112 63 37

description: tomcat server init script

Source Function Library

. /etc/init.d/functionsCATALINA_HOME=/usr/local/tomcat授权:chmod 755 /etc/init.d/tomcat添加服务:chkconfig --add tomcat自启动:chkconfig tomcat on打开tomcat服务:service tomcat start查看进程是否启动:ps aux |grep tomcat
转载请注明原文地址: https://www.6miu.com/read-1750080.html

最新回复(0)