标签:环境搭建 tomcat
一、设置服务器安全与SSH互信
改SSH默认端口、允许访问的IP /etc/hosts.allow deny两个文件控制
[root@localhost ~]# cat /etc/hosts.deny # # hosts.deny This file contains access rules which are used to # deny connections to network services that either use # the tcp_wrappers library or that have been # started through a tcp_wrappers-enabled xinetd. # # The rules in this file can also be set up in # /etc/hosts.allow with a ‘deny‘ option instead. # # See ‘man 5 hosts_options‘ and ‘man 5 hosts_access‘ # for information on rule syntax. # See ‘man tcpd‘ for information on tcp_wrapper sshd:ALL # [root@localhost ~]# cat /etc/hosts.allow # # hosts.allow This file contains access rules which are used to # allow or deny connections to network services that # either use the tcp_wrappers library or that have been # started through a tcp_wrappers-enabled xinetd. # # See ‘man 5 hosts_options‘ and ‘man 5 hosts_access‘ # for information on rule syntax. # See ‘man tcpd‘ for information on tcp_wrappers sshd:111.111.219.111:allow sshd:111.124.171.16:allow
2.设置SSH互信,两台机器相互做,最后一步是确认是否成功(不出密码表示成功)。
/usr/bin/ssh-keygen -d scp -P 8022 /root/.ssh/id_dsa.pub 111.124.171.16:/root/.ssh/authorized_keys ssh -p 8022 root@111.124.171.16 ifconfig
3.修改yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo yum clean all yum makecache 4.初始化硬盘 df -h fdisk -l 查看硬盘情况 fdisk /dev/sdb 格式化这块硬盘 n-p-w mkfs -t ext4 /dev/sdb1 mkdir /wqdata vim /etc/fstab 添加下句 /dev/sdb1 /wqdata ext3 defaults 1 2 二、安装jdk+tomcat环境 rpm -ivh jdk-7u79-linux-x64.rpm 三、安装MYSQL数据库 四、导入数据测试
本文出自 “MJ为的笔记和总结” 博客,转载请与作者联系!
服务器环境搭建 1 ---NGINX+TOMACT+MYSQL
标签:环境搭建 tomcat
原文地址:http://024mj.blog.51cto.com/10252785/1695715