Ubuntu 16.04.2_64系统配置

转载:http://www.cnblogs.com/yangchongxing/p/9049897.html

Ubuntu Server服务指南:https://help.ubuntu.com/16.04/serverguide/index.html

准备事项

虚拟机网络选择桥接模式、如果使用的是无线网络,则配置适配器为自己的无线网络。

网络ping -c 192.168.1.181

查看netstat -rn

重启reboot、关机shutdown -h now

1、启用root用户

$sudo passwd root

输入两次密码就OK了。

2、安装VIM

#apt-get install vim

3、安装ssh

#apt-get install ssh

启用root ssh连接

# vim /etc/ssh/sshd_config  

修改如下部分,允许root登陆

# Authentication:
LoginGraceTime
#PermitRootLogin without-
password
PermitRootLogin yes
StrictModes yes

重新启动ssh服务

# service ssh restart 

4、安装中文语言包

# apt-get install language-pack-zh-hans

5、配置静态IP

# vi /etc/network/interfaces

注释

#iface ens33 inet dhcp

追加

iface ens33 inet static
address 192.168.1.181
gateway 192.168.1.1
netmask 255.255.255.0

修改DNS

#vim /etc/resolv.conf
nameserver 192.168.1.1

重启失效追加DNS

vi /etc/resolvconf/resolv.conf.d/base
nameserver 192.168.1.1
nameserver 8.8.8.8
nameserver 8.8.4.4

Google提供的免费DNS服务器的IP地址

主 8.8.8.8 和 备 8.8.4.4

重启网络

# /etc/init.d/networking restart

 6、修改源

# cp /etc/apt/sources.list /etc/apt/sources.list.bak
# vim /etc/apt/sources.list

# apt-get update

若apt-get update出现错误,则

# vim /etc/resolv.conf

追加 nameserver 8.8.8.8

阿里源

18.04.03 LTS

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

16.04 LTS


# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted
#Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe
#Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe
#Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
#Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe
#Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse

7、关闭防火墙、启用防火墙

# ufw disable
# ufw anable

8、安装java环境

下载jdk-8u131-linux-x64.tar.gz和tomcat9.tar.gz,解压到/root目录,你也可以解压到其他路径。

配置root环境

# vim .profile
追加

export JAVA_HOME=/root/jdk1.8.0_131
export JRE_HOME=/root/jdk1.8.0_131/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin

然后

# source .profile

配置所有用户环境

# vim /etc/profile
追加
export JAVA_HOME=/root/jdk1..0_131
export JRE_HOME=/root/jdk1..0_131/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin # source /etc/profile

9、安装Redis数据库

命令行安装

# apt-get install redis-server

检查Redis服务器系统进程

# ps -aux|grep redis
redis 0.0 0.6 ? Ssl : : /usr/bin/redis-server *:
root 0.0 0.0 pts/ S+ : : grep --color=auto redis

检查Redis服务器监听端口

# netstat -nlt|grep
tcp 127.0.0.1: 0.0.0.0:* LISTEN

检查Redis服务器状态

# /etc/init.d/redis-server status

修改Redis服务配置

# vi /etc/redis/redis.conf

进入vim后按Esc,/requirepass 检索,检索到后n向后检索,N向前检索

设置访问密码,去掉注解
requirepass 123456
远程访问Redis服务器,注释bind
#bind 127.0.0.1

重启Redis服务器

# /etc/init.d/redis-server restart

使用客户端验证

有密码登录

# redis-cli -a 

无密码登录

# redis-cli

在远程的另一台Linux访问Redis服务器

# redis-cli -a  -h 192.168.1.190

登陆后测试

# redis-cli -a
127.0.0.1:> keys * #查看
) "key2"
) "key1"
127.0.0.1:> set key3 aaa # 添加
OK
127.0.0.1:> keys *
) "key2"
) "key3"
) "key1"
127.0.0.1:> get key3 #获取
"aaa"
127.0.0.1:> del key3 #删除
(integer)
127.0.0.1:> keys *
) "key2"
) "key1"
127.0.0.1:>

【Ubuntu 16.04.2_64】系统配置的更多相关文章

  1. 【Ubuntu 16.04.2_64】安装配置SVN

    [Ubuntu 16.04.2_64]安装配置SVN 转载:https://www.cnblogs.com/yangchongxing/p/10190549.html 检查是否已安装svn # svn ...

  2. VMWare 安装Ubuntu 16.04

    1.新建虚拟机 (1)点击文件-->新建虚拟机 (2)选择 自定义(高级)--> 下一步 (3)选择Workstation 12.0 --> 下一步 (4)选择 稍后安装操作系统 - ...

  3. Ubuntu 下ibus拼音输入法启用 (ubuntu 16.04

    Ubuntu 下ibus拼音输入法启用 我安装的是英文版的ubuntu 16.04,打开只带英文,并没有中文. 设置输入法为iBus 从system settings 进入language suppo ...

  4. Ubuntu 16.04 LAMP server 指南 - 配置 Apache2.4,PHP7,和MariaDB(而不是MySQL)

    翻译自:https://www.howtoforge.com/tutorial/install-apache-with-php-and-mysql-on-ubuntu-16-04-lamp/ 昨天在虚 ...

  5. 【转】Ubuntu 16.04安装配置TensorFlow GPU版本

    之前摸爬滚打总是各种坑,今天参考这篇文章终于解决了,甚是鸡冻\(≧▽≦)/,电脑不知道怎么的,安装不了16.04,就安装15.10再升级到16.04 requirements: Ubuntu 16.0 ...

  6. Ubuntu 16.04 安装 Kodi v17 “Krypton” Alpha 2

    Ubuntu 16.04 安装 Kodi v17 “Krypton” Alpha 2:sudo add-apt-repository ppa:team-xbmc/xbmc-nightlysudo ap ...

  7. ubuntu 16.04安装docker

    环境 操作系统:ubuntu 16.04 64位,默认安装 准备 1. 添加GPG key: $ sudo apt-key adv --keyserver hkp://p80.pool.sks-key ...

  8. Ubuntu 16.04安装QQ国际版图文详细教程

            因工作需要,我安装了Ubuntu 16.04,但是工作上的很多事情需要QQ联系,然而在Ubuntu上的WebQQ很是不好用,于是在网上搜索了好多个Linux版本的QQ,然而不是功能不全 ...

  9. Ubuntu 16.04 64位 搭建 node.js NodeJS 环境

    我的系统环境: Ubuntu 16.04 64位 本文内容亲测可用, 请放心食用 使用淘宝镜像 淘宝镜像官网是https://npm.taobao.org/ 使用淘宝镜像前请自行安装好 npm 和 n ...

随机推荐

  1. 4.vim编辑器

    把光标移动文件头 gg 把光标移动文件尾 G 移动到行首 ^ 移动到行尾 $ 移动到指定行 :n 回车

  2. Spring Boot (一) 校验表单重复提交

    一.前言 在某些情况下,由于网速慢,用户操作有误(连续点击两下提交按钮),页面卡顿等原因,可能会出现表单数据重复提交造成数据库保存多条重复数据. 存在如上问题可以交给前端解决,判断多长时间内不能再次点 ...

  3. html基础——div/span

    div是一个块标签/盒子标签,单独占据一行 span不会占据一块,一般是用来修改某几个文字的格式 比如一行字,需要将每一句的首字母大写,就可以使用span标签 如果是要将一个段落的字加样式,两个都可以 ...

  4. PIC18F45K80串口1和串口2异步收发通信实例

    PIC18F45K80串口1和串口2异步收发通信实例 一:配置串口1初始化函数 首先打开技术手册,查看异步串口的操作流程以及配置. 需要将串口对应引脚的方向寄存器设置为输入

  5. wincap linux部署

    1.4.1 linux下安装Winpcap a) 下载Winpcap的源码:https://www.winpcap.org/devel.htm b) 上传源码包“WpcapSrc_4_1_3.zip” ...

  6. 极化码之tal-vardy算法(1)

    继前两节我们分别探讨了极化码的编码,以及深入到高斯信道探讨高斯近似法之后,我们来关注一个非常重要的极化码构造算法.这个算法并没有一个明确的名词,因此我们以两位发明者的名字将其命名为“Tal-Vardy ...

  7. python模块2

    python模块2 相关概念 模块名是标识符(需要按照标识符的写法编写) Pyc文件 在使用模块的项目中会生成一个_pycache_文件,里面存放着编译过的(模块的)字节码缓存文件(因为模块一般很少有 ...

  8. ASI中POST请求和文件下载

    //POST请求 1 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { // 1.URL NSURL *url = ...

  9. 循环双向链表-C语言实现

    直接贴出完整代码,每个函数的功能及部分代码的解释都在注释中,代码亲测可行 /* 2018.8.15 注意三点: 1.不要将循环写成if //很尴尬,主要是我犯了这个错误,找了半天还没找出来,第二天看的 ...

  10. html元素是否包含另外一个元素,以及classList属性

    如何判断一个元素A包含了元素B呢?如果不用contains方法的话,如何做呢? 腾讯面试的时候也出了这道题啊,当时没看dom的知识,所以一抹黑哦... 那就判断B是否为A的child喽,那也就是A是B ...