ubuntu安装Redis+安装mysql(配置远程登录)+安装jdk+安转nginx+安转teamviewer+安装terminator+安装sublime

一.Ubuntu 安装 Redis

sudo apt-get update
sudo apt-get install redis-server

redis-server 启动

修改redis配置 远程访问:

sudo vim /etc/redis/redis.conf

注释掉本机ip: 有坑的地方

#bind 127.0.0.1 

service redis-server restart

redis-cli ping 验证可以ping通

问题:redis too many open files

解决:ulimit -n 10000

/etc/redis/redis.conf 增加maxclients个数

 

二.ubuntu安装mysql

1. 安装

sudo apt-get install mysql-server mysql-client

service mysql restart 启动mysql服务

 mysql -V查看版本

2.指定时区:

2.1 mysql -u root -p 登录mysql

2.2 show variables like '%time_zone%';

2.3 set global time_zone='+8:00';

2.4 退出重新登录 show variables like '%time_zone%';

3.设置远程登录 mysql5.7

3.1 mysql -u root -p 登录mysql

3.2 use mysql;   

3.3 GRANT ALL ON *.* TO user@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;   

#这句话的意思 ,允许任何IP地址(上面的 % 就是这个意思)的电脑 用user帐户  和密码(123456)来访问这个MySQL Server   #必须加类似这样的帐户,才可以远程登陆。 root帐户是无法远程登陆的,只可以本地登陆 .

3.4 最后最坑的一个地方

sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf

在这里屏蔽掉只能本地连接的地址

3.5 重启mysql服务 sudo /etc/init.d/mysql restart

 

4.删除mysql:

 4.1 卸载

sudo apt-get remove mysql-*

 4.2 然后清理残留的数据

dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P

 

三.安装jdk

1.sudo apt install openjdk-8-jre-headless

2.sudo apt install openjdk-8-jdk-headless

四.安转nginx

安装sudo apt-get install nginx

ps -ef | grep nginx 查看

日志:日志放在了/var/log/nginx中,分别是access.log和error.log,可以进行查看是否安装成功,如有错误根据错误修改

启动nginx

/etc/init.d/nginx start

卸载nginx

删除nginx,–purge包括配置文件
sudo apt-get --purge remove nginx
自动移除全部不使用的软件包
sudo apt-get autoremove

列出与nginx相关的软件 并删除显示的软件
dpkg --get-selections|grep nginx

sudo apt-get --purge remove nginx
sudo apt-get --purge remove nginx-common
sudo apt-get --purge remove nginx-core

再次执行
dpkg --get-selections|grep nginx

which nginx # 不在显示nginx
这样就可以完全卸载掉nginx包括配置文件 
注意点:首先需要停止nginx的服务

sudo service nginx stop

nginx配置负载均衡

五.安转teamviewer

网址https://www.teamviewer.com/zhcn/download/linux/

sudo dpkg -i teamviewer***.deb

sudo apt install -f

sudo apt install teamviewer***.deb

卸载:

apt purge teamviewer

六,安装terminator

1.sudo apt-get install terminator

.cd ~/.config/terminator/ && sudo vim config   (配置)

[global_config]
  focus = system
  suppress_multiple_term_dialog = True
  title_transmit_bg_color = "#d30102"
[keybindings]
[layouts]
  [[default]]
    [[[child1]]]
      parent = window0
      profile = default
      type = Terminal
    [[[window0]]]
      parent = ""
      type = Window
[plugins]
[profiles]
  [[default]]
    background_color = "#2d2d2d"
    background_darkness = 0.85
    background_image = None
    copy_on_selection = True
    cursor_color = "#ff0000"
    font = Ubuntu Mono 13
    foreground_color = "#eee9e9"
    palette = "#2d2d2d:#f2777a:#99cc99:#ffcc66:#6699cc:#cc99cc:#66cccc:#d3d0c8:#747369:#f2777a:#99cc99:#ffcc66:#6699cc:#cc99cc:#66cccc:#f2f0ec"
    scrollback_infinite = True
    show_titlebar = False
    use_system_font = False

3.若遇见闪退

是因为默认版本是python3,而其要依赖python2

sudo gedit /usr/share/terminator/terminator

将第一行的#!/usr/bin/python修改为#!/usr/bin/python2 

4.终端配置颜色

vim ~/.bashrc

在最后行添加

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;35;40m\]\u\[\033[00;00;40m\]@\[\033[01;35;40m\]\h\[\033[00;31;40m\]:\[\033[00;00;40m\]\w \[\033[01;32;40m\]\$ \[\033[01;37;40m\]'

source ~/.bashrc

七,安装sublime并可以写入中文

1.安装:

sudo add-apt-repository ppa:webupd8team/sublime-text-3

sudo apt-get update

sudo apt-get install sublime-text-installer

2.安装中文字体:

git clone https://github.com/lyfeyaj/sublime-text-imfix.git

cd sublime-text-imfix

./sublime-imfix

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值