伺服器環境搭建 1 ---NGINX+TOMACT+MYSQL

來源:互聯網
上載者:User

標籤:環境搭建 tomcat

一、設定伺服器安全與SSH互信

  1. 改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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.