Aliyun-CentOS7.3 Init
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的更多相关文章
- aliyun centos7 挂载云盘
买了云盘,在哪里放着,也没有用到,今天把她挂上去吧! 1.查看SSD云盘sudo fdisk -l 可以看到SSD系统已经识别为/dev/vdb 2.格式化云盘sudo mkfs.ext4 /dev/ ...
- Centos7系统配置上的变化(二)网络管理基础
原文 Centos7系统配置上的变化(二)网络管理基础 上篇简单介绍了CentOS 7 在服务和网络方面的一点变化,先前很多烂熟于心的操作指令已经不适用了,不管是否习惯,总要接受.熟悉这些变化. 写上 ...
- CentOS7操作系统参数优化
生产环境配置需要标准化,将常用操作写成脚本用于操作系统的初始化. #!/bin/bash #Date:2017 #This Script is for centos7.3 init #01.配置yum ...
- vagrant安装centos7
1. 安装VirtualBox 去官网https://www.virtualbox.org/wiki/Downloads下载最新版的Virtualbox,然后双击安装,一直点击确认完成. 2. 安装V ...
- 如何将centos7自带的firewall防火墙更换为iptables防火墙
用惯了centos6的iptables防火墙,对firewall太无感了,那么如何改回原来熟悉的iptables防火墙呢? 1.关闭firewall防火墙 [root@centos7 html]# s ...
- docker for centos7
docker for centos7 据官方所说,docker在新版本的ubuntu和centos7上表现更好,鉴于我们目前使用的系统是centos6.8,这次我们选择centos7作为docker的 ...
- centos7系统启动流程
前提:pc主机,MBR架构 第一步:post(power on system test)加电自检. pc机的主板上有个rom芯片(CMOS),加电后,cpu去找这个raw,然后读取里面的指令,检测机器 ...
- 老司机带你用vagrant打造一站式python开发测试环境
前言 作为一个学习和使用Python的老司机,好像应该经常总结一点东西的,让新司机尽快上路,少走弯路,然后大家一起愉快的玩耍. 今天,咱们就使用vagrant配合xshell打造一站式Python ...
- 项目详解4—haproxy 详解
一.企业服务架构图及负载均衡的要求 1.场景说明 在企业生产环境中,每天会有很多的需求变更,比如增加服务器.新业务上线.url路由修改.域名配置等等,对于前端负载均衡设备来说,容易维护,复杂度低,是首 ...
- 企业级缓存系统varnish应用
场景 随着公司业务快速发展,公司的电子商务平台已经聚集了很多的忠实粉丝,公司也拿到了投资,这时老板想通过一场类似双十一的活动,进行一场大的促销,届时会有非常多的粉丝访问网站,你的总监与市场部门开完会后 ...
随机推荐
- jqgrid postData setGridParam 调用多次时查询条件累加的问题
var postData = $(gridId).jqGrid("getGridParam", "postData"); $.each(paras, funct ...
- Spring整合hibernate -声明事务管理
目录 1 sessionFactory 注入HibernateTransactionManager 2 XML配置的配置 3 添加annotation-driven 4 引入JAR包 5在servi ...
- BZOJ 1051:[HAOI2006]受欢迎的牛(强连通分量)
受欢迎的牛Description每一头牛的愿望就是变成一头最受欢迎的牛.现在有N头牛,给你M对整数(A,B),表示牛A认为牛B受欢迎. 这种关系是具有传递性的,如果A认为B受欢迎,B认为C受欢迎,那么 ...
- 【bzoj4555】[Tjoi2016&Heoi2016]求和 NTT
题目描述 在2016年,佳媛姐姐刚刚学习了第二类斯特林数,非常开心. 现在他想计算这样一个函数的值: S(i, j)表示第二类斯特林数,递推公式为: S(i, j) = j ∗ S(i − 1, j) ...
- Sum of Squares of the Occurrence Counts解题报告(后缀自动机+LinkCutTree+线段树思想)
题目描述 给定字符串\(S(|S|\le10^5)\),对其每个前缀求出如下的统计量: 对该字符串中的所有子串,统计其出现的次数,求其平方和. Sample Input: aaa Sample Out ...
- 省选算法学习-dp优化-四边形不等式
嗯......四边形不等式的确长得像个四边形[雾] 我们在dp中,经常见到这样一类状态以及转移方程: 设$dp\left[i\right]\left[j\right]$表示闭区间$\left[i,j\ ...
- jquery 实践操作:div 动态嵌套页面
此篇记录如何在指定 div 中嵌套一个页面 load() 方法: 1. 使用 $.load() 直接导入一个页面 $('#addPage_div').load("temp/handle.ht ...
- 【BZOJ1874】取石子游戏(SG函数)
题意:小H和小Z正在玩一个取石子游戏. 取石子游戏的规则是这样的,每个人每次可以从一堆石子中取出若干个石子, 每次取石子的个数有限制,谁不能取石子时就会输掉游戏. 小H先进行操作, 他想问你他是否有必 ...
- javascript草稿
原文发布时间为:2011-06-01 -- 来源于本人的百度文章 [由搬家工具导入] @MyHelper.Script("jquery-1.6.1.min.js", Url) ...
- .net3.5下使用LINQ递归算法实现简洁代码
原文发布时间为:2011-04-24 -- 来源于本人的百度文章 [由搬家工具导入] http://www.cnblogs.com/wintersun/archive/2009/03/29/14243 ...