標籤:環境搭建 tomcat
一、設定伺服器安全與SSH互信
改SSH預設連接埠、允許訪問的IP /etc/hosts.allow deny兩個檔案控制
[[email protected] ~]# 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_wrappersshd:ALL#[[email protected] ~]# 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_wrapperssshd:111.111.219.111:allowsshd: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 [email protected] ifconfig
3.修改yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repowget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repoyum clean all yum makecache4.初始化硬碟df -h fdisk -l 查看硬碟情況fdisk /dev/sdb 格式化這塊硬碟 n-p-wmkfs -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