Aliyun-CentOS7.3 Init

一、概述

查看系统版本

$ cat /etc/redhat-release
$ uname -a

修改主机名

$ vi /etc/hostname
$ reboot

安装必要lib

yum -y install  gcc gcc-c++ make zlib zlib-devel readline-devel pcre pcre-devel openssl openssl-devel tcl perl

二、安装Openresty


$ wget http://www.zlib.net/zlib-1.2.11.tar.gz
$ tar xvf zlib-1.2.11.tar.gz $ wget https://openresty.org/download/openresty-1.11.2.3.tar.gz
$ tar xvf openresty-1.11.2.3.tar.gz $ cd /usr/local/openresty-1.11.2.3/bundle/
$ cd /bundle/LuaJIT-2.1-20170405/
$ make clean && make && make install
$ ln -sf luajit-2.1.0-beta2 /usr/local/bin/luajit $ wget https://github.com/alibaba/nginx-http-concat/archive/master.zip -O nginx-http-concat.zip
$ unzip nginx-http-concat
$ mv nginx-http-concat-master nginx-http-concat $ wget https://github.com/FRiCKLE/ngx_cache_purge/archive/2.3.tar.gz -O ngx_cache_purge-2.3.tar.gz
$ tar xvf ngx_cache_purge-2.3.tar.gz $ wget https://github.com/yaoweibin/nginx_upstream_check_module/archive/v0.3.0.tar.gz -O nginx_upstream_check_module-0.3.0.tar.gz
$ tar xvf nginx_upstream_check_module-0.3.0.tar.gz $ ./configure --prefix=/usr/local/openresty \
--with-pcre \
--with-zlib=/usr/local/src/zlib-1.2.11 \
--with-http_gzip_static_module \
--with-http_realip_module \
--with-http_stub_status_module \
--with-http_iconv_module \
--add-module=./bundle/nginx-http-concat \
--add-module=./bundle/ngx_cache_purge-2.3 \
--add-module=./bundle/nginx_upstream_check_module-0.3.0/
$ gmake && gmake install

三、安装iptables防火墙

#关闭firewall:
$ systemctl stop firewalld.service #停止firewall
$ systemctl disable firewalld.service #禁止firewall开机启动 #安装iptables防火墙
$ yum install -y iptables-services #安装
$ vi /etc/sysconfig/iptables #编辑防火墙配置文件,开启80,3306端口 # sample configuration for iptables service
# you can edit this manually or use system-config-firewall
# please do not ask us to add additional ports/services to this default configuration
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT $ systemctl restart iptables.service #最后重启防火墙使配置生效
$ systemctl enable iptables.service #设置防火墙开机启动
$ systemctl status iptables #查看防火墙状态

四、安装Golang

$ wget -c http://golangtc.com/static/go/go1.8.linux-amd64.tar.gz
$ tar zxvf go1.8.linux-amd64.tar.gz -C /usr/local
$ vi /etc/profile
export GOROOT=/usr/local/go
export GOBIN=$GOROOT/bin
export PATH=$PATH:$GOBIN
$ source /etc/profile
$ go version

五、安装NodeJS

wget https://nodejs.org/dist/v6.10.3/node-v6.10.3-linux-x64.tar.gz
tar zxvf node-v6.10.3-linux-x64.tar.gz -C /usr/local
$vi /etc/profile
export NODE_HOME=/usr/local/node-v6.10.3-linux-x64
export PATH=$PATH:$NODE_HOME/bin
export NODE_PATH=$NODE_HOME/lib/node_modules
$source /etc/profile
$node -v

六、安装JDK

$ wget https://files.eveoh.nl/jdk-7u80-linux-x64.tar.gz
$ mkdir /usr/java
$ tar zxvf jdk-7u80-linux-x64.tar.gz -C /usr/java
$ vi /etc/profile
export JAVA_HOME=/usr/java/jdk1.7.0_80
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
$ source /etc/profile
$ java -version

七、安装Tomcat

$ wget http://mirrors.hust.edu.cn/apache/tomcat/tomcat-7/v7.0.78/bin/apache-tomcat-7.0.78.tar.gz
$ tar xvf apache-tomcat-7.0.78.tar.gz -C /data/production/
$ cd /data/production/
$ mv apache-tomcat-7.0.78 tomcat-myproj
$ rm -rf webapps/docs webapps/examples webapps/host-manager webapps/manager weapps/ROOT/*

八、安装Python

#默认系统已安装2.7.5,无需再安装或更新
$ python
Python 2.7.5 (default, Nov 6 2016, 00:28:07)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

九、安装Shadowsocks

$ wget --no-check-certificate -O shadowsocks-libev.sh https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-libev.sh
$ chmod +x shadowsocks-libev.sh
$ ./shadowsocks-libev.sh 2>&1 | tee shadowsocks-libev.log
$ /etc/init.d/shadowsocks status
$ vi /etc/sysconfig/iptables #开启8989端口

十、安装MySQL

$ wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm #下载MySQL源安装包
$ yum -y localinstall mysql57-community-release-el7-8.noarch.rpm #安装mysql源
$ yum repolist enabled | grep "mysql.*-community.*" #检查MySQL源是否安装成功
$ yum -y install mysql-community-server #安装MySQL
$ systemctl start mysqld #启动MySQL
$ systemctl status mysqld #查看启动状态
$ systemctl enable mysqld #配置开机启动
$ systemctl daemon-reload #配置开机启动
$ vi /etc/my.conf
validate_password = off #根据需要禁用密码策略
$ grep 'temporary password' /var/log/mysqld.log #查看初始密码
$ mysql -uroot -p #重新设置密码
set password for 'root'@'localhost'=password('123456'); #授权远程操作
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
FLUSH PRIVILEGES;

reference: http://blog.csdn.net/xyang81/article/details/51759200

十一、安装Docker

$ yum install docker-io –y
$ systemctl start docker
$ docker info $ docker pull registry.cn-hangzhou.aliyuncs.com/lxepoo/apache-php5
$ docker images
$ docker run -d -p 8081:80 --name apache e121d5f99e1e
$ curl http://127.0.0.1:8081

reference : https://help.aliyun.com/document_detail/51853.html

十二、安装其他

安装Anaconda

$ wget https://repo.continuum.io/archive/Anaconda2-4.4.0-Linux-x86_64.sh
$ bash Anaconda2-4.4.0-Linux-x86_64.sh
$ source ~/.bashrc
$ python #验证 #生成notebook登陆密码
from notebook.auth import passwd
passwd() #生成notebook配置文件
$ jupyter notebook --generate-config --allow-root
vi ~/.jupyter/jupyter_notebook_config.py c.NotebookApp.notebook_dir = u'/data/workspace/pyproj/notebooks'
c.NotebookApp.ip='0.0.0.0'
c.NotebookApp.port =8888
c.NotebookApp.open_browser = False
c.NotebookApp.password = u'sha:11111111111111111111111' #使用之前生成的登陆密码 #启动notebook
#jupyter notebook --no-browser --port 8888 --ip=0.0.0.0 --allow-root
$ nohup jupyter notebook --allow-root

Aliyun-CentOS7.3 Init的更多相关文章

  1. aliyun centos7 挂载云盘

    买了云盘,在哪里放着,也没有用到,今天把她挂上去吧! 1.查看SSD云盘sudo fdisk -l 可以看到SSD系统已经识别为/dev/vdb 2.格式化云盘sudo mkfs.ext4 /dev/ ...

  2. Centos7系统配置上的变化(二)网络管理基础

    原文 Centos7系统配置上的变化(二)网络管理基础 上篇简单介绍了CentOS 7 在服务和网络方面的一点变化,先前很多烂熟于心的操作指令已经不适用了,不管是否习惯,总要接受.熟悉这些变化. 写上 ...

  3. CentOS7操作系统参数优化

    生产环境配置需要标准化,将常用操作写成脚本用于操作系统的初始化. #!/bin/bash #Date:2017 #This Script is for centos7.3 init #01.配置yum ...

  4. vagrant安装centos7

    1. 安装VirtualBox 去官网https://www.virtualbox.org/wiki/Downloads下载最新版的Virtualbox,然后双击安装,一直点击确认完成. 2. 安装V ...

  5. 如何将centos7自带的firewall防火墙更换为iptables防火墙

    用惯了centos6的iptables防火墙,对firewall太无感了,那么如何改回原来熟悉的iptables防火墙呢? 1.关闭firewall防火墙 [root@centos7 html]# s ...

  6. docker for centos7

    docker for centos7 据官方所说,docker在新版本的ubuntu和centos7上表现更好,鉴于我们目前使用的系统是centos6.8,这次我们选择centos7作为docker的 ...

  7. centos7系统启动流程

    前提:pc主机,MBR架构 第一步:post(power on system test)加电自检. pc机的主板上有个rom芯片(CMOS),加电后,cpu去找这个raw,然后读取里面的指令,检测机器 ...

  8. 老司机带你用vagrant打造一站式python开发测试环境

      前言 作为一个学习和使用Python的老司机,好像应该经常总结一点东西的,让新司机尽快上路,少走弯路,然后大家一起愉快的玩耍. 今天,咱们就使用vagrant配合xshell打造一站式Python ...

  9. 项目详解4—haproxy 详解

    一.企业服务架构图及负载均衡的要求 1.场景说明 在企业生产环境中,每天会有很多的需求变更,比如增加服务器.新业务上线.url路由修改.域名配置等等,对于前端负载均衡设备来说,容易维护,复杂度低,是首 ...

  10. 企业级缓存系统varnish应用

    场景 随着公司业务快速发展,公司的电子商务平台已经聚集了很多的忠实粉丝,公司也拿到了投资,这时老板想通过一场类似双十一的活动,进行一场大的促销,届时会有非常多的粉丝访问网站,你的总监与市场部门开完会后 ...

随机推荐

  1. POJ 2976 Dropping tests(01分数规划入门)

    Dropping tests Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 11367   Accepted: 3962 D ...

  2. BZOJ1566 [NOI2009]管道取珠 【dp】

    题目 输入格式 第一行包含两个整数n, m,分别表示上下两个管道中球的数目. 第二行为一个AB字符串,长度为n,表示上管道中从左到右球的类型.其中A表示浅色球,B表示深色球. 第三行为一个AB字符串, ...

  3. 无序字母对 character

    无序字母对 character 题目描述 给定n个各不相同的无序字母对(区分大小写,无序即字母对中的两个字母可以位置颠倒).请构造一个有n+1个字母的字符串使得每个字母对都在这个字符串中出现. 输入 ...

  4. 完美匹配(matching)

    完美匹配(matching) 题目描述 给定nn个点,mm条边的无向图G=(V,E)G=(V,E),求出它的完美匹配数量对106+3106+3取模的值. 一个完美匹配可以用一个排列ϕ:V→Vϕ:V→V ...

  5. mrpt安装

    1.mrpt2.0参 See PPA for mrpt 2.0 branch (for mrpt 1.5.* read here). sudo add-apt-repository ppa:josel ...

  6. utf-8与unicode

    举一个例子:It's 知乎日报 你看到的unicode字符集是这样的编码表: I 0049 t 0074 ' 0027 s 0073 0020 知 77e5 乎 4e4e 日 65e5 报 62a5 ...

  7. EF4.2预览版出来了

    原文发布时间为:2011-09-21 -- 来源于本人的百度文章 [由搬家工具导入] http://blogs.msdn.com/b/adonet/archive/2011/08/22/ef-4-2- ...

  8. jquery.slider jquery滑块插件

    原文发布时间为:2011-03-08 -- 来源于本人的百度文章 [由搬家工具导入] http://jqueryui.com/demos/slider jquery滑块插件

  9. Java EE学习记录(一)

    话说大家都在说java EE,但是java EE的分层结构如下: 1.数据持久层:主要由一些负责操作POJO(Plain Old Java Object)的类构成,主要负责将数据保存进入数据库; 2. ...

  10. Guice 4.1教程

    Guice是Google开发的一个开源轻量级的依赖注入框架,运行速度快,使用简单. 项目地址:https://github.com/google/guice/ 最新的版本是4.1,本文基于此版本. 0 ...