zoukankan      html  css  js  c++  java
  • linux 之安装JDK、Tomcat、MySQL软件

    IP地址配置

    在命令运行  setup,带提示,按照提示修改即可 

    1.修改主机名

    vi /etc/sysconfig/network

    NETWORKING=yes

    HOSTNAME=server1.itcast.cn

    2.修改ip地址

    vi /etc/sysconfig/network-scripts/ifcfg-eth0

    DEVICE=eth0

    TYPE=Ethernet

    ONBOOT=yes     #是否开机启用

    BOOTPROTO=static   #ip地址设置为静态

    IPADDR=192.168.0.101

    NETMASK=255.255.255.0

    service network restart

    3.修改ip地址和主机名的映射关系

    vi /etc/hosts

    127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

    ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

    192.168.0.101 server1.itcast.cn

    4.关闭iptables并设置其开机启动/不启动

    service iptables stop

    chkconfig iptables on

    chkconfig iptables off

    1. 安装JDK

    1.上传jdk-7u45-linux-x64.tar.gzLinux

    2.解压jdk/usr/local目录

    tar -zxvf jdk-7u45-linux-x64.tar.gz -C /usr/local/

    3.设置环境变量,在/etc/profile文件最后追加相关内容

    vi /etc/profile

    export JAVA_HOME=/usr/local/jdk1.7.0_45

    export PATH=$PATH:$JAVA_HOME/bin

    4.刷新环境变量

    source /etc/profile

    5.测试java命令是否可用

    java -version

    2. 安装Tomcat

    1.上传apache-tomcat-7.0.68.tar.gzLinux

    2.解压tomcat

    tar -zxvf apache-tomcat-7.0.68.tar.gz -C /usr/local/

    3.启动tomcat

    /usr/local/apache-tomcat-7.0.68/bin/startup.sh

    4.查看tomcat进程是否启动

    jps

    5.查看tomcat进程端口

    netstat -anpt | grep 2465

    6.通过浏览器访问tomcat

    http://192.168.0.101:8080/

     

    3. 安装MySQL

    1.上传MySQL-server-5.5.48-1.linux2.6.x86_64.rpmMySQL-client-5.5.48-1.linux2.6.x86_64.rpmLinux

    2.使用rpm命令安装MySQL-server-5.5.48-1.linux2.6.x86_64.rpm,缺少perl依赖

    rpm -ivh MySQL-server-5.5.48-1.linux2.6.x86_64.rpm

     

    3.安装perl依赖,上传6perl相关的rpm

     

    rpm -e perl-*

    4.再安装MySQL-serverrpm包冲突

    rpm -ivh MySQL-server-5.5.48-1.linux2.6.x86_64.rpm

     

    5.卸载冲突的rpm

    rpm -e mysql-libs-5.1.73-5.el6_6.x86_64 --nodeps

    6.再安装MySQL-clientMySQL-server

    rpm -ivh MySQL-client-5.5.48-1.linux2.6.x86_64.rpm

    rpm -ivh MySQL-server-5.5.48-1.linux2.6.x86_64.rpm

    7.启动MySQL服务,然后初始化MySQL

    service mysql start

    /usr/bin/mysql_secure_installation

    8.测试MySQL

    mysql -u root -p

     
  • 相关阅读:
    Python Challenge 第十二关
    Python Challenge 第十一关
    Python Challenge 第十关
    Python Challenge 第九关
    Python Challenge 第八关
    Python Challenge 第七关
    zepto
    zepto
    zepto
    zepto
  • 原文地址:https://www.cnblogs.com/dw-date/p/13411272.html
Copyright © 2011-2022 走看看