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应用
场景 随着公司业务快速发展,公司的电子商务平台已经聚集了很多的忠实粉丝,公司也拿到了投资,这时老板想通过一场类似双十一的活动,进行一场大的促销,届时会有非常多的粉丝访问网站,你的总监与市场部门开完会后 ...
随机推荐
- 带线表格据gt生成无线表格
json解析练习,python图像处理练习,表格包围框毛刺问题待解决. # -*- coding: utf-8 -*- # coding: utf-8 from PIL import Image, I ...
- 导入50G文件到mysql,然后再倒入sqlserver
--导入大文件50G文件到mysql1.修改配置innodb_flush_log_at_trx_commit=0 2.导入时的注意事项set autocommit=1;show variables l ...
- Flask-WebSocket案例
实验1:实现初始的通信 客户端:用浏览器向服务端发送信息 服务端:首先接收浏览器发来的信息,并作出相应应答 第一步:需要导入模块: from flask import Flask,request fr ...
- ruby 发送邮件
产品构建.打包.部署完需要发送邮件通知相关人员进行验证.请看过程 #encoding:utf-8 require 'mail' #~ branch = ARGV.to_s.sub('[','').su ...
- 【Luogu】P4219大融合(LCT)
题目链接 LCTrotate打错尬死 容易发现本题就是问两边子树大小乘积,于是开个数组动态维护LCT每个节点虚子树上有多少点,在Access和Link的时候更新即可. #include<cstd ...
- Posix线程编程指南
Posix线程编程指南 Posix线程编程指南... 1 一线程创建与取消... 2 线程创建... 2 1.线程与进程... 2 2. 创建线程... 2 3. 线程创建属性... 2 4. 创建的 ...
- 【转】Nodejs学习笔记(一)--- 简介及安装Node.js开发环境
目录 学习资料 简介 安装Node.js npm简介 开发工具 Sublime Node.js开发环境配置 扩展:安装多版本管理器 学习资料 1.深入浅出Node.js http://www.info ...
- 挑战程序设计竞赛》P345 观看计划
<挑战程序设计竞赛>P345 观看计划 题意:一周一共有M个单位的时间.一共有N部动画在每周si时 ...
- python实现贪吃蛇
贪吃蛇的算法还是比较简单的,蛇的移动我是通过不停添加一个head方块,然后判断应该加到蛇头的哪个方向,加完后删掉蛇尾就行了,如果吃到食物就不删蛇尾. 只是一个贪吃蛇只需要70行代码左右就可以了,后来又 ...
- C# Stopwatch详解
namespace System.Diagnostics { // // 摘要: // 提供一组方法和属性,可用于准确地测量运行时间. public class Stopwatch { // // 摘 ...