├── Alfresco-Install-And-Usage.md ├── Bash-Other-Bash.md ├── Bash.md ├── CentOS-7-Install.md ├── CentOS-Install.md ├── CentOS-Virtual-Machine-Copy-Settings.md ├── CentOS.md ├── CentOS6-and-CentOS7.md ├── Crontab.md ├── Daemontools.md ├── Docker-Install-And-Usage.md ├── Dubbo-Install-And-Settings.md ├── ELK-Install-And-Settings.md ├── Elasticsearch-Base.md ├── FTP.md ├── FastDFS-Install-And-Settings.md ├── FastDFS-Nginx-Lua-GraphicsMagick.md ├── File-Extract-Compress.md ├── Gitlab-Install-And-Settings.md ├── Hsk-Install.md ├── Iptables.md ├── JDK-Install.md ├── Jenkins-Install-And-Settings.md ├── Jira-Install-And-Settings.md ├── Kibana-Base.md ├── LDAP-Install-And-Settings.md ├── Linux.md ├── Logstash-Base.md ├── Maven-Install-And-Settings.md ├── MongoDB-Install-And-Settings.md ├── Mycat-Install-And-Settings.md ├── Mysql-Install-And-Settings.md ├── Mysql-Optimize.md ├── Mysql-Test.md ├── Mysql-Tutorial.md ├── NFS.md ├── NTP.md ├── Nexus-Install-And-Settings.md ├── Nginx-Install-And-Settings.md ├── Nginx-Keepalived-Install-And-Settings.md ├── Nmon.md ├── Off-line-Yum-Install.md ├── Openfire-Install-And-Settings.md ├── README.md ├── RabbitMQ-Install-And-Settings.md ├── Rap-Install-And-Settings.md ├── Redis-Install-And-Settings.md ├── SSH.md ├── SUMMARY.md ├── SVN-Install-And-Settings.md ├── Samba.md ├── Sed.md ├── Shell.md ├── Solr-Install-And-Settings.md ├── TOC.md ├── TeamCity-Install-And-Settings.md ├── Tmux-Install-And-Settings.md ├── Tomcat-Install-And-Settings.md ├── Ubuntu-Install-VMware.md ├── Ubuntu-Install.md ├── Ubuntu-Popular-Software.md ├── Ubuntu-Specific-Command.md ├── Ubuntu.md ├── VPN.md ├── Vim-Install-And-Settings.md ├── Was-Hacked.md ├── Zookeeper-Install.md ├── Zsh.md ├── centos-settings ├── CentOS-Extra-Packages.md ├── CentOS-Network-Settings.md ├── Clear-Cache.md ├── Clear-Tmp-Directory.md ├── Close-XWindow.md ├── Cpu-Info.md └── centos-settings-toc.md ├── config.json ├── cover ├── background.jpg ├── cover.jpg └── logo.png ├── favorite-file ├── Keepalived-Settings │ └── nginx_check.sh ├── MySQL-Settings │ └── MySQL-5.6 │ │ ├── 1G-Memory-Machine │ │ ├── my-for-comprehensive.cnf │ │ ├── my-for-master.cnf │ │ └── my-for-salve.cnf │ │ ├── 8G-Memory-Machine │ │ └── my.cnf │ │ └── developer │ │ └── my-Windows-8G-开发机.ini ├── Nginx-Settings │ ├── nginx │ └── nginx.conf ├── Tomcat-Settings │ └── server.xml ├── redis │ └── redis ├── shell │ ├── install_mysql.sh │ ├── install_nginx.sh │ ├── install_redis.sh │ ├── install_vim_zsh.sh │ └── repo_install.sh └── zsh │ └── .zshrc ├── images ├── Alfresco-Install-And-Settings-a-1.jpg ├── Alfresco-Install-And-Settings-a-2.jpg ├── Alfresco-Install-And-Settings-a-3.jpg ├── Alfresco-Install-And-Settings-a-4.jpg ├── CentOS-7-Install-a-1.jpg ├── CentOS-7-Install-a-10.jpg ├── CentOS-7-Install-a-11.jpg ├── CentOS-7-Install-a-12.jpg ├── CentOS-7-Install-a-13.jpg ├── CentOS-7-Install-a-14.jpg ├── CentOS-7-Install-a-15.jpg ├── CentOS-7-Install-a-16.jpg ├── CentOS-7-Install-a-2.jpg ├── CentOS-7-Install-a-3.jpg ├── CentOS-7-Install-a-4.jpg ├── CentOS-7-Install-a-5.jpg ├── CentOS-7-Install-a-6.jpg ├── CentOS-7-Install-a-7.jpg ├── CentOS-7-Install-a-8.jpg ├── CentOS-7-Install-a-9.jpg ├── CentOS-Extra-Packages-a-1.jpg ├── CentOS-Extra-Packages-a-2.jpg ├── CentOS-Install-VirtualBox-a-1.jpg ├── CentOS-Install-VirtualBox-a-12.jpg ├── CentOS-Install-VirtualBox-a-13.jpg ├── CentOS-Install-VirtualBox-a-14.jpg ├── CentOS-Install-VirtualBox-a-15.jpg ├── CentOS-Install-VirtualBox-a-16.jpg ├── CentOS-Install-VirtualBox-a-17.jpg ├── CentOS-Install-VirtualBox-a-18.jpg ├── CentOS-Install-VirtualBox-a-19.jpg ├── CentOS-Install-VirtualBox-a-2.jpg ├── CentOS-Install-VirtualBox-a-20.jpg ├── CentOS-Install-VirtualBox-a-21.jpg ├── CentOS-Install-VirtualBox-a-22.jpg ├── CentOS-Install-VirtualBox-a-23.jpg ├── CentOS-Install-VirtualBox-a-24.jpg ├── CentOS-Install-VirtualBox-a-25.jpg ├── CentOS-Install-VirtualBox-a-3.jpg ├── CentOS-Install-VirtualBox-a-4.jpg ├── CentOS-Install-VirtualBox-a-5.jpg ├── CentOS-Install-VirtualBox-a-6.jpg ├── CentOS-Install-VirtualBox-a-7.jpg ├── CentOS-Install-VirtualBox-a-8.jpg ├── CentOS-Install-VirtualBox-a-9.jpg ├── CentOS-Install-VirtualBox-b-1.gif ├── CentOS-Network-Settings-a-1.jpg ├── CentOS-Network-Settings-a-2.jpg ├── CentOS-Virtual-Machine-Copy-Settings-a-1.png ├── CentOS-install-VMware-a-1.jpg ├── CentOS-install-VMware-a-10.jpg ├── CentOS-install-VMware-a-11.jpg ├── CentOS-install-VMware-a-12.jpg ├── CentOS-install-VMware-a-13.jpg ├── CentOS-install-VMware-a-14.jpg ├── CentOS-install-VMware-a-15.jpg ├── CentOS-install-VMware-a-16.jpg ├── CentOS-install-VMware-a-17.jpg ├── CentOS-install-VMware-a-18.jpg ├── CentOS-install-VMware-a-19.jpg ├── CentOS-install-VMware-a-2.jpg ├── CentOS-install-VMware-a-20.jpg ├── CentOS-install-VMware-a-21.jpg ├── CentOS-install-VMware-a-22.jpg ├── CentOS-install-VMware-a-23.jpg ├── CentOS-install-VMware-a-24.jpg ├── CentOS-install-VMware-a-25.jpg ├── CentOS-install-VMware-a-3.jpg ├── CentOS-install-VMware-a-4.jpg ├── CentOS-install-VMware-a-5.jpg ├── CentOS-install-VMware-a-6.jpg ├── CentOS-install-VMware-a-7.jpg ├── CentOS-install-VMware-a-8.jpg ├── CentOS-install-VMware-a-9.jpg ├── CentOS-install-VMware-b-1.gif ├── CentOS-install-VMware-b-2.gif ├── CentOS6-and-CentOS7-a-1.png ├── Crontab-a-1.jpg ├── FTP-a-1.jpg ├── FastDFS-a-1.jpg ├── Iptables-a-1.jpg ├── Jira-Install-And-Settings-a-1.jpg ├── Jira-Install-And-Settings-a-2.jpg ├── Jira-Install-And-Settings-a-3.jpg ├── Jira-Install-And-Settings-a-4.jpg ├── Jira-Install-And-Settings-a-5.jpg ├── Jira-Install-And-Settings-a-6.jpg ├── Ldap-Install-And-Settings-a-1.png ├── NTP-a-1.jpg ├── Nexus-Install-And-Settings-a-1.jpg ├── Nexus-Install-And-Settings-a-2.gif ├── Openfire-Settings-a-1.jpg ├── Openfire-Settings-a-10.jpg ├── Openfire-Settings-a-11.jpg ├── Openfire-Settings-a-12.jpg ├── Openfire-Settings-a-13.jpg ├── Openfire-Settings-a-2.jpg ├── Openfire-Settings-a-3.jpg ├── Openfire-Settings-a-4.jpg ├── Openfire-Settings-a-5.jpg ├── Openfire-Settings-a-6.jpg ├── Openfire-Settings-a-7.jpg ├── Openfire-Settings-a-8.jpg ├── Openfire-Settings-a-9.jpg ├── RabbitMQ-Add-User-a-1.jpg ├── RabbitMQ-Add-User-a-2.jpg ├── RabbitMQ-Add-User-a-3.gif ├── RabbitMQ-Bindings-Queue-a-1.gif ├── Redis-GUI-a-1.jpg ├── SVN-Install-And-Settings-a-1.jpg ├── SVN-Install-And-Settings-a-2.jpg ├── SVN-Install-And-Settings-a-3.jpg ├── SVN-Install-And-Settings-a-4.jpg ├── Ubuntu-a-1.jpg ├── Ubuntu-a-2.jpg ├── Ubuntu-a-3.jpg ├── Ubuntu-a-4.jpg ├── Ubuntu-a-5.jpg ├── Ubuntu-a-6.jpg ├── Vim-Cut-And-Paste-a-1.png ├── Zsh-a-1.jpg ├── Zsh-b-1.jpg ├── Zsh-c-1.jpg └── Zsh-d-1.jpg ├── maintenance.md ├── other.md └── ubuntu-settings ├── Network-Settings.md ├── Ubuntu-Create-Desktop.md ├── Ubuntu-Extra-Packages.md ├── Ubuntu-Popular-Settings.md └── ubuntu-settings-toc.md /Alfresco-Install-And-Usage.md: -------------------------------------------------------------------------------- 1 | # Alfresco 使用 2 | 3 | ## Alfresco 介绍 4 | 5 | - 官网: 6 | - 开源社区版下载: 7 | - 官网文档说明: 8 | - 开源社区版本安装说明: 9 | - Linux 版本安装说明: 10 | - 我的目的:用来管理公司发布的文档,比如:Word、Excel、记事本等这类,该系统支持在线预览文件。 11 | 12 | ## 环境说明 13 | 14 | - CentOS 7.3 带有图形桌面(需要有) 15 | - 下载下来的软件:**alfresco-community-installer-201704-linux-x64_3.bin**,大小:822M 16 | - 安装包存放目录:/opt 17 | 18 | ## 开始安装: 19 | 20 | - 使用 Linux 桌面方式进入系统,打开终端: 21 | - 切换目录:`cd /opt` 22 | - 赋予权限:`chmod +x alfresco-community-installer-201704-linux-x64_3.bin` 23 | - `./alfresco-community-installer-201704-linux-x64_3.bin` 24 | - 然后会出现如下图这种步骤引导安装界面,带有简体中文版,选择 `简单` 的基本流程安装方式,默认都是下一步下一步。其实选择 `高级` 也基本上是下一步下一步的,只是可以看到更多细节。 25 | - 在设置管理员密码上,我是:123456(默认用户名是:admin) 26 | 27 | ![alfresco 安装](images/Alfresco-Install-And-Settings-a-1.jpg) 28 | ![alfresco 安装](images/Alfresco-Install-And-Settings-a-2.jpg) 29 | 30 | - 安装完成后,可以选择开始启动程序。建议不勾选,我们来使用下面命令。 31 | - 程序默认是安装在:**/opt/alfresco-community** 32 | - 所以我们需要打开终端: 33 | - 切换目录:`cd /opt/alfresco-community` 34 | - 启动程序:`./alfresco.sh start` 35 | - 停止程序:`./alfresco.sh stop` 36 | - 启动完成后,用浏览器打开:(如果你 Linux 防火墙关闭了,也可以直接用其他机子直接访问,把这台机子当做服务器用),可以看到如下内容: 37 | 38 | ![alfresco 安装](images/Alfresco-Install-And-Settings-a-3.jpg) 39 | ![alfresco 安装](images/Alfresco-Install-And-Settings-a-4.jpg) 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Bash-Other-Bash.md: -------------------------------------------------------------------------------- 1 | # Bash 其他常用命令 2 | 3 | ## 其他常用命令 4 | 5 | - 编辑 hosts 文件:`vim /etc/hosts`,添加内容格式:`127.0.0.1 www.youmeek.com` 6 | - RPM 文件操作命令: 7 | - 安装 8 | - `rpm -i example.rpm`,安装 example.rpm 包 9 | - `rpm -iv example.rpm`,安装 example.rpm 包并在安装过程中显示正在安装的文件信息 10 | - `rpm -ivh example.rpm`,安装 example.rpm 包并在安装过程中显示正在安装的文件信息及安装进度 11 | - 查询 12 | - `rpm -qa | grep jdk`,查看 jdk 是否被安装 13 | - 卸载 14 | - `rpm -e jdk`,卸载 jdk(一般卸载的时候都要先用 rpm -qa 看下整个软件的全名) 15 | - YUM 软件管理: 16 | - `yum install -y httpd`,安装 apache 17 | - `yum remove -y httpd`,卸载 apache 18 | - `yum info -y httpd`,查看 apache 版本信息 19 | - `yum list --showduplicates httpd`,查看可以安装的版本 20 | - `yum install httpd-查询到的版本号`,安装指定版本 21 | - 更多命令可以看: 22 | - 查看某个配置文件,排除掉里面以 # 开头的注释内容: 23 | - `grep '^[^#]' /etc/openvpn/server.conf` 24 | - 查看某个配置文件,排除掉里面以 # 开头和 ; 开头的注释内容: 25 | - `grep '^[^#;]' /etc/openvpn/server.conf` 26 | 27 | ## 资料 28 | 29 | 30 | -------------------------------------------------------------------------------- /CentOS-7-Install.md: -------------------------------------------------------------------------------- 1 | # CentOS 安装 2 | 3 | 4 | ## 概括 5 | 6 | - 本教程中主要演示了 VMware Workstation 下安装 `CentOS 7.3` 的过程。 7 | - VMware 的使用细节可以看这篇:[CentOS 6 安装](CentOS-Install.md) 8 | 9 | ## VMware 下安装 CentOS 过程 10 | 11 | - VMware Workstation 的介绍和下载 12 | - 官网: 13 | - wiki: 14 | - 百度 wiki: 15 | - 百度云下载(64 位): 16 | - 官网下载: 17 | 18 | 19 | - 安装细节开始: 20 | - ![VMware 下安装](images/CentOS-7-Install-a-1.jpg) 21 | - ![VMware 下安装](images/CentOS-7-Install-a-2.jpg) 22 | - ![VMware 下安装](images/CentOS-7-Install-a-3.jpg) 23 | - ![VMware 下安装](images/CentOS-7-Install-a-4.jpg) 24 | - ![VMware 下安装](images/CentOS-7-Install-a-5.jpg) 25 | - 如上图,默认是最小安装,点击进去,选择桌面安装。 26 | - 如上图,默认是自动分区,如果懂得分区,点击进去,进行手动分区,CentOS 7 少了主分区,逻辑分区的选择了。 27 | - ![VMware 下安装](images/CentOS-7-Install-a-6.jpg) 28 | - 如上图,root 密码必须设置,我习惯测试的时候是:123456 29 | - 我没有创建用户,喜欢用 root 30 | - ![VMware 下安装](images/CentOS-7-Install-a-7.jpg) 31 | - ![VMware 下安装](images/CentOS-7-Install-a-8.jpg) 32 | - 如上图,许可证必须点击进去勾选同意相关协议。 33 | - 如上图,网络可以稍后在设置,主机名可以现在先填写 34 | - ![VMware 下安装](images/CentOS-7-Install-a-9.jpg) 35 | - ![VMware 下安装](images/CentOS-7-Install-a-10.jpg) 36 | - ![VMware 下安装](images/CentOS-7-Install-a-11.jpg) 37 | - ![VMware 下安装](images/CentOS-7-Install-a-12.jpg) 38 | - 如上图右上角,一般我们都选择跳过 39 | - ![VMware 下安装](images/CentOS-7-Install-a-13.jpg) 40 | - ![VMware 下安装](images/CentOS-7-Install-a-14.jpg) 41 | - ![VMware 下安装](images/CentOS-7-Install-a-15.jpg) 42 | - ![VMware 下安装](images/CentOS-7-Install-a-16.jpg) 43 | - 到此完成,其他该做啥就做啥 -------------------------------------------------------------------------------- /CentOS-Install.md: -------------------------------------------------------------------------------- 1 | # CentOS 安装 2 | 3 | 4 | ## 概括 5 | 6 | - 本教程中主要演示了 VirtualBox 和 VMware Workstation 下安装 `CentOS 6.6` 的过程。 7 | - VirtualBox 是免费开源,我个人在使用经历中遇到过很多次崩溃、安装有问题等,所以它不是我主推的虚拟机 8 | - VMware Workstation 是商业软件,很好用,一些辅助功能也很到位,主推该虚拟机。 9 | 10 | 11 | ## VirtualBox 下安装 CentOS 过程 12 | 13 | - VirtualBox 的介绍和下载 14 | - 官网: 15 | - wiki: 16 | - 百度 wiki: 17 | - 百度云下载(32 位和 64 位一体): 18 | - 官网下载: 19 | 20 | 21 | - 安装细节开始: 22 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-a-1.jpg) 23 | - 如上图标注 1 所示:点击 `新建` 一个虚拟机。 24 | - 如上图标注 2 所示:在填写 `名称` 的时候,输入 `CentOS` 相关字眼的时候,下面的版本类型会跟着变化,自动识别为 `Red Hat` 25 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-a-2.jpg) 26 | - 如上图标注 1 所示:我们装的是 64 位系统,如果你本机内存足够大,建议可以给 2 ~ 4 G 的容量 27 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-a-3.jpg) 28 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-a-4.jpg) 29 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-a-5.jpg) 30 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-a-6.jpg) 31 | - 如上图所示,命名最好规范,最好要带上系统版本号,硬盘大小建议在 8 ~ 20 G 32 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-b-1.gif) 33 | - 如上图 gif 演示,当我们创建好虚拟机之后,需要选择模拟光驱进行系统镜像安装 34 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-a-7.jpg) 35 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-a-8.jpg) 36 | - 如上图箭头所示,我们这里选择 `Skip`,跳过对镜像的检查,这个一般需要检查很久,而且我们用 iso 文件安装的,一般没这个必要 37 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-a-9.jpg) 38 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-a-12.jpg) 39 | - 如上图标注 1 所示,建议 Linux 纯新手使用简体中文环境 40 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-a-13.jpg) 41 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-a-14.jpg) 42 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-a-15.jpg) 43 | - 如上图标注 1 所示,因为我们是用全新的虚拟机,虚拟出来的硬盘都是空的,所以这里可以忽略所有数据 44 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-a-16.jpg) 45 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-a-17.jpg) 46 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-a-18.jpg) 47 | - 再次强调下,root 账号也就是图上所说的 `根账号`,它是最顶级账号,密码最好别忘记了 48 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-a-19.jpg) 49 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-a-20.jpg) 50 | - 如上图标注 1 所示,因为我们是用全新的虚拟机,所以这里选择 `使用所有空间` ,然后 CentOS 会按它默认的方式进行分区 51 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-a-21.jpg) 52 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-a-22.jpg) 53 | - `Desktop` 代表:图形界面版,会默认安装很多软件,建议新手选择此模式,我后面其他文章的讲解都是基于此系统下,如果你不是此模式的系统可能在安装某些软件的时候会出现某些依赖包没有安装的情况 54 | - `basic sever` 代表:命令行界面,有良好基础的基本都会喜欢这个 55 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-a-23.jpg) 56 | - 上一步我选择的是 `Desktop` 所以有很多软件需要安装,这个过程大概需要 5 ~ 10 分钟 57 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-a-24.jpg) 58 | - 安装完成 59 | - ![VirtualBox 下安装](images/CentOS-Install-VirtualBox-a-25.jpg) 60 | - 安装完成后一定要把盘片删除,防止系统启动的时候去读盘,重新进入安装系统模式 61 | 62 | 63 | ## VMware 下安装 CentOS 过程 64 | 65 | - VMware Workstation 的介绍和下载 66 | - 官网: 67 | - wiki: 68 | - 百度 wiki: 69 | - 百度云下载(64 位): 70 | - 官网下载: 71 | 72 | 73 | - 安装细节开始: 74 | - ![VMware 下安装](images/CentOS-install-VMware-a-1.jpg) 75 | - ![VMware 下安装](images/CentOS-install-VMware-a-2.jpg) 76 | - 默认 VMware 选择的是 `典型` 我不推荐,我下面的步骤是选择 `自定义(高级)`。如果你非常了解 Linux 系统倒是可以考虑选择 `典型`,在它默认安装完的系统上可以很好地按你的需求进行修改 77 | - ![VMware 下安装](images/CentOS-install-VMware-a-3.jpg) 78 | - ![VMware 下安装](images/CentOS-install-VMware-a-4.jpg) 79 | - 牢记:不要在这一步就选择镜像文件,不然也会直接进入 `典型` 模式,直接按它的规则进行系统安装 80 | - ![VMware 下安装](images/CentOS-install-VMware-a-5.jpg) 81 | - ![VMware 下安装](images/CentOS-install-VMware-a-6.jpg) 82 | - ![VMware 下安装](images/CentOS-install-VMware-a-7.jpg) 83 | - ![VMware 下安装](images/CentOS-install-VMware-a-8.jpg) 84 | - ![VMware 下安装](images/CentOS-install-VMware-a-9.jpg) 85 | - 桥接模式:(建议选择此模式)创建一个独立的虚拟主机,在桥接模式下的虚拟主机网络一般要为其配 IP 地址、子网掩码、默认网关(虚拟机ip地址要与主机ip地址处于同网段) 86 | - NAT 模式:把物理主机作为路由器进行访问互联网,优势:联网简单,劣势:虚拟主机无法与物理主机通讯 87 | - 主机模式:把虚拟主机网络与真实网络隔开,但是各个虚拟机之间可以互相连接,虚拟机和物理机也可以连接 88 | - > 上面解释来源: 89 | - ![VMware 下安装](images/CentOS-install-VMware-a-10.jpg) 90 | - Buslogic 和 LSIlogic 都是虚拟硬盘 SCSI 设备的类型,旧版本的 OS 默认的是 Buslogic,LSIlogic 类型的硬盘改进了性能,对于小文件的读取速度有提高,支持非 SCSI 硬盘比较好。 91 | - > 上面解释来源: 92 | - ![VMware 下安装](images/CentOS-install-VMware-a-11.jpg) 93 | - ![VMware 下安装](images/CentOS-install-VMware-a-12.jpg) 94 | - ![VMware 下安装](images/CentOS-install-VMware-a-13.jpg) 95 | - 强烈建议至少要给 20 G,不然装不了多少软件的 96 | - ![VMware 下安装](images/CentOS-install-VMware-a-14.jpg) 97 | - ![VMware 下安装](images/CentOS-install-VMware-a-15.jpg) 98 | - ![VMware 下安装](images/CentOS-install-VMware-b-1.gif) 99 | - 如上图 gif 所示,在创建完虚拟机之后,我们要加载系统镜像,然后启动虚拟机进行安装,接下来的安装步骤跟上面使用 VirtualBox 安装细节基本一样,不一样的地方是我这里选择的是自定义分区,不再是选择默认分区方式 100 | - ![VMware 下安装](images/CentOS-install-VMware-a-16.jpg) 101 | - 如上图箭头所示,这里我们选择自定义分区方式 102 | - ![VMware 下安装](images/CentOS-install-VMware-b-2.gif) 103 | - 如上图 gif 所示,我只把最基本的区分出来,如果你有自己的需求可以自己设置 104 | - 简单分区方案: 105 | - `/boot` == 500 M(主分区) 106 | - `/swap` == 2 G(逻辑分区)一般大家的说法这个大小是跟你机子的内存大小相关的,也有说法内存大不需要这个,但是还是建议分,虚拟机内存 2 G,所以我分 2 G 107 | - `/` == 剩余容量(逻辑分区)剩余的空间都给了根分区 108 | - ![VMware 下安装](images/CentOS-install-VMware-a-17.jpg) 109 | - ![VMware 下安装](images/CentOS-install-VMware-a-18.jpg) 110 | - ![VMware 下安装](images/CentOS-install-VMware-a-19.jpg) 111 | - ![VMware 下安装](images/CentOS-install-VMware-a-20.jpg) 112 | - ![VMware 下安装](images/CentOS-install-VMware-a-21.jpg) 113 | - ![VMware 下安装](images/CentOS-install-VMware-a-22.jpg) 114 | - ![VMware 下安装](images/CentOS-install-VMware-a-23.jpg) 115 | - ![VMware 下安装](images/CentOS-install-VMware-a-24.jpg) 116 | - ![VMware 下安装](images/CentOS-install-VMware-a-25.jpg) 117 | -------------------------------------------------------------------------------- /CentOS-Virtual-Machine-Copy-Settings.md: -------------------------------------------------------------------------------- 1 | # VMware 克隆 CentOS 后网卡信息修改 2 | 3 | ## 概述 4 | 5 | - 在我们需要多台 CentOS 虚拟机的时候,对已有虚拟机的系统进行克隆或是复制。但是这样做又有一个问题,克隆出来的虚拟机启动的时候你输入命令:`ifconfig`,eth0 网卡信息没了,只有一个 eth1。 对于处女座的人来讲这是不允许的。所以我们需要改动下。 6 | - 复制虚拟机后,首次打开该会提示如下内容,一般选择 copy 这个配置。 7 | - ![vim](images/CentOS-Virtual-Machine-Copy-Settings-a-1.png) 8 | 9 | 10 | 11 | ## 修改方法 12 | 13 | - 命令:`sudo vim /etc/udev/rules.d/70-persistent-net.rules` 14 | - 该文件中正常此时应该有两行信息 15 | - 在文件中把 NAME="eth0″ 的这一行注释掉 16 | - 对于另一行,把 NAME=”eth1″ 的这一行,把 NAME=”eth1″ 改为 NAME=”eth0″,并且把该行:ATTRS{address}=="00:0c:29:4c:46:01″ 这个属性信息记下来,每台机子都不一样,我这段信息只是例子,你不要直接复制我的。 17 | 18 | - 命令:`sudo vim /etc/sysconfig/network-scripts/ifcfg-eth0` 19 | - 修改 IP 地址 20 | - 把 HWADDR 的值改为上面要求记下来的:00:0c:29:4c:46:01 21 | 22 | - 命令:`nmcli con > /opt/info.txt` 23 | - 如果显示两行 UUID 的信息的话,复制不是 System eth0 的那个 UUID 值,下面有用。 24 | - 编辑:`sudo vim /etc/sysconfig/network-scripts/ifcfg-eth0` 25 | - 把文件中的 UUID 值 改为上面要求复制的 UUID 值。 26 | - 保存配置文件,重启系统,正常应该是可以了。 -------------------------------------------------------------------------------- /CentOS.md: -------------------------------------------------------------------------------- 1 | # CentOS 介绍 2 | 3 | - CentOS Wiki: 4 | - CentOS 百科: 5 | - CentOS 官网: 6 | - CentOS 的自我介绍: 7 | - CentOS 官网下载: 8 | - CentOS 官网下载(含有旧版本): 9 | - CentOS 国内镜像下载: 10 | - 版本更新记录: 11 | 12 | 13 | 14 | # CentOS 原型系统:Red Hat Enterprise Linux 15 | 16 | 17 | - Red Hat Enterprise Linux Wiki: 18 | - Red Hat Enterprise Linux 百科: 19 | - 衍生版本: 20 | 21 | 22 | # Red Hat Enterprise Linux 后花园系统:Fedora 23 | 24 | - Fedora Wiki: 25 | - Fedora 百科: 26 | - Fedora 官网: 27 | - Fedora 官网桌面版下载: 28 | - Fedora 官网文档: 29 | -------------------------------------------------------------------------------- /CentOS6-and-CentOS7.md: -------------------------------------------------------------------------------- 1 | # CentOS 6 和 CentOS 7 介绍 2 | 3 | ## 总体差异 4 | 5 | - ![总体差异](images/CentOS6-and-CentOS7-a-1.png) 6 | 7 | ## 想装回过去的一些工具 8 | 9 | - 安装:`yum install -y tree net-tools bind-utils tree sysstat vim-en* lrzsz NetworkManager-tui ntp ntpdate iftop tcpdump telnet traceroute` 10 | 11 | ## 查看版本号/主机名 12 | 13 | - `cat /etc/redhat-release` 14 | - `cat /etc/hostname` 15 | 16 | ## 常用配置差异 17 | 18 | - [CentOS 网络配置](centos-settings/CentOS-Network-Settings.md) 19 | - [CentOS 图形界面的关闭与开启](centos-settings/Close-XWindow.md) 20 | 21 | ## systemctl 的用法 22 | 23 | - 相当于 CentOS 6 的:service nginx stop 24 | - `systemctl is-enabled iptables.service` #查询服务是否开机启动 25 | - `systemctl enable iptables.service` #开机运行服务 26 | - `systemctl disable iptables.service` #取消开机运行 27 | - `systemctl start iptables.service` #启动服务 28 | - `systemctl stop iptables.service` #停止服务 29 | - `systemctl restart iptables.service` #重启服务 30 | - `systemctl reload iptables.service` #重新加载服务配置文件 31 | - `systemctl status iptables.service` #查询服务运行状态 32 | - `systemctl --failed` #显示启动失败的服务 33 | - `systemctl list-units --type=service` #查看所有服务 34 | - `systemctl is-enabled httpd` #查看httpd服务是否开机启动 35 | - 对于启动脚本的存放位置,也不再是 `/etc/init.d/`(这个目录也是存在的),而是 `/usr/lib/systemd/system/` 36 | 37 | ### 开放端口 38 | 39 | - 添加端口:`firewall-cmd --zone=public --add-port=8883/tcp --permanent` 40 | - 重启防火墙:`firewall-cmd --reload` 41 | - 命令解释: 42 | - `--zone` #作用域 43 | - `--add-port=80/tcp` #添加端口,格式为:端口/通讯协议 44 | - `--permanent` #永久生效,没有此参数重启后失效 45 | - 列出所有端口列表:`firewall-cmd --list-all` 46 | 47 | 48 | ## 关闭 firewall 使用 iptables 49 | 50 | - 关闭 firewall 51 | - `systemctl stop firewalld.service` #停止firewall 52 | - `systemctl disable firewalld.service` #禁止firewall开机启动 53 | - 安装 iptables 54 | - `yum install -y iptables-services` 55 | - 启动 iptables 56 | - `systemctl restart iptables.service` #最后重启防火墙使配置生效 57 | - `systemctl enable iptables.service` #设置防火墙开机启动 58 | - 其他使用照旧 59 | 60 | ## ifconfig 没有了 61 | 62 | - 查看网络配置:`ip a` 63 | - 装回 ifconfig:`yum install -y net-tools` 64 | 65 | ## 设置时区 66 | 67 | - `timedatectl set-timezone Asia/Shanghai` 68 | - `timedatectl status` 69 | 70 | 71 | ## 资料 72 | 73 | - 74 | - 75 | - 76 | - 77 | -------------------------------------------------------------------------------- /Crontab.md: -------------------------------------------------------------------------------- 1 | # Crontab 介绍 2 | 3 | 4 | ## Crontab 安装 5 | 6 | - 查看是否已安装: 7 | - CentOS:`rpm -qa | grep cron` 8 | - Ubuntu:`dpkg -l | grep cron` 9 | 10 | - 安装(一般系统是集成的): 11 | - CentOS 6:`sudo yum install -y vixie-cron crontabs` 12 | - Ubuntu:`sudo apt-get install -y cron` 13 | 14 | ## Crontab 服务器配置文件常用参数 15 | 16 | - 配置文件介绍(记得先备份):`sudo vim /etc/crontab` 17 | - 该配置格式解释: 18 | - ![Crontab 服务器配置文件常用参数](images/Crontab-a-1.jpg) 19 | - 常用例子介绍: 20 | - 30 21 * * * service httpd restart #每晚的 21:30 重启 apache 21 | - 45 4 1,10,22 * * service httpd restart #每月的 1、10、22 日的 4:45 重启 apache 22 | - 45 4 1-10 * * service httpd restart #每月的 1 到 10 日的 4:45 重启 apache 23 | - */2 * * * * service httpd restart #每隔两分钟重启 apache 24 | - 1-59/2 * * * * service httpd restart #每隔两分钟重启 apache(这个比较特殊:1-59/2 这个表示过掉0分,从 1 分开始算,每隔两分执行,所以 1 分执行了,3 分执行了,5 分执行了....都是奇数进行执行。默认的 */2 都是偶数执行。) 25 | - 0 23-7/2 * * * service httpd restart #晚上 11 点到早上 7 点之间,每隔 2 个小时重启 apache 26 | - 0-59/30 18-23 * * * service httpd restart #每天 18:00 到 23:00 之间,每隔 30 分钟重启 apache(方法一) 27 | - 0,30 18-23 * * * service httpd restart #每天 18:00 到 23:00 之间,每隔 30 分钟重启 apache(方法二) 28 | - 执行记录日志:`cd /var/log/cron` 29 | 30 | ## Crontab 资料 31 | 32 | - 33 | - 34 | -------------------------------------------------------------------------------- /Daemontools.md: -------------------------------------------------------------------------------- 1 | # daemontools 工具 2 | 3 | ## supervisord 4 | 5 | - 注意:Supervisor 能管理非 daemon 的进程,也就是说 Supervisor 不能管理守护进程。否则提示 Exited too quickly (process log may have details) 异常。 6 | - 官网: 7 | - 安装过程: 8 | - 解释:easy_install 是 setuptools 包里带的一个命令,使用 easy_install 实际上是在调用 setuptools 来完成安装模块的工作,所以安装 setuptools 即可。 9 | - 安装: 10 | - `yum -y install python-setuptools` 11 | - `easy_install supervisor` 12 | - 生成配置文件: 13 | - `echo_supervisord_conf > /etc/supervisord.conf` 14 | - 创建专门的程序配置文件目录、日志目录: 15 | - `mkdir -p /var/log/supervisor` 16 | - `mkdir -p /etc/supervisor/conf.d/` 17 | - `echo -e "[include]\nfiles = /etc/supervisor/conf.d/*.conf">>/etc/supervisord.conf` 18 | - 安装完成的内容介绍:supervisor 安装完成后会生成三个执行程序: 19 | - supervisortd:supervisor 的守护进程服务(用于接收进程管理命令) 20 | - supervisorctl:客户端(用于和守护进程通信,发送管理进程的指令) 21 | - echo_supervisord_conf:生成初始配置文件程序。 22 | - 程序位置:`/usr/bin/supervisord` 23 | - 配置文件位置:`/etc/supervisord.conf` 24 | 25 | ### Logstash 进程进行守护 26 | 27 | - 默认安装完 Supervisor 是已经启动的,所以在加入新配置之前,需要先停止程序:`ps -ef | grep supervisord`,kill 对应的 pid 28 | - 创建配置文件:`vim /etc/supervisor/conf.d/logstash.conf` 29 | 30 | ``` nginx 31 | [program:gitnavi-logstash] 32 | command=/usr/program/elk/logstash-2.4.1/bin/logstash -f /usr/program/elk/logstash-2.4.1/config/logstash.conf 33 | stdout_logfile=/var/log/supervisor/supervisord-logstash.log 34 | stderr_logfile=/var/log/supervisor/supervisord-logstash-err.log 35 | user=root 36 | autostart=true 37 | autorestart=true 38 | startsecs=5 39 | priority=1 40 | stopasgroup=true 41 | killasgroup=true 42 | ``` 43 | 44 | - 启动程序(默认会启动所有子任务):`/usr/bin/supervisord -c /etc/supervisord.conf` 45 | - 管理子任务的命令: 46 | - 启动所有子任务:`/usr/bin/supervisorctl start all` 47 | - 结束所有子任务:`/usr/bin/supervisorctl stop all` 48 | - 只载入最新的配置文件, 并不重启任何进程:`/usr/bin/supervisorctl reread` 49 | - 载入最新的配置文件,停止原来的所有进程并按新的配置启动管理所有进程:`/usr/bin/supervisorctl reload` 50 | - 根据最新的配置文件,启动新配置或有改动的进程,配置没有改动的进程不会受影响而重启:`/usr/bin/supervisorctl update` 51 | - 查看所有子任务状态,如果没有运行的子任务则是没有任何反馈信息:`/usr/bin/supervisorctl status` 52 | - 管理所有子任务也可以用交互方式,输入命令:`supervisorctl`,会进入 supervisord 的交互模式下,如果当前有启动的任务,还可以看到对应的任务情况。 53 | - 在该交互下可以停止指定名称的子任务,比如 logstash 任务:`stop gitnavi-logstash` 54 | - 也可以停止所有子任务:`stop all` 55 | - 也可以启动所有子任务:`start all` 56 | - 更多命令可以输入:`help` 57 | 58 | ### 设置 supervisord 开启自启动 59 | 60 | #### CentOS 6 61 | 62 | - 创建文件:`vim /etc/init.d/supervisord` 63 | 64 | ``` nginx 65 | #!/bin/sh 66 | # 67 | # Supervisor is a client/server system that 68 | # allows its users to monitor and control a 69 | # number of processes on UNIX-like operating 70 | # systems. 71 | # 72 | # chkconfig: - 64 36 73 | # description: Supervisor Server 74 | # processname: supervisord 75 | # Source init functions 76 | . /etc/init.d/functions 77 | RETVAL=0 78 | prog="supervisord" 79 | pidfile="/tmp/supervisord.pid" 80 | lockfile="/var/lock/subsys/supervisord" 81 | start() 82 | { 83 | echo -n $"Starting $prog: " 84 | daemon --pidfile $pidfile supervisord -c /etc/supervisord.conf 85 | RETVAL=$? 86 | echo 87 | [ $RETVAL -eq 0 ] && touch ${lockfile} 88 | } 89 | stop() 90 | { 91 | echo -n $"Shutting down $prog: " 92 | killproc -p ${pidfile} /usr/bin/supervisord 93 | RETVAL=$? 94 | echo 95 | if [ $RETVAL -eq 0 ] ; then 96 | rm -f ${lockfile} ${pidfile} 97 | fi 98 | } 99 | case "$1" in 100 | start) 101 | start ;; 102 | stop) stop ;; 103 | status) 104 | status $prog ;; 105 | restart) 106 | stop 107 | start ;; 108 | *) 109 | echo "Usage: $0 {start|stop|restart|status}" ;; 110 | esac 111 | ``` 112 | 113 | 114 | - `chmod 755 /etc/init.d/supervisord` 115 | - `chkconfig supervisord on` 116 | - 以后启动可以用:`service supervisord start` 117 | - 以后停止可以用:`service supervisord stop` 118 | 119 | 120 | #### CentOS 7 121 | 122 | - 创建文件:`vim /lib/systemd/system/supervisor.service` 123 | 124 | ``` ini 125 | [Unit] 126 | Description=supervisor 127 | After=network.target 128 | 129 | [Service] 130 | Type=forking 131 | ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf 132 | ExecStop=/usr/bin/supervisorctl $OPTIONS shutdown 133 | ExecReload=/usr/bin/supervisorctl $OPTIONS reload 134 | KillMode=process 135 | Restart=on-failure 136 | RestartSec=42s 137 | 138 | [Install] 139 | WantedBy=multi-user.target 140 | ``` 141 | 142 | - `chmod 766 /lib/systemd/system/supervisor.service` 143 | - `systemctl enable supervisor.service` 144 | - `systemctl daemon-reload` 145 | 146 | ## 资料 147 | 148 | - 149 | - 150 | - 151 | - 152 | - 153 | - -------------------------------------------------------------------------------- /Dubbo-Install-And-Settings.md: -------------------------------------------------------------------------------- 1 | # Dubbo 环境安装和配置 2 | 3 | 4 | ## Dubbo-Admin 搭建 5 | 6 | ### 需要环境 7 | 8 | - CentOS 6 9 | - JDK 1.8(必须是 1.8) 10 | - Tomcat 7 或 8(我测试都可以) 11 | - Dubbo 版本:2.5.4-SNAPSHOT(当前这个版本是最新的。2.5.3 我测试是不行的) 12 | - Dubbo-Admin 需要修改部分代码,让它支持 JDK 8,具体看文章: 13 | - 最终我的 Dubbo-admin 的 pom.xml 为这样的: 14 | 15 | 16 | ``` xml 17 | 32 | 34 | 4.0.0 35 | 36 | com.alibaba 37 | dubbo-parent 38 | 2.5.4-SNAPSHOT 39 | 40 | dubbo-admin 41 | war 42 | ${project.artifactId} 43 | The admin module of dubbo project 44 | 45 | 1.5 46 | / 47 | false 48 | false 49 | 50 | 51 | 52 | com.alibaba 53 | dubbo 54 | ${project.parent.version} 55 | 56 | 57 | org.springframework 58 | spring 59 | 60 | 61 | 62 | 63 | 64 | com.alibaba.citrus 65 | citrus-webx-all 66 | 3.1.6 67 | 68 | 69 | org.apache.velocity 70 | velocity 71 | 1.7 72 | 73 | 74 | 75 | org.javassist 76 | javassist 77 | 78 | 79 | org.jboss.netty 80 | netty 81 | 82 | 83 | org.apache.mina 84 | mina-core 85 | 86 | 87 | org.glassfish.grizzly 88 | grizzly-core 89 | 90 | 91 | org.apache.httpcomponents 92 | httpclient 93 | 94 | 95 | com.alibaba 96 | fastjson 97 | 98 | 99 | com.thoughtworks.xstream 100 | xstream 101 | 102 | 103 | org.apache.bsf 104 | bsf-api 105 | 106 | 107 | org.apache.zookeeper 108 | zookeeper 109 | 110 | 111 | com.github.sgroschupf 112 | zkclient 113 | 114 | 115 | com.netflix.curator 116 | curator-framework 117 | 118 | 119 | com.googlecode.xmemcached 120 | xmemcached 121 | 122 | 123 | org.apache.thrift 124 | libthrift 125 | 126 | 127 | com.caucho 128 | hessian 129 | 130 | 131 | javax.servlet 132 | servlet-api 133 | provided 134 | 135 | 136 | log4j 137 | log4j 138 | 139 | 140 | org.slf4j 141 | slf4j-api 142 | 143 | 144 | org.slf4j 145 | slf4j-log4j12 146 | 147 | 148 | redis.clients 149 | jedis 150 | 151 | 152 | javax.validation 153 | validation-api 154 | 155 | 156 | org.hibernate 157 | hibernate-validator 158 | 159 | 160 | javax.cache 161 | cache-api 162 | 163 | 164 | 165 | 166 | 167 | org.mortbay.jetty 168 | maven-jetty-plugin 169 | ${jetty_version} 170 | 171 | / 172 | 10 173 | 174 | 175 | 8080 176 | 60000 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | ``` 186 | 187 | - 部署在 Tomcat 之后,如果需要修改 zookeeper 的地址,以及默认用户的登录密码,可以在这里改:`vim /usr/program/tomcat8/webapps/ROOT/WEB-INF/dubbo.properties` 188 | - 里面内容: 189 | 190 | ``` ini 191 | dubbo.registry.address=zookeeper://127.0.0.1:2181 192 | dubbo.admin.root.password=root 193 | dubbo.admin.guest.password=guest 194 | ``` 195 | 196 | - 如果有多个节点构成的集群也可以这样写: 197 | 198 | ``` ini 199 | dubbo.registry.address=zookeeper://192.168.1.121:2181?backup=192.168.1.111:2181,192.168.1.112:2181 200 | dubbo.admin.root.password=root 201 | dubbo.admin.guest.password=guest 202 | ``` 203 | 204 | 205 | ## Dubbox-Admin 搭建 206 | 207 | ### 需要环境 208 | 209 | - CentOS 6 210 | - JDK 1.8(只测试过 1.8) 211 | - Tomcat 7 或 8(只测试过 8) 212 | - Dubbox 版本:dubbo-admin-2.8.4.war(fork 官网最新版本,自己编译的版本) 213 | - 不需要修改任何 pom.xml 文件,直接就可以运行。 -------------------------------------------------------------------------------- /ELK-Install-And-Settings.md: -------------------------------------------------------------------------------- 1 | # ELK(Elasticsearch、Logstash、Kibana)安装和配置 2 | 3 | ## 版本说明 4 | 5 | - 本文包含了:Elasticsearch 2.4.X 和 Elasticsearch 5.2.X 和 Elasticsearch 5.5.X,请有针对性地选择。 6 | 7 | ## 教程说明 8 | 9 | 10 | - 官网: 11 | - 官网总文档: 12 | - 官网最终指南: 13 | - 官网对各个系统的支持列表: 14 | - 5.2 版本有一个设置的新特性必须了解,测试建议我们用 CentOS 7: 15 | - Elasticsearch 开源分布式搜索引擎,它的特点有:分布式,零配置,自动发现,索引自动分片,索引副本机制,restful 风格接口,多数据源,自动搜索负载等。 16 | - Logstash 日志进行收集、分析,并将其存储供以后使用(如,搜索) 17 | - kibana 为 Logstash 和 ElasticSearch 提供的日志分析友好的 Web 界面,可以帮助您汇总、分析和搜索重要数据日志。 18 | 19 | 20 | ### Elasticsearch 部署 21 | 22 | - 请看 Elasticsearch 专题文:[Elasticsearch 相关知识](Elasticsearch-Base.md) 23 | 24 | 25 | ### logstash 26 | 27 | - 请看 logstash 专题文:[logstash 相关知识](Logstash-Base.md) 28 | 29 | ### 安装 Kibana 30 | 31 | - 选择一台机子安装即可,我选择:192.168.1.127 这台 32 | - 切换到存放目录:`cd /usr/program/elk` 33 | - 解压:`tar zxvf kibana-4.6.1-linux-x86_64.tar.gz` 34 | - 修改配置文件:`vim /usr/program/elk/kibana-4.6.1-linux-x86_64/config/kibana.yml`,打开下面注释并配置: 35 | 36 | ``` nginx 37 | server.port: 5601 #端口 38 | server.host: "192.168.1.127" #访问ip地址 39 | elasticsearch.url: "http://192.168.1.127:9200" #连接elastic 40 | kibana.index: ".kibana" #在elastic中添加.kibana索引 41 | ``` 42 | 43 | - 记得先切换到 elasticsearch 用户下,然后先启动 elasticsearch。先确保 elasticsearch 集群是启动的。 44 | - 再切换到 root 用户下,启动 kibana 45 | - 带控制台的启动(比较慢):`/usr/program/elk/kibana-4.6.1-linux-x86_64/bin/kibana` 46 | - 守护进程方式启动:`/usr/program/elk/kibana-4.6.1-linux-x86_64/bin/kibana -d` 47 | - 守护进程方式停止:`ps -ef|grep kibana`,只能通过 kill pid 来结束 48 | - 然后你可以访问:`http://192.168.1.127:5601`,可以看到 kibana 的相关界面。 49 | - 在 logstash 安装这一步,如果你刚刚有按着我说的去做一个 elasticsearch 索引,那你此时不会看到这样的提示:`Unable to fetch mapping. Do you have indices matching the pattern?` 50 | - 此时你可以直接点击 `create` 统计 `logstash-*` 格式的索引结果,看到相关内容 51 | - 如果你知道你的索引名称的规则,比如我现在要统计 Tomcat 的相关索引,我的索引名称是:`tomcat-log-*`,则我输入这个,点击:create 即可。 52 | - kibana 的高级用法请看我单独的一篇文章:[kibana 相关知识](Kibana-Base.md) 53 | 54 | 55 | ## 资料 56 | 57 | - 58 | - 59 | - 60 | - 61 | - <> 62 | - <> 63 | -------------------------------------------------------------------------------- /FTP.md: -------------------------------------------------------------------------------- 1 | # FTP(File Transfer Protocol)介绍 2 | 3 | 4 | ## FTP 安装 5 | 6 | - 查看是否已安装: 7 | - CentOS:`rpm -qa | grep vsftpd` 8 | - Ubuntu:`dpkg -l | grep vsftpd` 9 | 10 | - 安装: 11 | - CentOS 6:`sudo yum install -y vsftpd` 12 | - Ubuntu:`sudo apt-get install -y vsftpd` 13 | 14 | ## FTP 使用之前要点 15 | 16 | - 关闭 CentOS 上的 SELinux 组件(Ubuntu 体系是没有这东西的)。 17 | - 查看 SELinux 开启状态:`sudo getenforce` 18 | - 有如下三种状态,默认是 Enforcing 19 | - Enforcing(开启) 20 | - Permissive(开启,但是只起到警告作用,属于比较轻的开启) 21 | - Disabled(关闭) 22 | - 临时关闭: 23 | - 命令:`sudo setenforce 0` 24 | - 临时开启: 25 | - 命令:`sudo setenforce 1` 26 | - 永久关闭: 27 | - 命令:`sudo vim /etc/selinux/config` 28 | - 将:`SELINUX=enforcing` 改为 `SELINUX=disbaled`,配置好之后需要重启系统。 29 | 30 | ## FTP 服务器配置文件常用参数 31 | 32 | - vsftpd 默认是支持使用 Linux 系统里的账号进行登录的(登录上去可以看到自己的 home 目录内容),权限跟 Linux 的账号权限一样。但是建议使用软件提供的虚拟账号管理体系功能,用虚拟账号登录。 33 | - 配置文件介绍(记得先备份):`sudo vim /etc/vsftpd/vsftpd.conf`,比较旧的系统版本是:`vim /etc/vsftpd.conf` 34 | - 该配置主要参数解释: 35 | - anonymous_enable=NO #不允许匿名访问,改为YES即表示可以匿名登录 36 | - anon_upload_enable=YES #是否允许匿名用户上传 37 | - anon_mkdir_write_enable=YES #是否允许匿名用户创建目录 38 | - local_enable=YES #是否允许本地用户,也就是linux系统的已有账号,如果你要FTP的虚拟账号,那可以改为NO 39 | - write_enable=YES #是否允许本地用户具有写权限 40 | - local_umask=022 #本地用户掩码 41 | - chroot_list_enable=YES #不锁定用户在自己的家目录,默认是注释,建议这个一定要开,比如本地用户judasn,我们只能看到/home/judasn,没办法看到/home目录 42 | - chroot_list_file=/etc/vsftpd/chroot_list #该选项是配合上面选项使用的。此文件中的用户将启用 chroot,如果上面的功能开启是不够的还要把用户名加到这个文件里面。配置好后,登录的用户,默认登录上去看到的根目录就是自己的home目录。 43 | - listen=YES #独立模式 44 | - userlist_enable=YES #用户访问控制,如果是YES,则表示启用vsftp的虚拟账号功能,虚拟账号配置文件是/etc/vsftpd/user_list 45 | - userlist_deny=NO #这个属性在配置文件是没有的,当userlist_enable=YES,这个值也为YES,则user_list文件中的用户不能登录FTP,列表外的用户可以登录,也可以起到一个黑名单的作用。当userlist_enable=YES,这个值为NO,则user_list文件中的用户能登录FTP,列表外的用户不可以登录,也可以起到一个白名单的作用。如果同一个用户即在白名单中又在ftpusers黑名单文件中,那还是会以黑名单为前提,对应账号没法登录。 46 | - tcp_wrappers=YES #是否启用TCPWrappers管理服务 47 | - FTP用户黑名单配置文件:`sudo vim /etc/vsftpd/ftpusers`,默认root用户也在黑名单中 48 | - 控制FTP用户登录配置文件:`sudo vim /etc/vsftpd/user_list` 49 | - 启动服务: 50 | - `service vsftpd restart` 51 | 52 | ## vsftpd 的两种传输模式 53 | 54 | - 分为:主动模式(PORT)和被动模式(PASV)。这两个模式会涉及到一些端口问题,也就涉及到防火墙问题,所以要特别注意。主动模式比较简单,只要在防火墙上放开放开 21 和 20 端口即可。被动模式则要根据情况放开一个端口段。 55 | - ![vsftpd 的两种传输模式](images/FTP-a-1.jpg) 56 | - 上图箭头:xftp 新建连接默认都是勾选被动模式的,所以如果要使用主动模式,在该连接的属性中是要去掉勾选。 57 | 58 | ## vsftpd 的两种运行模式 59 | 60 | - 分为:xinetd 模式和 standalone 模式 61 | - xinetd 模式:由 xinetd 作为 FTP 的守护进程,负责 21 端口的监听,一旦外部发起对 21 端口的连接,则调用 FTP 的主程序处理,连接完成后,则关闭 FTP 主程序,释放内存资源。好处是资源占用少,适合 FTP 连接数较少的场合。 62 | - standalone 模式:直接使用 FTP 主程序作为 FTP 的守护进程,负责 21 端口的监听,由于无需经过 xinetd 的前端代理,响应速度快,适合连接数 较大的情况,但由于 FTP 主程序长期驻留内存,故较耗资源。 63 | - standalone 一次性启动,运行期间一直驻留在内存中,优点是对接入信号反应快,缺点是损耗了一定的系统资源,因此经常应用于对实时反应要求较高的 专业 FTP 服务器。 64 | - xinetd 恰恰相反,由于只在外部连接发送请求时才调用 FTP 进程,因此不适合应用在同时连接数量较多的系统。此外,xinetd 模式不占用系统资源。除了反应速度和占用资源两方面的影响外,vsftpd 还提供了一些额外的高级功能,如 xinetd 模式支持 per_IP (单一 IP)限制,而 standalone 模式则更有利于 PAM 验证功能的应用。 65 | - 配置 xinetd 模式: 66 | - 编辑配置文件:`sudo vim /etc/xinetd.d/vsftpd` 67 | - 属性信息改为如下信息: 68 | - disable = no 69 | - socket_type = stream 70 | - wait = no #这表示设备是激活的,它正在使用标准的TCP Sockets 71 | - 编辑配置文件:`sudo vim /etc/vsftpd/vsftpd.conf` 72 | - 如果该配置选项中的有 `listen=YES`,则要注释掉 73 | - 重启 xinetd 服务,命令:`sudo /etc/rc.d/init.d/xinetd restart` 74 | - 配置 standalone 模式: 75 | - 编辑配置文件:`sudo vim /etc/xinetd.d/vsftpd` 76 | - 属性信息改为如下信息: 77 | - disable = yes 78 | - 编辑配置文件:`sudo vim /etc/vsftpd/vsftpd.conf` 79 | - 属性信息改为如下信息: 80 | - Listen=YES(如果是注释掉则要打开注释) 81 | - 重启服务:`sudo service vsftpd restart` 82 | 83 | ## FTP 资料 84 | 85 | - 86 | - 87 | - 88 | - 89 | - 90 | -------------------------------------------------------------------------------- /File-Extract-Compress.md: -------------------------------------------------------------------------------- 1 | # Linux 下常用压缩文件的解压、压缩 2 | 3 | 4 | ## 常用压缩包**解压**命令整理 5 | 6 | - Linux 后缀为 `.war` 格式的文件(一般用在部署 Tomcat 项目的时候) 7 | - 命令:`unzip -oq XXXXXX.war -d ROOT` 8 | - 如果没有 ROOT 目录会自动创建 ROOT 目录。 9 | 10 | - Linux 后缀为 `.tar.gz` 格式的文件-解压 11 | - 命令:`tar zxvf XXXXXX.tar.gz` 12 | 13 | - Linux 后缀为 `.bz2` 格式的文件-解压 14 | - 命令:`bzip2 -d XXXXXX.bz2` 15 | 16 | - Linux 后缀为 `.tar.bz2` 格式的文件-解压 17 | - 命令:`tar jxvf XXXXXX.tar.bz2` 18 | 19 | - Linux 后缀为 `.tar` 格式的文件-解压 20 | - 命令:`tar zxvf XXXXXX.tar` 21 | 22 | - Linux 后缀为 `.gz` 格式的文件-解压 23 | - 命令:`gunzip XXXXXX.gz` 24 | 25 | - Linux 后缀为 `.zip` 格式的文件-解压 26 | - 命令:`unzip XXXXXX.zip` 27 | - 命令:`unzip XXXXXX.zip -d /opt/`,解压到指定目录 28 | 29 | - Linux 后缀为 `.7z` 格式的文件-解压 30 | - 命令:`7za x XXXXXX.7z` 31 | 32 | - Linux 后缀为 `.tar.xz` 格式的文件-解压,解压出来是tar,再对tar进行解压 33 | - 命令:`tar xf XXXXXX.tar.xz` 34 | 35 | 36 | 37 | ----------------------------------------------------------- 38 | 39 | 40 | ## 常用文件进行**压缩**命令整理 41 | 42 | - Linux 压缩文件为后缀 `.tar` 格式的文件 43 | - 命令:`tar -zcvf test11.tar test11` 44 | 45 | - Linux 压缩文件为后缀 `.tar.gz` 格式的文件 46 | - 命令:`tar -zcvf test11.tar.gz test11` 47 | 48 | - Linux 压缩文件为后缀 `.bz2` 格式的文件 49 | - 命令:`bzip2 -v test.txt` 50 | 51 | - Linux 压缩文件为后缀 `.tar.bz2` 格式的文件 52 | - 命令:`tar -jcvf test11.tar.gz test11` 53 | 54 | - Linux 压缩文件为后缀 `.zip` 格式的文件 55 | - 命令:`zip -r test1.zip /opt/test1/` 56 | 57 | - Linux 压缩文件为后缀 `.7z` 格式的文件 58 | - 命令:`7za a test1.7z /opt/test1/` 59 | 60 | 61 | ## 特殊格式 62 | 63 | - 7z 64 | - 7z 的安装: 65 | - 访问官网下载解压包: 66 | - 解压压缩包:`tar jxvf p7zip_15.14_src_all.tar.bz2` 67 | - 进入目录:`cd p7zip_15.14` 68 | - 执行安装:`sh install.sh` 69 | - rar 70 | - rar 的安装: 71 | - 下载:`wget http://www.rarlab.com/rar/rarlinux-3.8.0.tar.gz` 72 | - 解压下载下来的压缩包:`tar zxvf rarlinux-3.8.0.tar.gz` 73 | - 进入解压后目录:`cd rar` 74 | - 编译:`make` 75 | - 安装:`make install` 76 | - rar 解压:`rar x 文件名.rar` 77 | 78 | 79 | ## 资料 80 | 81 | - 82 | 83 | -------------------------------------------------------------------------------- /Gitlab-Install-And-Settings.md: -------------------------------------------------------------------------------- 1 | # Gitlab 安装和配置 2 | 3 | ## 本文前提 4 | 5 | - 本文只讲解 Gitlab 的搭建配置相关,至于开发流程本质跟 Github 没啥区别的,所以读这篇文章建议最好是已经会了 Github 那种开发流程。 6 | 7 | ## 测试机子硬件最低建议 8 | 9 | - CPU:1 core 10 | - 内存:2G 11 | 12 | ## 安装 13 | 14 | - 我习惯使用 root 用户 15 | - 有开源版本和收费版本,各版本比较: 16 | - 官网: 17 | - 中文网: 18 | - 官网下载: 19 | - 安装的系统环境要求: 20 | - 从文章看目前要求 ruby 2.3,用 yum 版本过低,那就源码安装 ruby 吧,官网当前最新是:2.4.1(大小:14M) 21 | - 安装 ruby 22 | - 下载: 23 | - 解压:`tar zxvf ruby-2.4.1.tar.gz` 24 | - 编译安装: 25 | - `cd ruby-2.4.1` 26 | - `./configure` 27 | - `make`,过程有点慢 28 | - `make install` 29 | - 默认安装到这个目录:`/usr/local` 30 | - 查看当前版本号:`ruby -v` 31 | - CentOS 6 安装流程: 32 | - 当前(201703)的版本是:`GitLab Community Edition 9.0.0` 33 | - `sudo yum install -y curl openssh-server openssh-clients postfix cronie` 34 | - `sudo service postfix start` 35 | - `sudo chkconfig postfix on` 36 | - `sudo lokkit -s http -s ssh` 37 | - `curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash` 38 | - `sudo yum install gitlab-ce`,软件大小:272M,下载速度不稳定 39 | - `sudo gitlab-ctl reconfigure`,这个过程比较慢 40 | - 如果上面的下载比较慢,也有国内的镜像: 41 | - 清华: 42 | 43 | 44 | ## 配置 45 | 46 | - 配置域名 / IP 47 | - 编辑配置文件:`sudo vim /etc/gitlab/gitlab.rb` 48 | - 找到 13 行左右:`external_url 'http://gitlab.example.com'`,改为你的域名 / IP 49 | - 重启服务:`sudo gitlab-ctl reconfigure` 50 | - 前面的初始化配置完成之后,访问当前机子 IP:`http://192.168.1.111:80` 51 | - 默认用户是 root,并且没有密码,所以第一次访问是让你设置你的 root 密码,我设置为:gitlab123456(至少 8 位数) 52 | - 设置会初始化密码之后,你就需要登录了。输入设置的密码。 53 | - root 管理员登录之后常用的设置地址(请求地址都是 RESTful 风格很好懂,也应该不会再变了。): 54 | - 用户管理: 55 | - 用户组管理: 56 | - 项目管理: 57 | - 添加 SSH Keys: 58 | - 给新创建的用户设置密码: 59 | - 新创建的用户,他首次登录会要求他强制修改密码的,这个设定很棒! 60 | - 普通用户登录之后常去的链接: 61 | - 配置 SSH Keys: 62 | 63 | 64 | ## 权限 65 | 66 | - 官网帮助文档的权限说明: 67 | 68 | ### 用户组的权限 69 | 70 | - 用户组有这几种权限的概念:`Guest、Reporter、Developer、Master、Owner` 71 | - 这个概念在设置用户组的时候会遇到,叫做:`Add user(s) to the group`,比如链接: 72 | 73 | |行为|Guest|Reporter|Developer|Master|Owner| 74 | |---|---|--:|---|---|---| 75 | |浏览组|✓|✓|✓|✓|✓| 76 | |编辑组| | | | |✓| 77 | |创建项目| | | |✓|✓| 78 | |管理组成员| | | | |✓| 79 | |移除组| | | | |✓| 80 | 81 | ### 项目组的权限 82 | 83 | - 项目组也有这几种权限的概念:`Guest、Reporter、Developer、Master、Owner` 84 | - `Guest`:访客 85 | - `Reporter`:报告者; 可以理解为测试员、产品经理等,一般负责提交issue等 86 | - `Developer`:开发者; 负责开发 87 | - `Master`:主人; 一般是组长,负责对Master分支进行维护 88 | - `Owner`:拥有者; 一般是项目经理 89 | - 这个概念在项目设置的时候会遇到,叫做:`Members`,比如我有一个组下的项目链接: 90 | 91 | |行为|Guest|Reporter|Developer|Master|Owner| 92 | |---|---|--:|---|---|---| 93 | |创建issue|✓|✓|✓|✓|✓| 94 | |留言评论|✓|✓|✓|✓|✓| 95 | |更新代码| |✓|✓|✓|✓| 96 | |下载工程| |✓|✓|✓|✓| 97 | |创建代码片段| |✓|✓|✓|✓| 98 | |创建合并请求| | |✓|✓|✓| 99 | |创建新分支| | |✓|✓|✓| 100 | |提交代码到非保护分支| | |✓|✓|✓| 101 | |强制提交到非保护分支| | |✓|✓|✓| 102 | |移除非保护分支| | |✓|✓|✓| 103 | |添加tag| | |✓|✓|✓| 104 | |创建wiki| | |✓|✓|✓| 105 | |管理issue处理者| | |✓|✓|✓| 106 | |管理labels| | |✓|✓|✓| 107 | |创建里程碑| | | |✓|✓| 108 | |添加项目成员| | | |✓|✓| 109 | |提交保护分支| | | |✓|✓| 110 | |使能分支保护| | | |✓|✓| 111 | |修改/移除tag| | | |✓|✓| 112 | |编辑工程| | | |✓|✓| 113 | |添加deploy keys| | | |✓|✓| 114 | |配置hooks| | | |✓|✓| 115 | |切换visibility level| | | | |✓| 116 | |切换工程namespace| | | | |✓| 117 | |移除工程| | | | |✓| 118 | |强制提交保护分支| | | | |✓| 119 | |移除保护分支| | | | |✓| 120 | 121 | ### 批量从一个项目中的成员转移到另外一个项目 122 | 123 | - 项目的设置地址: 124 | - 有一个 Import 按钮,跳转到: 125 | 126 | ### 限定哪些分支可以提交、可以 merge 127 | 128 | - 也是在项目设置里面: 129 | - 设置 CI (持续集成) 的 key 也是在这个地址上设置。 130 | 131 | ## 使用 Gitlab 的一个开发流程 - Git flow 132 | 133 | - Git flow:我是翻译成:Git 开发流程建议(不是规范,适合大点的团队),也有一个插件叫做这个,本质是用插件来帮你引导做规范的流程管理。 134 | - 这几篇文章很好,不多说了: 135 | - 比较起源的一个说明(英文): 136 | - Git-flow 插件也是他开发的,插件地址: 137 | - Git-flow 插件的一些相关资料: 138 | - 139 | - 140 | - 141 | - 142 | - 143 | - 144 | 145 | 146 | 147 | ## 资料 148 | 149 | - 150 | - 151 | - 152 | - -------------------------------------------------------------------------------- /Hsk-Install.md: -------------------------------------------------------------------------------- 1 | # 花生壳 安装 2 | 3 | 4 | ## CentOS 下过程 5 | 6 | - 官网: 7 | - 官网下载: 8 | - 官网安装说明: 9 | - 软件包下载:`wget http://download.oray.com/peanuthull/linux/phddns-2.0.6.el6.x86_64.rpm` 10 | - 安装:`sudo yum localinstall -y phddns-2.0.6.el6.x86_64.rpm` 11 | - 配置: 12 | - 安装完毕后,在终端下运行:`phddns` 13 | - 第一步::Enter server address(press ENTER use phddns60.oray.net),这是提示您输入花生壳服务器的域名,如果网站上没有更新域名的公告说明,这一步直接回车即可,会使用默认的 phddns60.oray.net 域名。 14 | - 第二步:Enter your Oray account:这是提示您输入在花生壳官网注册的用户名,请根据实际情况输入。 15 | - 第三步:Password:这是提示您输入在花生壳官网注册的用户名所对应的密码,请根据实际情况输入。 16 | - 第四步:Network interface(s): 这是要配置您这台服务器的网络参数,花生壳(公网版)软件会自动检查,并输出您的网络情况。eth0部分可能和上面的不一样,是您的实际网络设置。如果您有两块网卡,eth0 和eth1 ,而您希望用eth1来绑定花生壳,请在这里输入 eth1 ,然后回车。如果您只有一块网卡,或者您希望使用 eth0来绑定花生壳,在这里直接回车即可。 17 | - 第五步:Log to use(default /var/log/phddns.log):这是提示您输入花生壳(公网版)软件日志的保存位置,请使用绝对路径指定日志文件名。如果直接回车,会使用 /var/log/phddns.log 来保存日志。 18 | - 第六步: Save to configuration file (/etc/phlinux.conf)?(yes/no/other): 这是提示您输入上述配置的保存文件名。如果输入yes 或直接回车,将会使用/etc/phlinux.conf 来作为配置的保存文件名。如果输入other ,将会提示您自行指定文件名,请使用绝对路径来指定这个配置文件名。如果输入no ,不对上述配置进行保存,下次重新使用花生壳(公网版)时,需要手动指定配置文件或再次通过交互模式进行设置. 19 | - 第六步执行完毕后,屏幕上会依次出现:defOnStatusChanged ok,DomainsRegistered,UserType,表示安装、配置完成了 20 | - 启动服务:`/usr/bin/phddns -c /etc/phlinux.conf -d` 21 | - 设置开机启动:`echo "/usr/bin/phddns -c /etc/phlinux.conf -d" >> /etc/rc.local` 22 | - 查看进程:`ps -ef | grep phddns` 23 | - 卸载: 24 | - `rpm -qa|grep phddns` 25 | - `sudo rpm -e phddns-2.0.6-1.el6.x86_64` 26 | 27 | 28 | ## 资料 29 | 30 | - 31 | -------------------------------------------------------------------------------- /Iptables.md: -------------------------------------------------------------------------------- 1 | # Iptables 介绍 2 | 3 | 4 | ## 前提说明 5 | 6 | iptables 的设置在 CentOS 和 Ubuntu 下有些细节不一样,Ubuntu 这里不讲,文章底下贴的资料有部分关于 Ubuntu 的,有需要的可以自己看。一般大家会用到 iptables 都是服务器,而一般服务器大家普遍是用 CentOS) 7 | 8 | ## Iptables 安装 9 | 10 | - 查看是否已安装: 11 | - CentOS:`rpm -qa | grep iptables` 12 | 13 | - 安装(一般系统是集成的): 14 | - CentOS 6:`yum install -y iptables` 15 | 16 | ## Iptables 的配置文件 17 | 18 | - 路径:`vim /etc/sysconfig/iptables` 19 | 20 | ## Iptables 服务器配置文件常用参数 21 | 22 | - 常用命令: 23 | - 查看已有规则列表,并且显示编号:`iptables -L -n --line-numbers` 24 | - ![Iptables 服务器配置文件常用参数](images/Iptables-a-1.jpg) 25 | - 要删除 INPUT 里序号为 8 的规则,执行:`iptables -D INPUT 8` 26 | - 保存配置命令:`service iptables save 或者 /etc/rc.d/init.d/iptables save` 27 | - 重启服务命令 :`service iptables restart` 28 | - 查看服务状态: `service iptables status` 29 | - 设置开启默认启动: `chkconfig --level 345 iptables on` 30 | - 清除所有规则(慎用) 31 | - `iptables -F` 32 | - `iptables -X` 33 | - `iptables -Z` 34 | - 添加规则:格式 `iptables [-AI 链名] [-io 网络接口] [-p 协议] [-s 来源IP/网域] [-d 目标IP/网域] -j [ACCEPT|DROP|REJECT|LOG]` 35 | - 选项与参数: 36 | - -AI 链名:针对某的链进行规则的 "插入" 或 "累加" 37 | - -A :新增加一条规则,该规则增加在原本规则的最后面。例如原本已经有四条规则,使用 -A 就可以加上第五条规则! 38 | - -I :插入一条规则。如果没有指定此规则的顺序,默认是插入变成第一条规则。例如原本有四条规则,使用 -I 则该规则变成第一条,而原本四条变成 2~5 号链 :有 INPUT, OUTPUT, FORWARD 等,此链名称又与 -io 有关,请看底下。 39 | - -io 网络接口:设定封包进出的接口规范 40 | - -i :封包所进入的那个网络接口,例如 eth0, lo 等接口。需与 INPUT 链配合; 41 | - -o :封包所传出的那个网络接口,需与 OUTPUT 链配合; 42 | - -p 协定:设定此规则适用于哪种封包格式。主要的封包格式有: tcp, udp, icmp 及 all 。 43 | - -s 来源 IP/网域:设定此规则之封包的来源项目,可指定单纯的 IP 或包括网域,例如:IP:192.168.0.100,网域:192.168.0.0/24, 192.168.0.0/255.255.255.0 均可。若规范为『不许』时,则加上 ! 即可,例如:-s ! 192.168.100.0/24 表示不许 192.168.100.0/24 之封包来源。 44 | - -d 目标 IP/网域:同 -s ,只不过这里指的是目标的 IP 或网域。 45 | - -j :后面接动作,主要的动作有接受(ACCEPT)、丢弃(DROP)、拒绝(REJECT)及记录(LOG) 46 | 47 | ## Iptables 例子 48 | 49 | - 开放指定端口 50 | - `iptables -I INPUT -i lo -j ACCEPT` #允许本地回环接口(即运行本机访问本机) 51 | - `iptables -I INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT` # 允许已建立的或相关连的通行 52 | - `iptables -I OUTPUT -j ACCEPT` #允许所有本机向外的访问 53 | - `iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT` # 允许访问 22 端口 54 | - `iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT` #允许访问 80 端口 55 | - `iptables -A INPUT -p tcp -m tcp --dport 8080 -j ACCEPT` #允许访问 8080 端口 56 | - `iptables -A INPUT -p tcp -m tcp --dport 21 -j ACCEPT` #允许 FTP 服务的 21 端口 57 | - `iptables -A INPUT -p tcp -m tcp --dport 20 -j ACCEPT` #允许 FTP 服务的 20 端口 58 | - `iptables -I INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT` #允许 ping 59 | - `iptables -I INPUT -j REJECT` #禁止其他未允许的规则访问(使用该规则前一定要保证 22 端口是开着,不然就连 SSH 都会连不上) 60 | - `iptables -I FORWARD -j REJECT` 61 | 62 | ## Iptables 资料 63 | 64 | - 65 | - 66 | -------------------------------------------------------------------------------- /JDK-Install.md: -------------------------------------------------------------------------------- 1 | # JDK 安装 2 | 3 | 4 | ## CentOS 下过程 5 | 6 | - JDK 在 CentOS 和 Ubuntu 下安装过程是一样的,所以这里不再讲 Ubuntu 系统下的安装 7 | - JDK 1.8 下载 8 | - 此时(20160205)最新版本:`jdk-8u72-linux-x64.tar.gz` 9 | - 官网: 10 | - 百度云下载(64 位): 11 | - 官网压缩包地址: 12 | - 在命令行模式下下载上面压缩包: 13 | - `cd /opt` 14 | - `sudo wget http://211.138.156.198:82/1Q2W3E4R5T6Y7U8I9O0P1Z2X3C4V5B/download.oracle.com/otn-pub/java/jdk/8u72-b15/jdk-8u72-linux-x64.tar.gz` 15 | 16 | 17 | - 默认 CentOS 有安装 openJDK,建议先卸载掉 18 | - 检查 JDK 命令:`java -version` 19 | - 查询本地 JDK 安装程序情况; `rpm -qa|grep java` 20 | - 我查询出来的结果如下: 21 | 22 | ``` 23 | java-1.6.0-openjdk-1.6.0.38-1.13.10.0.el6_7.x86_64 24 | java-1.7.0-openjdk-1.7.0.95-2.6.4.0.el6_7.x86_64 25 | tzdata-java-2015g-2.el6.noarch 26 | ``` 27 | 28 | - 卸载上面三个文件(`--nodeps` 的作用:忽略依赖的检查): 29 | - `sudo rpm -e --nodeps java-1.6.0-openjdk-1.6.0.38-1.13.10.0.el6_7.x86_64` 30 | - `sudo rpm -e --nodeps java-1.7.0-openjdk-1.7.0.95-2.6.4.0.el6_7.x86_64` 31 | - `sudo rpm -e --nodeps tzdata-java-2015g-2.el6.noarch` 32 | - 也可以一起卸载:`sudo rpm -e --nodeps java-1.6.0-openjdk-1.6.0.38-1.13.10.0.el6_7.x86_64 java-1.7.0-openjdk-1.7.0.95-2.6.4.0.el6_7.x86_64 tzdata-java-2015g-2.el6.noarch` 33 | - 如果是 CentOS 7 的话:`sudo rpm -e --nodeps javapackages-tools-3.4.1-11.el7.noarch java-1.8.0-openjdk-1.8.0.121-0.b13.el7_3.x86_64 java-1.7.0-openjdk-headless-1.7.0.131-2.6.9.0.el7_3.x86_64 python-javapackages-3.4.1-11.el7.noarch java-1.7.0-openjdk-1.7.0.131-2.6.9.0.el7_3.x86_64 java-1.8.0-openjdk-headless-1.8.0.121-0.b13.el7_3.x86_64 tzdata-java-2017a-1.el7.noarch` 34 | 35 | - JDK 1.8 安装 36 | - 我们以安装 `jdk-8u72-linux-x64.tar.gz` 为例 37 | - 我个人习惯 `/opt` 目录下创建一个目录 `setups` 用来存放各种软件安装包;在 `/usr` 目录下创建一个 `program` 用来存放各种解压后的软件包,下面的讲解也都是基于此习惯 38 | - 我个人已经使用了第三方源:`EPEL、RepoForge`,如果你出现 `yum install XXXXX` 安装不成功的话,很有可能就是你没有相关源,请查看我对源设置的文章 39 | - 解压安装包:`sudo tar -zxvf jdk-8u72-linux-x64.tar.gz` 40 | - 移到解压包到我个人习惯的安装目录下:`mv jdk1.8.0_72/ /usr/program/` 41 | - 配置环境变量: 42 | - 编辑配置文件:`sudo vim /etc/profile` 43 | - 在该文件的最尾巴,添加下面内容: 44 | ``` 45 | # JDK 46 | JAVA_HOME=/usr/program/jdk1.8.0_72 47 | JRE_HOME=$JAVA_HOME/jre 48 | PATH=$PATH:$JAVA_HOME/bin 49 | CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar 50 | export JAVA_HOME 51 | export JRE_HOME 52 | export PATH 53 | export CLASSPATH 54 | ``` 55 | - 执行命令,刷新该配置(必备操作):`source /etc/profile` 56 | - 检查是否使用了最新的 JDK:`java -version` 57 | 58 | 59 | 60 | ## 其他 61 | 62 | - JDK 历史版本下载地址整理(不间断更新): 63 | - **JDK 9**: 64 | - **JDK 8**: 65 | - **JDK 7**: 66 | - JDK 7 - 64 位:`wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.tar.gz` 67 | - JDK 7 - 32 位:`wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-i586.tar.gz` 68 | - **JDK 6**: 69 | 70 | 71 | 72 | ## 资料 73 | 74 | - 75 | - <> 76 | - <> 77 | - <> 78 | -------------------------------------------------------------------------------- /Jenkins-Install-And-Settings.md: -------------------------------------------------------------------------------- 1 | # Jenkins 安装和配置 2 | 3 | 4 | ## Jenkins 安装 5 | 6 | - Jenkins 安装 7 | - 官网: 8 | - 官网帮助中心: 9 | - 官网使用 Tomcat 部署方式指导: 10 | - 此时(20160207) Jenkins 最新版本为:**1.647** 11 | - JDK 最低要求是 JDK 7,官网推荐是 JDK 8 12 | - 我个人习惯 `/opt` 目录下创建一个目录 `setups` 用来存放各种软件安装包;在 `/usr` 目录下创建一个 `program` 用来存放各种解压后的软件包,下面的讲解也都是基于此习惯 13 | - 我个人已经使用了第三方源:`EPEL、RepoForge`,如果你出现 `yum install XXXXX` 安装不成功的话,很有可能就是你没有相关源,请查看我对源设置的文章 14 | - Jenkins 下载:`wget http://mirrors.jenkins-ci.org/war/latest/jenkins.war` (大小:61 M) 15 | - 我们假设这个 Tomcat 就是为了 Jenkins 专用的 16 | - 把下载下来的 jenkins.war 移到 Tomcat 的 webapps 目录下,比如我的是:`/usr/program/tomcat8/webapps` 17 | - 把 Jenkins.war 改名为 ROOT.war:`mv jenkins.war ROOT.war` 18 | - 删除 Tomcat 下 webapps 目录下多余的一些目录 19 | - 首次启动 Tomcat,让 Tomcat 解压 war 20 | - 设置 JENKINS_HOME: 21 | - 寻找 jenkins home 目录地址:`find / -name .jenkins`,我这边得到的结果是:`/root/.jenkins` 22 | - 对在 Tomcat 文章中讲解的系统变量 `CATALINA_OPTS` 进行设置: 23 | - 旧值: 24 | ``` 25 | CATALINA_OPTS="-server -Xms528m -Xmx528m -XX:PermSize=256m -XX:MaxPermSize=358m" 26 | export CATALINA_OPTS 27 | ``` 28 | - 改为: 29 | ``` 30 | CATALINA_OPTS="-server -DJENKINS_HOME=/root/.jenkins -Xms528m -Xmx528m -XX:PermSize=256m -XX:MaxPermSize=358m" 31 | export CATALINA_OPTS 32 | ``` 33 | 34 | 35 | - Jenkins 各个组件配置: 36 | - 访问: 37 | 38 | 39 | - 其他问题 40 | - 如果访问的时候报这个异常:`java.net.UnknownHostException`,可以查看这篇文章: 41 | 42 | 43 | ## 资料 44 | 45 | - -------------------------------------------------------------------------------- /Jira-Install-And-Settings.md: -------------------------------------------------------------------------------- 1 | # Jira 安装和配置 2 | 3 | 4 | ## Jira 安装 5 | 6 | - Jira 安装 7 | - 官网: 8 | - 官网下载: 9 | - 中文在线试用: 10 | - 官网帮助说明: 11 | - 官网中文语言包: 12 | - Jira 6.3.6 网盘下载: 13 | - Jira 6.3.6 中文语言包网盘下载: 14 | - 环境要求: 15 | - JDK 7 或更新版本; 16 | - Mysql 17 | - 我们要使用的版本:**atlassian-jira-6.3.6.tar.gz** 18 | - 我个人习惯 `/opt` 目录下创建一个目录 `setups` 用来存放各种软件安装包;在 `/usr` 目录下创建一个 `program` 用来存放各种解压后的软件包,下面的讲解也都是基于此习惯 19 | - 我个人已经使用了第三方源:`EPEL、RepoForge`,如果你出现 `yum install XXXXX` 安装不成功的话,很有可能就是你没有相关源,请查看我对源设置的文章 20 | - 解压:`tar zxvf atlassian-jira-6.3.6.tar.gz` 21 | - 修改目录名:`mv atlassian-jira-6.3.6/ jira6.3.6/` 22 | - 移到我个人的安装目录下:`mv jira6.3.6/ /usr/program/` 23 | - 创建存放数据目录:`mkdir -p /usr/program/jira6.3.6/data/` 24 | - 设置环境变量: 25 | - 编辑:`vim /etc/profile` 26 | - 在文件尾部添加: 27 | ``` ini 28 | JIRA_HOME=/usr/program/jira6.3.6/data/ 29 | export JIRA_HOME 30 | ``` 31 | - 刷新配置:`source /etc/profile` 32 | - 运行:`/usr/program/jira6.3.6/bin/start-jira.sh` 33 | - 访问:`http://192.168.0.111:8080/` 34 | - 汉化:`cp JIRA-6.3.6-language-pack-zh_CN.jar /usr/program/jira6.3.6/atlassian-jira/WEB-INF/lib/` 35 | - 配置过程: 36 | - ![Jira 安装和配置](images/Jira-Install-And-Settings-a-1.jpg) 37 | - ![Jira 安装和配置](images/Jira-Install-And-Settings-a-2.jpg) 38 | - ![Jira 安装和配置](images/Jira-Install-And-Settings-a-3.jpg) 39 | - ![Jira 安装和配置](images/Jira-Install-And-Settings-a-4.jpg) 40 | - ![Jira 安装和配置](images/Jira-Install-And-Settings-a-5.jpg) 41 | - ![Jira 安装和配置](images/Jira-Install-And-Settings-a-6.jpg) 42 | - 重新激活页面地址:`http://192.168.0.111:8090/secure/admin/ViewLicense.jspa` -------------------------------------------------------------------------------- /Kibana-Base.md: -------------------------------------------------------------------------------- 1 | # kibana 知识 2 | 3 | ## 基础知识 4 | 5 | - 官网文档: 6 | 7 | 8 | ## 案例 9 | 10 | 11 | 12 | 13 | ## 资料 14 | 15 | - <> 16 | - <> -------------------------------------------------------------------------------- /LDAP-Install-And-Settings.md: -------------------------------------------------------------------------------- 1 | # LDAP 安装和配置 2 | 3 | 4 | ## LDAP 基本概念 5 | 6 | - 7 | - 8 | - 9 | 10 | ## LDAP 服务器端安装 11 | 12 | - 环境:CentOS 7.3 x64(为了方便,已经禁用了防火墙) 13 | - 常见服务端: 14 | - [OpenLDAP](http://www.openldap.org/) 15 | - 这里选择:OpenLDAP,安装(最新的是 2.4.40):`yum install -y openldap openldap-clients openldap-servers migrationtools` 16 | - 配置: 17 | - `cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG` 18 | - `chown ldap. /var/lib/ldap/DB_CONFIG` 19 | - 启动: 20 | - `systemctl start slapd` 21 | - `systemctl enable slapd` 22 | - 查看占用端口(默认用的是 389):`netstat -tlnp | grep slapd` 23 | 24 | ### 设置OpenLDAP管理员密码 25 | 26 | - 输入命令:`slappasswd`,重复输入两次明文密码后(我是:123456),我得到一个加密后密码(后面会用到):`{SSHA}YK8qBtlmEpjUiVEPyfmNNDALjBaUTasc` 27 | - 新建临时配置目录: 28 | - `mkdir /root/my_ldif ; cd /root/my_ldif` 29 | - `vim chrootpw.ldif`,添加如下内容: 30 | 31 | ``` ini 32 | dn: olcDatabase={0}config,cn=config 33 | changetype: modify 34 | add: olcRootPW 35 | olcRootPW: {SSHA}YK8qBtlmEpjUiVEPyfmNNDALjBaUTasc 36 | ``` 37 | 38 | - 添加刚刚写的配置(过程比较慢):`ldapadd -Y EXTERNAL -H ldapi:/// -f chrootpw.ldif ` 39 | - 导入默认的基础配置(过程比较慢):`for i in /etc/openldap/schema/*.ldif; do ldapadd -Y EXTERNAL -H ldapi:/// -f $i; done` 40 | 41 | ### 修改默认的domain 42 | 43 | - 输入命令:`slappasswd`,重复输入两次明文密码后(我是:111111),我得到一个加密后密码(后面会用到):`{SSHA}rNLkIMYKvYhbBjxLzSbjVsJnZSkrfC3w` 44 | - `cd /root/my_ldif ; vim chdomain.ldif`,添加如下内容(cn,dc,dc,olcRootPW 几个值需要你自己改): 45 | 46 | ``` ini 47 | dn: olcDatabase={1}monitor,cn=config 48 | changetype: modify 49 | replace: olcAccess 50 | olcAccess: {0}to * by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" 51 | read by dn.base="cn=gitnavi,dc=youmeek,dc=com" read by * none 52 | 53 | dn: olcDatabase={2}hdb,cn=config 54 | changetype: modify 55 | replace: olcSuffix 56 | olcSuffix: dc=youmeek,dc=com 57 | 58 | dn: olcDatabase={2}hdb,cn=config 59 | changetype: modify 60 | replace: olcRootDN 61 | olcRootDN: cn=gitnavi,dc=youmeek,dc=com 62 | 63 | dn: olcDatabase={2}hdb,cn=config 64 | changetype: modify 65 | add: olcRootPW 66 | olcRootPW: {SSHA}rNLkIMYKvYhbBjxLzSbjVsJnZSkrfC3w 67 | 68 | dn: olcDatabase={2}hdb,cn=config 69 | changetype: modify 70 | add: olcAccess 71 | olcAccess: {0}to attrs=userPassword,shadowLastChange by 72 | dn="cn=gitnavi,dc=youmeek,dc=com" write by anonymous auth by self write by * none 73 | olcAccess: {1}to dn.base="" by * read 74 | olcAccess: {2}to * by dn="cn=gitnavi,dc=youmeek,dc=com" write by * read 75 | ``` 76 | 77 | - 添加配置:`ldapadd -Y EXTERNAL -H ldapi:/// -f chdomain.ldif` 78 | 79 | ### 添加一个基本的目录 80 | 81 | - `cd /root/my_ldif ; vim basedomain.ldif`,添加如下内容(cn,dc,dc 几个值需要你自己改): 82 | 83 | ``` ini 84 | dn: dc=youmeek,dc=com 85 | objectClass: top 86 | objectClass: dcObject 87 | objectclass: organization 88 | o: youmeek dot Com 89 | dc: youmeek 90 | 91 | dn: cn=gitnavi,dc=youmeek,dc=com 92 | objectClass: organizationalRole 93 | cn: gitnavi 94 | description: Directory Manager 95 | 96 | dn: ou=People,dc=youmeek,dc=com 97 | objectClass: organizationalUnit 98 | ou: People 99 | 100 | dn: ou=Group,dc=youmeek,dc=com 101 | objectClass: organizationalUnit 102 | ou: Group 103 | ``` 104 | 105 | - 添加配置:`ldapadd -x -D cn=gitnavi,dc=youmeek,dc=com -W -f basedomain.ldif`,会提示让你输入配置 domain 的密码,我是:111111 106 | - `简单的配置到此就好了` 107 | 108 | ### 测试连接 109 | 110 | - 重启下服务:`systemctl restart slapd` 111 | - 本机测试,输入命令:`ldapsearch -LLL -W -x -D "cn=gitnavi,dc=youmeek,dc=com" -H ldap://localhost -b "dc=youmeek,dc=com"`,输入 domain 密码,可以查询到相应信息 112 | - 局域网客户端连接测试,下载 Ldap Admin(下载地址看文章下面),具体连接信息看下图: 113 | - ![Ldap Admin](images/Ldap-Install-And-Settings-a-1.png) 114 | 115 | 116 | ## LDAP 客户端 117 | 118 | - 常见客户端: 119 | - [LdapAdmin](http://www.ldapadmin.org/download/ldapadmin.html) 120 | - [LdapBrowser](http://www.ldapbrowser.com/) 121 | - [phpLDAPadmin](http://phpldapadmin.sourceforge.net/wiki/index.php/Main_Page) 122 | - [Softerra LDAP Administrator](http://softerra-ldap-administrator.software.informer.com/3.5/) 123 | 124 | ## 资料 125 | 126 | - 127 | - 128 | - 129 | - -------------------------------------------------------------------------------- /Linux.md: -------------------------------------------------------------------------------- 1 | # Linux 介绍 2 | 3 | 4 | 5 | ## Linux 这个名字 6 | 7 | Linux 的 Wiki 介绍: 8 | 9 | Linux 也称:`GNU/Linux`,而其中 GNU 的全称又是:`Gnu’s Not Unix`。 10 | 11 | 其中 GNU 放前面是有原因的,GNU 介绍: 12 | 13 | 对于 Linux 和 GNU/Linux 的两种叫法是有争议,可以看下面文章: 14 | 15 | 其实我们可以认为:Linux 本质是指 Linux 内核,而称 GNU/Linux 则代表这是一个系统,所以我认为 Debian 的这个叫法是合理的,但是确实有点不好念和记忆。所以普遍大家直接称作 Linux。 16 | 17 | 通过上面的全称和资料其实我们也就了解到,Linux 本质来源不是 Unix,但是它借鉴了 Unix 的设计思想,所以在系统业界上把这种和 Unix 是一致设计思想的系统归为:`类 Unix 系统`。 18 | 19 | 类 Unix 系统的介绍: 20 | 21 | 类 Unix 系统,除了我们今天要讲的 Linux,还有大家熟知的 Mac OS X、FreeBSD(这两个是直接从 Unix 系发展过来的,所以相对 Linux 是比较地道的类 Unix 系统) 22 | 23 | - FreeBSD 介绍: 24 | - Mac OS X 介绍: 25 | 26 | ## Linux 的发行版本 27 | 28 | Linux 的 Wiki 中有这句话: 29 | 30 | > 通常情况下,Linux 被打包成供个人计算机和服务器使用的 Linux 发行版,一些流行的主流 Linux 发布版,包括 Debian(及其派生版本 Ubuntu、Linux Mint)、Fedora(及其相关版本 Red Hat Enterprise Linux、CentOS)和 openSUSE、ArchLinux(这个是我补充的)等。 31 | 32 | **通过上面这句话我做了总结,我个人觉得应该这样分:** 33 | 34 | - Fedora、RHEL、Centos 是一个系,他们的区别: 35 | - Debian、Ubuntu 是一个系的,他们的区别直接看 Ubuntu 的 Wiki 就可以得知: 36 | - ArchLinux 自己一个系: 37 | - openSUSE 自己一个系: 38 | 39 | **根据用途可以再总结:** 40 | 41 | - Fedora 系业界一般用于做服务器 42 | - Debian 系业界一般用于桌面,移动端,TV这一类 43 | - ArchLinux 系,很轻量的Linux,适合有一定Linux基础,并且爱折腾的人使用,用它做桌面或是服务器都行。 44 | - OpenSuse 系,嘛,嗯…人气相对比较差,一般是服务器。 45 | 46 | 其实 Linux 的发行版本有太多了,我也只是简单说下常见的而已,具体可以看: 47 | 48 | ## Linux 作用 49 | 50 | 为什么要用 Linux 系统?大家常看到的说法是这样的: 51 | 52 | > Linux 是一个开源的,有潜力,安全,免费的操作系统 53 | 54 | 我觉得这几个点都比较虚, 特别是免费这东西,在景德镇应该算是最不值钱的东西。作为系统的上层使用者来讲,我们之所以喜欢某个操作系统就是因为它可以加快的你生产效率,提高产能。我推荐 Linux 也只是因为它适合常见的编程语言做开发环境,仅此一点。 55 | 56 | **所有,对此我的总结就是:** 57 | 58 | 如果你是某种语言的开发者,你从事这个行业,不管你怎么学习下去,Linux 永远绕不开。从简单的各种语言开发,到后期的服务器部署,分布式,集群环境,数据库相关等,Linux 都在等着你。如果你是新手程序员可能还不太懂我这句话,但是我这里可以这样提示:你可以认真去看下各个语言的官网、对应的开发组件官网,看下他们的下载和新手上路相关页面,都会有 Linux 系统对应的介绍,但是不一定有会 Windows。(P.S:微软系、美工等设计系是唯一这个总结之外的人) 59 | 60 | 在认识 Linux 作用上我以下面这边文章为结尾。Linux 和 Mac OS X 都是类 Unix 系统,所以这篇文章中基本上的理由都可以用到 Linux 上的。 61 | 为什么国外程序员爱用 Mac? 62 | 63 | ## 推荐的发行版本 64 | 65 | **Ubuntu:适用于开发机** 66 | 67 | **推荐版本:Ubuntu kylin 15.10** 68 | 69 | - Ubuntu kylin 官网: 70 | - Ubuntu 英文官网: 71 | - Ubuntu 中文官网: 72 | - 网易镜像: 73 | - 阿里云镜像: 74 | - Ubuntu kylin 15.10 **64 位**镜像地址: 75 | 76 | **推荐理由:** 77 | 78 | 我们是要在上面做开发的,不是要把他变成生活用机的,所以你认为自己尝试安装各种中文输入法很爽吗?自己尝试让国际 Ubuntu 版变成又一个符合国情的 kylin 很爽吗?真心别折腾这些没用的东西。就像我以前说的,大学老师让 Java 新手使用记事本写代码就是一种非常 shit 行为,不断地在 Windows 上用 `cmd > javac` 是毫无意义的。 79 | 80 | ------ 81 | 82 | **CentOS:适用于服务器机** 83 | 84 | **推荐版本:6.7** 85 | 86 | - CentOS 官网: 87 | - 网易镜像: 88 | - 阿里云镜像: 89 | - CentOS 6.7 **64 位**镜像地址: 90 | 91 | **推荐理由:** 92 | 93 | Fedora(CentOS、RHEL) 系,是在国内外,作为企业服务器的系统最多,没有之一。我在 Quora 和知乎上也搜索了下,基本上大家都是赞同这个观点的。 94 | -------------------------------------------------------------------------------- /Maven-Install-And-Settings.md: -------------------------------------------------------------------------------- 1 | # Maven 安装和配置 2 | 3 | 4 | 5 | ## Maven 安装 6 | 7 | - Maven 安装 8 | - 官网: 9 | - 官网下载: 10 | - 历史版本下载: 11 | - 此时(20160208) Maven 最新版本为:**3.3.9** 12 | - Maven 3.3 的 JDK 最低要求是 JDK 7 13 | - 我个人习惯 `/opt` 目录下创建一个目录 `setups` 用来存放各种软件安装包;在 `/usr` 目录下创建一个 `program` 用来存放各种解压后的软件包,下面的讲解也都是基于此习惯 14 | - 我个人已经使用了第三方源:`EPEL、RepoForge`,如果你出现 `yum install XXXXX` 安装不成功的话,很有可能就是你没有相关源,请查看我对源设置的文章 15 | - 下载压缩包:`wget http://mirrors.cnnic.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz` 16 | - 解压:`tar zxvf apache-maven-3.3.9-bin.tar.gz` 17 | - 修改目录名,默认的太长了:`mv apache-maven-3.3.9/ maven3.3.9/` 18 | - 移到我个人习惯的安装目录下:`mv maven3.3.9/ /usr/program` 19 | - 环境变量设置:`vim /etc/profile` 20 | - 在文件最尾巴添加下面内容: 21 | 22 | ``` ini 23 | # Maven 24 | MAVEN_HOME=/usr/program/maven3.3.9 25 | PATH=$PATH:$MAVEN_HOME/bin 26 | MAVEN_OPTS="-Xms256m -Xmx356m" 27 | export MAVEN_HOME 28 | export PATH 29 | export MAVEN_OPTS 30 | ``` 31 | 32 | - 刷新配置文件:`source /etc/profile` 33 | - 测试是否安装成功:`mvn -version` 34 | 35 | 36 | ## Maven 配置 37 | 38 | - 配置项目连接上私服 39 | - 全局方式配置: 40 | 41 | ``` xml 42 | 43 | 44 | 45 | 46 | 47 | D:/maven/my_local_repository 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | nexus-releases 59 | admin 60 | admin123 61 | 62 | 63 | nexus-snapshots 64 | admin 65 | admin123 66 | 67 | 68 | 69 | 70 | 71 | 72 | nexus-releases 73 | * 74 | http://localhost:8081/nexus/content/groups/public 75 | 76 | 77 | nexus-snapshots 78 | * 79 | http://localhost:8081/nexus/content/groups/public-snapshots 80 | 81 | 82 | 83 | 84 | 85 | 86 | nexus 87 | 88 | 89 | nexus-releases 90 | http://nexus-releases 91 | 92 | true 93 | 94 | 95 | true 96 | 97 | 98 | 99 | nexus-snapshots 100 | http://nexus-snapshots 101 | 102 | true 103 | 104 | 105 | true 106 | 107 | 108 | 109 | 110 | 111 | nexus-releases 112 | http://nexus-releases 113 | 114 | true 115 | 116 | 117 | true 118 | 119 | 120 | 121 | nexus-snapshots 122 | http://nexus-snapshots 123 | 124 | true 125 | 126 | 127 | true 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | nexus 136 | 137 | 138 | 139 | ``` 140 | 141 | - 项目级别: 142 | 143 | 144 | 145 | 146 | ## 资料 147 | 148 | - 149 | - 150 | - 151 | - 152 | - 153 | - 154 | - 155 | - -------------------------------------------------------------------------------- /Mycat-Install-And-Settings.md: -------------------------------------------------------------------------------- 1 | # Mycat 安装和配置 2 | 3 | ## 前提 4 | 5 | - 局域网中有一台 IP:192.168.1.111 已经安装好了一个 MySQL 5.6 6 | 7 | ## 部署的环境 8 | 9 | - 系统:CentOS 6.7 10 | - 系统 IP:192.168.1.112 11 | - JDK:jdk-8u72-linux-x64.tar.gz 12 | - Mycat:Mycat-server-1.6-RELEASE-20161028204710-linux.tar.gz 13 | 14 | ## Mycat 安装 15 | 16 | - 官网(页头有一个 PDF 要记得下载,这本资料写得很好): 17 | - 官网下载(官网下载地址很乱,如果哪天右边这个地址不行了,到官网加群问下吧): 18 | - 项目 Github: 19 | - 此时(20170122) 最新稳定版本为:**1.6**,下载下来的文件名称:**Mycat-server-1.6-RELEASE-20161028204710-linux.tar.gz** 20 | - 安装前的准备: 21 | - 这台机子必须装有 JDK,并且配置好 JAVA_HOME。JDK 的安装看: 22 | - 开始安装: 23 | - 给 Mycat 创建专属系统用户,并设置密码: 24 | - `useradd mycat` 25 | - `passwd mycat`,进入设置密码,我习惯测试的时候密码为:123456 26 | - 假设 Mycat 安装包的完整路径是:**/opt/Mycat-server-1.6-RELEASE-20161028204710-linux.tar.gz** 27 | - 解压:`cd /opt ; tar -zxvf Mycat-server-1.6-RELEASE-20161028204710-linux.tar.gz` 28 | - 移动解压的目录到官方建议的目录下:`mv /opt/mycat /usr/local/` 29 | - 设置 Mycat 的环境变量 30 | - `vim /etc/profile`,添加如下内容: 31 | ``` nginx 32 | export MYCAT_HOME=/usr/local/mycat 33 | export PATH=$PATH:$MYCAT_HOME/bin 34 | ``` 35 | - 刷新配置:`source /etc/profile` 36 | - 到这里就安装好了,但是先不启动,需要先去配置相应的配置文件。 37 | 38 | ## Mycat 配置 39 | 40 | - 使用 Mycat 这几个配置文件必定会改动到。这一个文件所代表的含义几句话说不了,还请你自己看下官网的文档。 41 | - `rule.xml`,设置分片规则。 42 | - `server.xml`,主要用于配置系统变量、用户管理、用户权限等。 43 | - `schema.xml`,用于设置 Mycat 的逻辑库、表、数据节点、dataHost 等内容,分库分表、读写分离等等都是在这里进行配置的 44 | - 其中特别注意的是分片节点的配置,如下,其中 db1,db2,db3 是需要我们自己在 IP 为:192.168.1.111 这台机子上人工创建这三个空白数据库。 45 | ``` nginx 46 | 47 | 48 | 49 | ``` 50 | - 假设你上面的配置文件都配置好了: 51 | - 开放 8066 端口 52 | - 如果只是临时测试,可以临时关掉防火墙:`service iptables stop` 53 | - 不然就添加防火墙规则: 54 | - 添加规则:`sudo iptables -I INPUT -p tcp -m tcp --dport 8066 -j ACCEPT` 55 | - 保存规则:`sudo service iptables save` 56 | - 重启 iptables:`sudo service iptables restart` 57 | - 启动/停止/重启 58 | - 启动有两种,一种是后台启动,启动后看不到任何信息。一种是控制台启动,启动后进入 Mycat 的控制台界面,显示当前 Mycat 的活动信息,按 Ctrl + C 停止控制台的时候 Mycat 也跟着停止。 59 | - 进入 Mycat 目录:`cd /usr/local/mycat/bin` 60 | - 后台启动:`./mycat start`,看到日志可以这样看:`tail -f /usr/local/mycat/logs/mycat.log` 61 | - 控制台启动:`./mycat console` 62 | - 重启:`./mycat restart` 63 | - 停止:`./mycat stop` 64 | - 连接 Mycat 65 | - 连接 Mycat 的过程跟连接普通的 MySQL 表面上是没啥区别的,使用的命令都是一个样。但是需要注意的是,很容易出问题。对连接客户端有各种意外,目前我做了总结: 66 | - 连接命令:`mysql -h192.168.1.112 -uroot -p -P8066`,然后输入 mycat 的 root 用户密码(在上面介绍的 server.xml 中配置的) 67 | - **不建议** 的连接方式: 68 | - SQLyog 软件,我这边是报:*find no Route:select * from `youmeek_nav`.`nav_url` limit 0, 1000* 69 | - Windows 系统下使用 cmd 去连接,我这边是报:*ERROR 1105 (HY000): Unknown character set: 'gbk'* 70 | - MySQL-Front 软件,没用过,但是别人说是有兼容性问题 71 | - **建议** 的连接方式: 72 | - Navicat for mysql 软件 73 | - Linux 下的 MySQL 客户端命令行 74 | -------------------------------------------------------------------------------- /Mysql-Tutorial.md: -------------------------------------------------------------------------------- 1 | # Mysql 教程 2 | 3 | 4 | ## Mysql 常用命令 5 | 6 | 7 | 8 | ## 资料 9 | 10 | - [MySQL Tutorial-1](http://www.tutorialspoint.com/mysql/) 11 | - [MySQL Tutorial-2](http://www.mysqltutorial.org/) 12 | - [MySQL Tutorial-3](http://zetcode.com/databases/mysqltutorial/) 13 | - [MySQL 教程-1](http://www.runoob.com/mysql/mysql-connection.html) 14 | - [MySQL 教程-2](http://www.w3school.com.cn/sql/) 15 | - [MySQL 教程-3](https://wizardforcel.gitbooks.io/w3school-sql/content/part7.html) 16 | -------------------------------------------------------------------------------- /NFS.md: -------------------------------------------------------------------------------- 1 | # NFS(Network FileSystem)介绍 2 | 3 | 4 | 5 | ## NFS 安装 6 | 7 | - 查看是否已安装: 8 | - CentOS:`rpm -qa | grep nfs-*` 9 | - Ubuntu:`dpkg -l | grep nfs-*` 10 | 11 | - 安装: 12 | - CentOS 5:`sudo yum install -y nfs-utils portmap` 13 | - CentOS 6:`sudo yum install -y nfs-utils rpcbind` 14 | - Ubuntu:`sudo apt-get install -y nfs-common nfs-kernel-server` 15 | 16 | ## NFS 服务器配置文件常用参数 17 | 18 | - 配置文件介绍(记得先备份):`sudo vim /etc/exports` 19 | - 默认配置文件里面是没啥内容的,我们需要自己加上配置内容,一行表示共享一个目录。为了方便使用,共享的目录最好将权限设置为 777(`chmod 777 folderName`)。 20 | - 假设在配置文件里面加上:`/opt/mytest 192.168.0.0/55(rw,sync,all_squash,anonuid=501,anongid=501,no_subtree_check)` 21 | - 该配置解释: 22 | - /opt/mytest 表示我们要共享的目录 23 | - 192.168.0.0/55 表示内网中这个网段区间的IP是可以进行访问的,如果要任意网段都可以访问,可以用 `*` 号表示 24 | - (rw,sync,all_squash,anonuid=501,anongid=501,no_subtree_check) 表示权限 25 | - rw:是可读写(ro是只读) 26 | - sync:同步模式,表示内存中的数据时时刻刻写入磁盘(async:非同步模式,内存中数据定期存入磁盘) 27 | - all_squash:表示不管使用NFS的用户是谁,其身份都会被限定为一个指定的普通用户身份。(no_root_squash:其他客户端主机的root用户对该目录有至高权限控制。root_squash:表示其他客户端主机的root用户对该目录有普通用户权限控制) 28 | - anonuid/anongid:要和root_squash或all_squash选项一同使用,表示指定使用NFS的用户被限定后的uid和gid,前提是本图片服务器的/etc/passwd中存在这一的uid和gid 29 | - no_subtree_check:不检查父目录的权限 30 | 31 | - 启动服务: 32 | - `/etc/init.d/rpcbind restart` 33 | - `/etc/init.d/nfs-kernel-server restart` 34 | 35 | ## NFS 客户端访问 36 | 37 | - 客户端要访问服务端的共享目录需要对其共享的目录进行挂载,在挂载之前先检查下:`showmount -e 192.168.1.25`(这个 IP 是 NFS 的服务器端 IP) 38 | - 如果显示:/opt/mytest 相关信息表示成功了。 39 | - 现在开始对其进行挂载:`mount -t nfs 192.168.1.25:/opt/mytest/ /mytest/` 40 | - 在客户端机器上输入命令:`df -h` 可以看到多了一个 mytest 分区。然后我们可以再创建一个软链接,把软链接放在 war 包的目录下,这样上传的图片都会跑到另外一台服务器上了。软链接相关内容请自行搜索。 41 | 42 | ## NFS 资料 43 | 44 | - 45 | - 46 | - 47 | - 48 | - 49 | -------------------------------------------------------------------------------- /NTP.md: -------------------------------------------------------------------------------- 1 | ## NTP(Network Time Protocol)介绍 2 | 3 | 4 | 5 | ## NTP 安装 6 | 7 | - 查看是否已安装: 8 | - CentOS:`rpm -qa | grep ntp-*` 9 | - Ubuntu:`dpkg -l | grep ntp-*` 10 | 11 | - 安装: 12 | - CentOS 6:`sudo yum install -y ntp` 13 | - Ubuntu:`sudo apt-get install -y ntp` 14 | 15 | ## NTP 服务器配置文件常用参数 16 | 17 | - 世界上可以校对时间节点: 18 | - 中国时间校对服务器节点: 19 | - 配置文件介绍(记得先备份):`sudo vim /etc/ntp.conf` 20 | - ![NTP 服务器配置文件常用参数](images/NTP-a-1.jpg) 21 | - 该配置解释: 22 | - 标注 1 是默认内容,我们这里进行了注释。 23 | - 标注 2 是新增内容,表示使用中国时间校对服务器节点地址。 24 | ``` nginx 25 | server 0.asia.pool.ntp.org 26 | server 1.asia.pool.ntp.org 27 | server 2.asia.pool.ntp.org 28 | server 3.asia.pool.ntp.org 29 | ``` 30 | - 启动服务: 31 | - `sudo service ntpd start` 32 | - 服务加到启动项 33 | - CentOS 系统 34 | - `sudo chkconfig ntpd on` 35 | - Ubuntu 系统 36 | - `sudo apt-get install -y sysv-rc-conf ` 37 | - `sudo sysv-rc-conf ntpd on` 38 | 39 | ## NTP 资料 40 | 41 | - 42 | - 43 | - 44 | -------------------------------------------------------------------------------- /Nmon.md: -------------------------------------------------------------------------------- 1 | # nmon 系统性能监控工具的使用 2 | 3 | 4 | ## nmon 说明 5 | 6 | - 官网: 7 | - 分析工具 nmon analyser: 8 | - > nmon是一种在AIX与各种Linux操作系统上广泛使用的监控与分析工具, nmon所记录的信息是比较全面的,它能在系统运行过程中实时地捕捉系统资源的使用情况,并且能输出结果到文件中。 9 | 10 | ## 下载/安装 11 | 12 | - Ubuntu:`sudo apt-get install -y nmon` 13 | - CentOS:`sudo yum install -y nmon`,前提是你已经有安装 epel 源 14 | - 或者使用 RPM 包: 15 | - 安装命令:`rpm -ivh nmon-14i-8.el6.x86_64.rpm` 16 | - 分析工具 nmon analyser: 17 | 18 | ## 运行 19 | 20 | - 实时监控:`nmon` 21 | - 后台监控:`cd /opt ; nmon -f -s 10 -c 360` 22 | - 前面的 cd /opt 表示,进入 opt 目录,nmon 生成的文件是在当前目录下。 23 | - -f :按标准格式输出文件名称:_YYYYMMDD_HHMM.nmon 24 | - -s :每隔n秒抽样一次,这里为10秒 25 | - -c :取出多少个抽样数量,这里为360,即监控=10*360/3600=1小时 26 | - 该命令启动后,nmon 会在当前目录下生成监控文件,并持续写入资源数据,直至360个监控点收集完成——即监控1小时,这些操作均自动完成,无需手工干预,测试人员可以继续完成其他操作。如果想停止该监控,需要通过 `ps -ef | grep nmon` 查询进程号,然后杀掉该进程以停止监控。 27 | - 定期监控:本质是 crontab 加上后台监控命令 28 | 29 | ## 解析监控文件 30 | 31 | - 把 nmon 文件转换成 csv 文件:`sort localhost_120427_0922.nmon > localhost_120427_0922.csv` 32 | - 把 csv 转换成 Excel 图表文件: 33 | - 打开 nmon analyser 分析工具:nmon analyser v50_2.xlsm 34 | - 点击 Analyse nmon data 会弹出一个弹出框,选择刚刚转换的 csv 文件,然后就会自动再转化成 excel 文件 35 | - 导出的综合报表的参数说明: 36 | 37 | ## 资料 38 | 39 | - [Nmon命令行:Linux系统性能的监测利器](http://os.51cto.com/art/201406/442795.htm) 40 | - [性能监控和分析工具--nmon](http://kumu1988.blog.51cto.com/4075018/1086256) 41 | - [nmon以及nmon analyser 教程](http://www.xuebuyuan.com/1439800.html) 42 | -------------------------------------------------------------------------------- /Off-line-Yum-Install.md: -------------------------------------------------------------------------------- 1 | # Yum 下载安装包及对应依赖包 2 | 3 | ------ 4 | 5 | ## 安装 6 | 7 | 8 | - 安装该软件:`yum install -y yum-plugin-downloadonly` 9 | 10 | - 以下载 openssh-server 为例: 11 | - `yum install -y openssh-server --downloadonly --downloaddir=/opt/ssh` 12 | - 在 /opt/ssh 目录下有如下内容: 13 | 14 | ``` nginx 15 | -rw-r--r--. 1 root root 280524 Aug 13 2015 openssh-5.3p1-112.el6_7.x86_64.rpm 16 | -rw-r--r--. 1 root root 448872 Aug 13 2015 openssh-clients-5.3p1-112.el6_7.x86_64.rpm 17 | -rw-r--r--. 1 root root 331544 Aug 13 2015 openssh-server-5.3p1-112.el6_7.x86_64.rpm 18 | ``` 19 | 20 | - 安装下载的 rpm 文件:`sudo rpm -ivh *.rpm` 21 | - 利用 yum 安装 rpm 文件,并自动满足依赖的 rpm 文件:`sudo yum localinstall *.rpm` 22 | 23 | 24 | ## 资料 25 | 26 | - 27 | -------------------------------------------------------------------------------- /Openfire-Install-And-Settings.md: -------------------------------------------------------------------------------- 1 | # Openfire 安装和配置 2 | 3 | 4 | ## 本机环境 5 | 6 | - 系统:CentOS 6.7 64 位 7 | - JDK 1.7 64 位 8 | - MySQL 5.6 9 | 10 | 11 | ## Openfire 说明 12 | 13 | 14 | - 官网: 15 | - 官网下载: 16 | - 官网插件列表: 17 | - 官网文档: 18 | - 官网安装手册: 19 | - 官网安装手册-中文翻译版本: 20 | - 官网数据库部署手册: 21 | - javadoc 文档: 22 | - 连接管理工具(上千用户的时候用): 23 | 24 | 25 | ## 下载 26 | 27 | - 官网下载: 28 | - 当前最新版本:**4.0.2**,下载文件:`openfire-4.0.2-1.i386.rpm` 29 | 30 | 31 | ## 安装 MySQL、JDK 32 | 33 | - [MySQL 安装和配置](Mysql-Install-And-Settings.md) 34 | - [JDK 安装](JDK-Install.md) 35 | 36 | 37 | ## 安装 Openfire 38 | 39 | - 要求:JDK 1.7 或以上,我这里使用 1.7 40 | - CentOS 系列(Red Hat、Fedora)官网推荐安装 RPM 文件,因为有一些相关环境他们帮我们考虑了 41 | - 安装命令:`rpm -ivh openfire-4.0.2-1.i386.rpm` 42 | - Openfire 默认给我们生成安装目录:**/opt/openfire** 43 | - 修改 JDK VM 参数:`vim /etc/sysconfig/openfire`,找到 23 行,打开 OPENFIRE_OPTS 删除这一行注释,分配多少 VM 你根据自己的机子来配置。 44 | - 初始化数据库: 45 | - 请确保数据库是运行状态 46 | - 默认的初始化数据库脚本在(其他数据库类型的脚本也在这个目录下):**/opt/openfire/resources/database/openfire_mysql.sql** 47 | - 进入 MySQL 命令行状态:`mysql -u root -p` 48 | - 创建数据库并授权:`create database `openfire` character set utf8;grant all privileges on openfire.* to 'root'@'%';flush privileges;` 49 | - **退出** MySQL 命令行模式,**在终端命令状态下**,执行:`sudo mysql -u root -p openfire < /opt/openfire/resources/database/openfire_mysql.sql` 50 | - 先停掉防火墙:`service iptables stop` 51 | - 启动:`/etc/init.d/openfire start` 52 | - 查看进程:`ps aux | grep openfire` 53 | - 停止:`/etc/init.d/openfire stop` 54 | - 重启:`/etc/init.d/openfire restart` 55 | 56 | 57 | ## 配置 58 | 59 | - 访问 Web 管理界面:`http://192.168.1.113:9090` 60 | - 开始向导配置 Openfire 具体步骤看下列一系列图: 61 | - 需要注意的是:在配置数据库 URL 需要特别注意的是需要加入编码设置(你可以按我的这个链接来,但是 IP 和数据库名你自己修改): 62 | - `jdbc:mysql://192.168.1.113:3306/openfire?rewriteBatchedStatements=true&useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8` 63 | - 如果连接不了数据库,可以看错误日志:`cat /opt/openfire/logs/error.log` 64 | - ![设置](images/Openfire-Settings-a-1.jpg) 65 | - ![设置](images/Openfire-Settings-a-2.jpg) 66 | - ![设置](images/Openfire-Settings-a-3.jpg) 67 | - ![设置](images/Openfire-Settings-a-4.jpg) 68 | - ![设置](images/Openfire-Settings-a-5.jpg) 69 | - ![设置](images/Openfire-Settings-a-6.jpg) 70 | - ![设置](images/Openfire-Settings-a-7.jpg) 71 | - ![设置](images/Openfire-Settings-a-8.jpg) 72 | - ![设置](images/Openfire-Settings-a-9.jpg) 73 | 74 | 75 | ## 使用 Spark 客户端 76 | 77 | - Spark 是一个类似 QQ 的 IM 软件,只是功能比较简单。 78 | - 官网下载: 79 | - 官网 Windows 下有两个版本: 80 | - **spark_2_7_7.exe** Offline installation, includes Java JRE (推荐安装这个,即使你有本机已经有了 JDK 环境) 81 | - **spark_2_7_7_online.exe** Online installation, does not include Java JRE 82 | - 安装完 Spark,启动软件,更玩 QQ 一样道理,具体看下图。你可以用 Spark 登录 Admin 账号。 83 | - ![设置](images/Openfire-Settings-a-11.jpg) 84 | - ![设置](images/Openfire-Settings-a-12.jpg) 85 | - 现在访问 Web 管理界面,给所有在线的会员发个消息,如果你的 Spark 可以收到消息,那就说明整个环境是通的。 86 | - ![设置](images/Openfire-Settings-a-10.jpg) 87 | - ![设置](images/Openfire-Settings-a-13.jpg) 88 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Java 程序员眼中的 Linux 2 | 3 | ## 初衷(Original Intention) 4 | 5 | - 整理下自己所学 6 | - 带动更多的人进入 Linux 世界,特别是做 Java 开发的人 7 | - Github 项目地址,欢迎 `Fork`、`Star`: 8 | - 文章中用到的一些安装包归纳整理: 9 | - **学得越多越是明白一个人的力量是不够的,我只是起了一个引子,希望你能一起参与,真心希望!!!(鞠躬)** 10 | 11 | ## 目录(Contents) 12 | 13 | - [Linux 介绍](Linux.md) 14 | - [Ubuntu 介绍](Ubuntu.md) 15 | - [Ubuntu 安装](Ubuntu-Install.md) 16 | - [Ubuntu 设置(目录)](ubuntu-settings/ubuntu-settings-toc.md) 17 | - [CentOS 介绍](CentOS.md) 18 | - [CentOS 6 安装](CentOS-Install.md) 19 | - [CentOS 7 安装](CentOS-7-Install.md) 20 | - [CentOS 6 和 CentOS 7 差异](CentOS6-and-CentOS7.md) 21 | - [CentOS 设置(目录)](centos-settings/centos-settings-toc.md) 22 | - [Ubuntu 安装 VMware](Ubuntu-Install-VMware.md) 23 | - [VMware 克隆 CentOS 后网卡信息修改](CentOS-Virtual-Machine-Copy-Settings.md) 24 | - [Vim 安装、配置、快捷键列表](Vim-Install-And-Settings.md) 25 | - [Bash 命令](Bash.md) 26 | - [Bash 其他常用命令](Bash-Other-Bash.md) 27 | - [Sed 命令](Sed.md) 28 | - [Linux 下常用压缩文件的解压、压缩](File-Extract-Compress.md) 29 | - [Yum 下载安装包及对应依赖包](Off-line-Yum-Install.md) 30 | - [Zsh 入门](Zsh.md) 31 | - [日常维护](maintenance.md) 32 | - [nmon 系统性能监控工具](Nmon.md) 33 | - [SSH(Secure Shell)介绍](SSH.md) 34 | - [FTP(File Transfer Protocol)介绍](FTP.md) 35 | - [VPN(Virtual Private Network)介绍](VPN.md) 36 | - [NFS(Network FileSystem)介绍](NFS.md) 37 | - [NTP(Network Time Protocol)介绍](NTP.md) 38 | - [Samba 介绍](Samba.md) 39 | - [Crontab 介绍](Crontab.md) 40 | - [Iptables 介绍](Iptables.md) 41 | - [花生壳-安装介绍](Hsk-Install.md) 42 | - [JDK 安装](JDK-Install.md) 43 | - [SVN 安装和配置](SVN-Install-And-Settings.md) 44 | - [Tomcat 安装和配置、优化](Tomcat-Install-And-Settings.md) 45 | - [Jenkins 安装和配置](Jenkins-Install-And-Settings.md) 46 | - [Maven 安装和配置](Maven-Install-And-Settings.md) 47 | - [Nexus 安装和配置](Nexus-Install-And-Settings.md) 48 | - [MySQL 安装和配置](Mysql-Install-And-Settings.md) 49 | - [MySQL 优化](Mysql-Optimize.md) 50 | - [MySQL 测试](Mysql-Test.md) 51 | - [MySQL 教程](Mysql-Tutorial.md) 52 | - [Redis 安装和配置](Redis-Install-And-Settings.md) 53 | - [MongoDB 安装和配置](MongoDB-Install-And-Settings.md) 54 | - [Solr 安装和配置](Solr-Install-And-Settings.md) 55 | - [Jira 安装和配置](Jira-Install-And-Settings.md) 56 | - [Jenkins 安装和配置](Jenkins-Install-And-Settings.md) 57 | - [TeamCity 安装和配置](TeamCity-Install-And-Settings.md) 58 | - [Nginx 安装和配置](Nginx-Install-And-Settings.md) 59 | - [FastDFS 安装和配置](FastDFS-Install-And-Settings.md) 60 | - [FastDFS 结合 GraphicsMagick](FastDFS-Nginx-Lua-GraphicsMagick.md) 61 | - [RabbitMQ 安装和配置](RabbitMQ-Install-And-Settings.md) 62 | - [Openfire 安装和配置](Openfire-Install-And-Settings.md) 63 | - [Rap 安装和配置](Rap-Install-And-Settings.md) 64 | - [Nginx + Keepalived 高可用](Nginx-Keepalived-Install-And-Settings.md) 65 | - [黑客入侵检查](Was-Hacked.md) 66 | - [Shadowsocks 安装和配置](http://code.youmeek.com/2016/08/19/2016/08/VPS/) 67 | - [Mycat 安装和配置](Mycat-Install-And-Settings.md) 68 | - [Zookeeper 安装和配置](Zookeeper-Install.md) 69 | - [Daemontools 工具介绍](Daemontools.md) 70 | - [Tmux 安装和配置](Tmux-Install-And-Settings.md) 71 | - [ELK 日志收集系统安装和配置](ELK-Install-And-Settings.md) 72 | - [Dubbo 安装和配置](Dubbo-Install-And-Settings.md) 73 | - [GitLab 安装和配置](Gitlab-Install-And-Settings.md) 74 | - [Docker 安装和使用](Docker-Install-And-Usage.md) 75 | - [LDAP 安装和使用](LDAP-Install-And-Settings.md) 76 | - [Alfresco 安装和使用](Alfresco-Install-And-Usage.md) 77 | 78 | 79 | ## 下一步(Next) 80 | 81 | - Apache 安装和配置 82 | - LVS + Keepalived 高可用 83 | - MySQL + Keepalived 高可用 84 | - ActiveMQ 服务安装和配置 85 | - Zabbix 安装和配置 86 | - Nagios 安装和配置 87 | - Docker 安装和配置 88 | - sed 学习 89 | - 常用脚本 90 | 91 | ## 联系(Contact) 92 | 93 | - Email:judas.n@qq.com(常用) or admin@youmeek.com(备用) 94 | - Blog: 95 | - QQ 群交流,入群请看: 96 | - 欢迎捐赠 ^_^: 97 | 98 | 99 | ## Github 协同视频教程(Participate) 100 | 101 | - 如果您不会使用 Git 或是 Github 也没关系,请认真学习下面视频教程: 102 | - Judas.n 录制 103 | - 视频格式:MP4 104 | - 分辨率:1920 X 1080 105 | - 片长:16 min 106 | - 文件大小:62 M 107 | - 下载 108 | - 百度云盘: 109 | - 360 网盘(2fb5): 110 | 111 | ## Github 常用按钮说明 112 | 113 | - Watch:关注该项目,作者有更新的时候,会在你的 Github 主页有通知消息。 114 | - Star:收藏该项目,在你的头像上有一个“Your stars”链接,可以看到你的收藏列表。 115 | - Fork:复制一份项目到的Github空间上,你可以自己开发自己的这个地址项目,然后 Pull Request 给项目原主人。 116 | 117 | ## 参与作者汇总(Author) 118 | 119 | |作者(按参与时间排序)|地址| 120 | |:---------|:---------| 121 | |Judas.n|| 122 | |nl101531|| 123 | 124 | ## AD 125 | 126 | - [我个人开发的个性化定制网址导航:GitNavi.com](http://www.gitnavi.com) 127 | -------------------------------------------------------------------------------- /RabbitMQ-Install-And-Settings.md: -------------------------------------------------------------------------------- 1 | # RabbitMQ 安装和配置 2 | 3 | 4 | ## RabbitMQ 说明 5 | 6 | - MQ 全称为 Message Queue, 消息队列(MQ)是一种应用程序对应用程序的通信方法。应用程序通过读写出入队列的消息(针对应用程序的数据)来通信,而无需专用连接来链接它们。 7 | - RabbitMQ 是一个在 AMQP 基础上完整的,可复用的企业消息系统。他遵循 Mozilla Public License 开源协议。 8 | - RabbitMQ WIKI: 9 | - RabbitMQ 百科: 10 | - RabbitMQ 官网: 11 | - RabbitMQ 官网下载: 12 | - RabbitMQ 官网安装文档: 13 | - RabbitMQ 文档: 14 | - 优先: 15 | - 次要: 16 | 17 | 18 | ## 先安装 Erlang 19 | 20 | - 有 EPEL 源的情况(需要安装的内容较多,宽带要能跟上):`sudo yum install erlang` 21 | - RabbitMQ 官网提供 Erlang 安装包: 22 | - 下载地址: 23 | - 下载好之后,安装下面两个文件: 24 | - `sudo yum localinstall -y esl-erlang_18.1-1~centos~6_amd64.rpm` 25 | - `sudo yum localinstall -y esl-erlang-compat-18.1-1.noarch.rpm` 26 | 27 | 28 | ## 安装 RabbitMQ 29 | 30 | - 此时(2016-04),最新版:**3.6.1** 31 | - 安装:`rpm --import https://www.rabbitmq.com/rabbitmq-signing-key-public.asc` 32 | - 安装:`sudo yum install -y rabbitmq-server-3.6.1-1.noarch.rpm` 33 | - 启动服务: 34 | - 先看下自己的主机名:`hostname`,我的主机名是:**judasnHost2** 35 | - 先修改一下 host 文件:`vim /etc/hosts`,添加一行:`127.0.0.1 judasnHost2`(必须这样做) 36 | - 启动:`service rabbitmq-server start`,启动一般都比较慢,所以别急 37 | - 停止:`service rabbitmq-server stop` 38 | - 重启:`service rabbitmq-server restart` 39 | - 设置开机启动:`chkconfig rabbitmq-server on` 40 | 41 | 42 | ## 配置 43 | 44 | - 查找默认配置位置:`find / -name "rabbitmq.config.example"`,我这边搜索结果是:`/usr/share/doc/rabbitmq-server-3.6.1/rabbitmq.config.example` 45 | - 复制默认配置:`cp /usr/share/doc/rabbitmq-server-3.6.1/rabbitmq.config.example /etc/rabbitmq/` 46 | - 修改配置文件名:`cd /etc/rabbitmq ; mv rabbitmq.config.example rabbitmq.config` 47 | - 编辑配置文件,开启用户远程访问:`vim rabbitmq.config` 48 | - 在 64 行,默认有这样一句话:`%% {loopback_users, []},`,注意,该语句最后有一个逗号,等下是要去掉的 49 | - 我们需要改为:`{loopback_users, []}`, 50 | - 开启 Web 界面管理:`rabbitmq-plugins enable rabbitmq_management` 51 | - 重启 RabbitMQ 服务:`service rabbitmq-server restart` 52 | - 开放防火墙端口: 53 | - `sudo iptables -I INPUT -p tcp -m tcp --dport 15672 -j ACCEPT` 54 | - `sudo iptables -I INPUT -p tcp -m tcp --dport 5672 -j ACCEPT` 55 | - `sudo service iptables save` 56 | - `sudo service iptables restart` 57 | - 浏览器访问:`http://192.168.1.114:15672` 58 | 默认管理员账号:**guest** 59 | 默认管理员密码:**guest** 60 | - 添加新授权用户(如下图所示): 61 | - ![RabbitMQ-Add-User](images/RabbitMQ-Add-User-a-1.jpg) 62 | - 添加 Host(如下图所示): 63 | - ![RabbitMQ-Add-User](images/RabbitMQ-Add-User-a-2.jpg) 64 | - 给添加的 Host 设置权限(如下图所示): 65 | - ![RabbitMQ-Add-User](images/RabbitMQ-Add-User-a-3.gif) 66 | - 交换机绑定队列(如下图所示): 67 | - ![RabbitMQ-Bindings-Queue](images/RabbitMQ-Bindings-Queue-a-1.gif) 68 | -------------------------------------------------------------------------------- /Rap-Install-And-Settings.md: -------------------------------------------------------------------------------- 1 | # Rap 安装和配置 2 | 3 | 4 | ## 本机环境 5 | 6 | - 系统:CentOS 6.7 64 位 7 | - MySQL 5.6 8 | - JDK 1.8 9 | - Tomcat 8 10 | - Redis 3.0.7 11 | - Rap 0.14.1 12 | 13 | 14 | ## Rap 说明 15 | 16 | 17 | - 官网: 18 | - 在线版: 19 | - 官网 Wiki: 20 | - 官网部署手册: 21 | - 用户手册: 22 | 23 | 24 | ## 下载 25 | 26 | - 官网下载: 27 | - 当前最新版本:**0.14.1** 28 | - 下载 war 部署包: 29 | 30 | 31 | ## 安装 MySQL、JDK、Tomcat、Redis 32 | 33 | - [MySQL 安装和配置](Mysql-Install-And-Settings.md) 34 | - [JDK 安装](JDK-Install.md) 35 | - [Tomcat 安装和配置、优化](Tomcat-Install-And-Settings.md) 36 | - [Redis 安装和配置](Redis-Install-And-Settings.md) 37 | 38 | 39 | ## 安装 Rap 40 | 41 | - 创建数据库,并创建权限用户 42 | 43 | ``` sql 44 | CREATE DATABASE `rap_db` CHARACTER SET utf8; 45 | CREATE USER 'rap'@'%' IDENTIFIED BY '123456'; 46 | GRANT ALL PRIVILEGES ON rap_db.* TO 'rap'@'%'; 47 | FLUSH PRIVILEGES; 48 | ``` 49 | 50 | - 把 RAP-0.14.1-SNAPSHOT.war 移动到 tomcat 的 webapp 目录下,删除其他多余的文件夹 51 | - 解压:`unzip -x RAP-0.14.1-SNAPSHOT.war -d ROOT` 52 | - 初始化数据库:`mysql -u rap -p rap_db < /usr/program/tomcat8/webapps/ROOT/WEB-INF/classes/database/initialize.sql` 53 | - 修改连接数据库的配置信息:`vim /usr/program/tomcat8/webapps/ROOT/WEB-INF/classes/config.properties ` 54 | - 停掉防火墙:`service iptables stop` 55 | - 启动 Redis:`/usr/local/bin/redis-server /etc/redis.conf` 56 | - 启动 Tomcat:`sh /usr/program/tomcat8/bin/startup.sh ; tail -200f /usr/program/tomcat8/logs/catalina.out` 57 | -------------------------------------------------------------------------------- /SSH.md: -------------------------------------------------------------------------------- 1 | # SSH(Secure Shell)介绍 2 | 3 | 4 | 5 | ## SSH 安装 6 | 7 | - 查看是否已安装: 8 | - CentOS:`rpm -qa | grep openssh` 9 | - Ubuntu:`dpkg -l | grep openssh` 10 | 11 | - 安装: 12 | - CentOS 6:`sudo yum install -y openssh-server openssh-clients` 13 | - Ubuntu:`sudo apt-get install -y openssh-server openssh-client` 14 | 15 | 16 | ## SSH 修改连接端口 17 | 18 | - 配置文件介绍(记得先备份):`sudo vim /etc/ssh/sshd_config` 19 | - 打开这一行注释:Port 22 20 | - 自定义端口选择建议在万位的端口,如:10000-65535之间,假设这里我改为 60001 21 | - 给新端口加到防火墙中: 22 | - 添加规则:`iptables -I INPUT -p tcp -m tcp --dport 60001 -j ACCEPT` 23 | - 保存规则:`service iptables save` 24 | - 重启 iptables:`service iptables restart` 25 | 26 | ## 设置超时 27 | 28 | - ClientAliveInterval指定了服务器端向客户端请求消息的时间间隔, 默认是0,不发送。而ClientAliveInterval 300表示5分钟发送一次,然后客户端响应,这样就保持长连接了。 29 | - ClientAliveCountMax,默认值3。ClientAliveCountMax表示服务器发出请求后客户端没有响应的次数达到一定值,就自动断开,正常情况下,客户端不会不响应。 30 | - 正常我们可以设置为: 31 | - ClientAliveInterval 300 32 | - ClientAliveCountMax 3 33 | - 按上面的配置的话,300*3=900秒=15分钟,即15分钟客户端不响应时,ssh连接会自动退出。 34 | 35 | ## SSH 允许 root 账户登录 36 | 37 | - 编辑配置文件(记得先备份):`sudo vim /etc/ssh/sshd_config` 38 | - 允许 root 账号登录 39 | - 注释掉:`PermitRootLogin without-password` 40 | - 新增一行:`PermitRootLogin yes` 41 | 42 | ## SSH 不允许 root 账户登录 43 | 44 | - 新增用户和把新增的用户改为跟 root 同等权限方法:[Bash.md] 45 | - 编辑配置文件(记得先备份):`sudo vim /etc/ssh/sshd_config` 46 | - 注释掉这一句(如果没有这一句则不管它):`PermitRootLogin yes` 47 | 48 | ## SSH 密钥登录 49 | 50 | - 生成秘钥和公钥文件,命令:`sudo ssh-keygen`,在交互提示中连续按三次回车,如果看得懂交互的表达,那就根据你自己需求来。默认生成密钥和公钥文件是在:/root/.ssh。 51 | - 进入生成目录:`cd /root/.ssh`,可以看到有两个文件:id_rsa (私钥) 和 id_rsa.pub (公钥) 52 | - 在 .ssh 目录下创建 SSH 认证文件,命令:`touch /root/.ssh/authorized_keys` 53 | - 将公钥内容写到SSH认证文件里面,命令:`cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys` 54 | - 修改SSH认证文件权限,命令: 55 | - `sudo chmod 700 /root/.ssh` 56 | - `sudo chmod 600 /root/.ssh/authorized_keys` 57 | - 重启服务:`sudo service sshd restart` 58 | - 设置 SSH 服务默认启动:`sudo sysv-rc-conf ssh on` 59 | - 现在 SSH 客户端可以去拿着 SSH 服务器端上的 id_rsa,在客户端指定秘钥文件地址即可,这个一般由于你使用的客户端决定的,我这里推荐的是 Xshell 软件。 60 | 61 | ## 限制只有某一个IP才能远程登录服务器 62 | 63 | - 在该配置文件:`vim /etc/hosts.deny` 64 | - 添加该内容:`sshd:ALL` 65 | - 在该配置文件:`vim /etc/hosts.allow` 66 | - 添加该内容:`sshd:123.23.1.23` 67 | 68 | ## 限制某些用户可以 SSH 访问 69 | 70 | - 在该配置文件:`vim /etc/ssh/sshd_config` 71 | - 添加该内容:`AllowUsers root userName1 userName2` 72 | 73 | ## 修改完配置都要记得重启服务 74 | 75 | - 命令:`service sshd restart` 76 | 77 | ## 常用 SSH 连接终端 78 | 79 | - Windows -- Xshell: 80 | - Mac -- ZOC: 81 | 82 | ## SSH 资料 83 | 84 | - 85 | - 86 | - 87 | -------------------------------------------------------------------------------- /SUMMARY.md: -------------------------------------------------------------------------------- 1 | # Java 程序员眼中的 Linux 2 | 3 | * [Linux 介绍](Linux.md) 4 | * [Ubuntu 介绍](Ubuntu.md) 5 | * [Ubuntu 安装](Ubuntu-Install.md) 6 | * [Ubuntu 设置(目录)](ubuntu-settings/ubuntu-settings-toc.md) 7 | * [CentOS 介绍](CentOS.md) 8 | * [CentOS 6 安装](CentOS-Install.md) 9 | * [CentOS 7 安装](CentOS-7-Install.md) 10 | * [CentOS 6 和 CentOS 7 差异](CentOS6-and-CentOS7.md) 11 | * [CentOS 设置(目录)](centos-settings/centos-settings-toc.md) 12 | * [Ubuntu 安装 VMware](Ubuntu-Install-VMware.md) 13 | * [VMware 克隆 CentOS 后网卡信息修改](CentOS-Virtual-Machine-Copy-Settings.md) 14 | * [Vim 安装、配置、快捷键列表](Vim-Install-And-Settings.md) 15 | * [Bash 命令](Bash.md) 16 | * [Bash 其他常用命令](Bash-Other-Bash.md) 17 | * [Sed 命令](Sed.md) 18 | * [Linux 下常用压缩文件的解压、压缩](File-Extract-Compress.md) 19 | * [Yum 下载安装包及对应依赖包](Off-line-Yum-Install.md) 20 | * [Zsh 入门](Zsh.md) 21 | * [日常维护](maintenance.md) 22 | * [nmon 系统性能监控工具](Nmon.md) 23 | * [SSH(Secure Shell)介绍](SSH.md) 24 | * [FTP(File Transfer Protocol)介绍](FTP.md) 25 | * [VPN(Virtual Private Network)介绍](VPN.md) 26 | * [NFS(Network FileSystem)介绍](NFS.md) 27 | * [NTP(Network Time Protocol)介绍](NTP.md) 28 | * [Samba 介绍](Samba.md) 29 | * [Crontab 介绍](Crontab.md) 30 | * [Iptables 介绍](Iptables.md) 31 | * [花生壳-安装介绍](Hsk-Install.md) 32 | * [JDK 安装](JDK-Install.md) 33 | * [SVN 安装和配置](SVN-Install-And-Settings.md) 34 | * [Tomcat 安装和配置、优化](Tomcat-Install-And-Settings.md) 35 | * [Jenkins 安装和配置](Jenkins-Install-And-Settings.md) 36 | * [Maven 安装和配置](Maven-Install-And-Settings.md) 37 | * [Nexus 安装和配置](Nexus-Install-And-Settings.md) 38 | * [MySQL 安装和配置](Mysql-Install-And-Settings.md) 39 | * [MySQL 优化](Mysql-Optimize.md) 40 | * [MySQL 测试](Mysql-Test.md) 41 | * [MySQL 教程](Mysql-Tutorial.md) 42 | * [Redis 安装和配置](Redis-Install-And-Settings.md) 43 | * [MongoDB 安装和配置](MongoDB-Install-And-Settings.md) 44 | * [Solr 安装和配置](Solr-Install-And-Settings.md) 45 | * [Jira 安装和配置](Jira-Install-And-Settings.md) 46 | * [Jenkins 安装和配置](Jenkins-Install-And-Settings.md) 47 | * [TeamCity 安装和配置](TeamCity-Install-And-Settings.md) 48 | * [Nginx 安装和配置](Nginx-Install-And-Settings.md) 49 | * [FastDFS 安装和配置](FastDFS-Install-And-Settings.md) 50 | * [FastDFS 结合 GraphicsMagick](FastDFS-Nginx-Lua-GraphicsMagick.md) 51 | * [RabbitMQ 安装和配置](RabbitMQ-Install-And-Settings.md) 52 | * [Openfire 安装和配置](Openfire-Install-And-Settings.md) 53 | * [Rap 安装和配置](Rap-Install-And-Settings.md) 54 | * [Nginx + Keepalived 高可用](Nginx-Keepalived-Install-And-Settings.md) 55 | * [黑客入侵检查](Was-Hacked.md) 56 | * [Shadowsocks 安装和配置](http://code.youmeek.com/2016/08/19/2016/08/VPS/) 57 | * [Mycat 安装和配置](Mycat-Install-And-Settings.md) 58 | * [Zookeeper 安装和配置](Zookeeper-Install.md) 59 | * [Daemontools 工具介绍](Daemontools.md) 60 | * [Tmux 安装和配置](Tmux-Install-And-Settings.md) 61 | * [ELK 日志收集系统安装和配置](ELK-Install-And-Settings.md) 62 | * [Dubbo 安装和配置](Dubbo-Install-And-Settings.md) 63 | * [GitLab 安装和配置](Gitlab-Install-And-Settings.md) 64 | * [Docker 安装和使用](Docker-Install-And-Usage.md) 65 | * [LDAP 安装和使用](LDAP-Install-And-Settings.md) 66 | * [Alfresco 安装和使用](Alfresco-Install-And-Usage.md) 67 | -------------------------------------------------------------------------------- /Samba.md: -------------------------------------------------------------------------------- 1 | # Samba 介绍 2 | 3 | 4 | ## Samba 安装 5 | 6 | - 查看是否已安装: 7 | - CentOS:`rpm -qa | grep samba` 8 | - Ubuntu:`dpkg -l | grep samba` 9 | 10 | - 安装: 11 | - CentOS 6:`XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX` 12 | - Ubuntu:`sudo apt-get install -y samba samba-client` 13 | 14 | ## Samba 服务器配置文件常用参数 15 | 16 | - 配置文件介绍(记得先备份):`sudo vim /etc/samba/smb.conf` 17 | - 该配置解释: 18 | - 在 [globle] 区域 19 | - workgroup = WORKGROUP #WORKGROUP表示Windows默认的工作组名称,一般共享给windows是设置为WORKGROUP 20 | - security = user #ubuntu下配置文件默认没有这句,这个是自己填上去的。表示指定samba的安全等级,安全等级分别有四种:share(其他人不需要账号密码即可访问共享目录)、user(检查账号密码)、server(表示检查密码由另外一台服务器负责)、domain(指定Windows域控制服务器来验证用户的账号和密码) 21 | - 在新区域区域 22 | - 当 security = share 使用下面这段,这段自己添加的,其中myshare这个名字表示其他机子访问该分享地址时用:file://该服务机IP/myshare 23 | ``` 24 | [myshare] 25 | comment = share all 26 | path = /opt/mysamba #分享的目录,其中这个目录需要chmod 777 /opt/mysamba权限 27 | browseable = yes 28 | writable = yes 29 | public =yes 30 | ``` 31 | - 当 security = user 使用下面这段,这段自己添加的,其中 myshare2 这个名字表示其他机子访问该分享地址时用:file://该服务机IP/myshare2 32 | - 可以返回的账号必须是系统已经存在的账号。先给系统添加账号:`useradd user1`,再用samba的设置添加账号:`pdbedit -a user1`,会让你设立该samba账号密码。列出账号:`pdbedit -L` 33 | ``` 34 | [myshare2] 35 | comment = share for users 36 | path = /opt/mysamba2 #分享的目录,其中这个目录需要chmod 777 /opt/mysamba权限 37 | browseable = yes 38 | writable = yes 39 | public = no 40 | ``` 41 | - 启动服务: 42 | - `sudo service samba restart` 43 | 44 | ## Samba 资料 45 | 46 | - 47 | - 48 | - 49 | - 50 | -------------------------------------------------------------------------------- /Sed.md: -------------------------------------------------------------------------------- 1 | # Sed 常用命令 2 | 3 | - 轻量级流编辑器,一般用来处理文本类文件 4 | - **sed 是非交互式的编辑器。它不会修改文件,除非使用 shell 重定向来保存结果。默认情况下,所有的输出行都被打印到屏幕上** 5 | - **用 sed -i 会实际写入**,下面为了演示,都没加该参数,有需要可以自行添加。 6 | 7 | ## 基础例子 8 | 9 | - 有一个文件:/opt/log4j2.properties 10 | 11 | ``` ini 12 | status = error 13 | 14 | # log action execution errors for easier debugging 15 | logger.action.name = org.elasticsearch.action 16 | logger.action.level = debug 17 | 18 | appender.console.type = Console 19 | appender.console.name = console 20 | appender.console.layout.type = PatternLayout 21 | appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%m%n 22 | 23 | appender.rolling.type = RollingFile 24 | appender.rolling.name = rolling 25 | appender.rolling.fileName = ${sys:es.logs}.log 26 | appender.rolling.layout.type = PatternLayout 27 | appender.rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%.-10000m%n 28 | appender.rolling.filePattern = ${sys:es.logs}-%d{yyyy-MM-dd}.log 29 | appender.rolling.policies.type = Policies 30 | appender.rolling.policies.time.type = TimeBasedTriggeringPolicy 31 | appender.rolling.policies.time.interval = 1 32 | appender.rolling.policies.time.modulate = true 33 | 34 | rootLogger.level = info 35 | rootLogger.appenderRef.console.ref = console 36 | rootLogger.appenderRef.rolling.ref = rolling 37 | ``` 38 | 39 | - `p` 参数表示打印,一般配合 -n(安静模式)进行使用 40 | - `sed -n '7,10p' /opt/log4j2.properties`:显示第 7 ~ 10 行内容 41 | - `sed -n '7p' /opt/log4j2.properties`:显示第 7 行内容 42 | - `d` 删除 43 | - `cat -n /opt/log4j2.properties |sed '7,10d'`:剔除 7 ~ 10 行内容,然后显示文件所有内容出来(实际文件是未删除的) 44 | - `a` 追加 45 | - `cat -n /opt/log4j2.properties |sed '1a GitNavi.com'`:追加 GitNavi.com 内容(追加在下一行展示),然后显示文件所有内容出来 46 | - `c` 替换 47 | - `cat -n /opt/log4j2.properties |sed '1,4c GitNavi.com'`:将 1 ~ 4 行内容替换成 GitNavi.com 48 | - `s`: 搜索并替换 49 | - `sed 's/time/timeing/g' /opt/log4j2.properties`:将文件中所有 time 替换成 timeing 并展示 50 | - `sed 's/^#*//g' /opt/log4j2.properties`:将文件中每一行以 # 开头的都替换掉空字符并展示 51 | - `sed 's/^#[ ]*//g' /opt/log4j2.properties`:将文件中每一行以 # 开头的,并且后面的一个空格,都替换掉空字符并展示 52 | - `sed 's/^[ ]*//g' /opt/log4j2.properties`:将文件中每一行以空格开头,都替换掉空字符并展示 53 | - `sed 's/^[0-9][0-9]*//g' /opt/log4j2.properties`:将文件中每一行以数字开头,都替换掉空字符并展示 54 | - `sed '4,6s/^/#/g' /opt/log4j2.properties`:将文件中 4 ~ 6 行添加 # 开头 55 | - `sed '4,6s/^#//g' /opt/log4j2.properties`:将文件中 4 ~ 6 行 # 开头去掉 56 | - ``: 57 | - ``: 58 | - ``: 59 | - ``: 60 | - ``: 61 | - ``: 62 | - ``: 63 | - ``: 64 | - ``: 65 | - ``: 66 | 67 | 68 | ## 实用例子 69 | 70 | - `ifconfig eth0 |grep 'inet addr' |sed 's/^.*addr://g' |sed 's/Bcast.*$//g'`:CentOS 6 只显示 IP 71 | - `ifconfig ens33 |grep 'inet' |sed 's/^.*inet//g' |sed 's/netmask.*$//g' |sed -n '1p'`:CentOS 7.3 只显示 IP。先用 grep 筛选中包含 inet 的数据。 72 | - `s` 参数开头表示的是搜索替换,`/^.*inet` 表示从开头到 inet 之间,`//` 为空内容,`/g`,表示处理这一行所有匹配的内容。`/netmask.*$` 表示从 netmask 到这一行结束的内容 73 | - ``: 74 | - ``: 75 | - ``: 76 | - ``: 77 | - ``: 78 | - ``: 79 | - ``: 80 | - ``: 81 | 82 | 83 | 84 | ## 资料 85 | 86 | - 《构建高可用 Linux服务器》 87 | - -------------------------------------------------------------------------------- /Shell.md: -------------------------------------------------------------------------------- 1 | # Shell 脚本编程 2 | 3 | ## 环境 4 | 5 | - CentOS 7.3 6 | - bash 7 | - IntelliJ IDEA 2017.1 + Vim 8 | - Xshell 5 9 | 10 | ## 基础 11 | 12 | - shell 本质是一个命令解析器,我们这里讲的是 shell 脚本的编写/编程。 13 | - shell 的软件有:sh、bash、zsh、csh、tcsh、ksh 等,Linux 发行版一般是 bash,我个人常用 bash 和 zsh 14 | - 查看 bash 版本号:`bash --version`,CentOS 7.3 是 4.2.46 15 | - shell 脚本文件后缀:`sh` 16 | - shell 脚本开头语言标识。文件开头是:`#!/bin/sh` 或 `#!/bin/bash`(优先使用这个)(其实也可以不加,因为 Linux 默认就是 bash,只是为了合理,一般都要加),主要是告诉哪个解析器来执行脚本。如果该语句写在非第一行,那就是当做注释使用。 17 | - 其中 /bin/sh 是 bash 的软链接,所以以上两种写法都可以。(证明:`ls -l /bin/sh`) 18 | - 但是业界上,sh 和 bash 其实是有历史区别的。 19 | - sh 即 Bourne shell,POSIX(Portable Operating System Interface)标准的 shell 解释器,它的二进制文件路径通常是 /bin/sh,由 Bell Labs 开发。 20 | - bash 是 Bourne shell 的替代品,属 GNU Project,二进制文件路径通常是 /bin/bash。 21 | - Mac OS 上 /bin/sh 和 /bin/bash 是两个不同的文件 22 | - 换行符(line separator):IntelliJ IDEA 下编写脚本的时候一定要注意后下角的 LF 还是 CRLF,LF 才是 Linux 的要求。 23 | - 执行脚本命令:`bash /opt/test.sh`(推荐),还有:`. /opt/test.sh`,`source /opt/test.sh` 24 | - 用 source 或是 点开头 的优点是:后面执行的脚本可以读取 source 或 点 执行脚本中的变量内容,但是这个读取也只是基于一个 shell 状态下,如果是另外开的 shell 是没有用的。 25 | - 注释:用 # 号开头,只有单行注释,没有多行注释的用法。 26 | - 如果脚本是用于 Crontab 定时任务,则定义在 /etc/profile 中的环境变量是无法使用的,需要重新定义。 27 | - 给脚本赋上执行权限:` chmod +x gitnavi.sh` 28 | 29 | ## 变量 30 | 31 | ### 变量概念 32 | 33 | - **敲黑板,重点**:等于号,左右两边不要有空格,这个跟一般语言的语法很有冲突感。 34 | - 查看系统的环境变量列表:`env` 或 `set` 35 | - 用户环境变量设置位置:`vim ~/.bash_profile` 36 | - 全局环境变量:`vim /etc/profile`,或者在目录:/etc/profile.d/ 下自己写一个 sh 文件,然后设置一下变量 37 | - 变量命名只能使用字母,下划线和数字,并且不能以数字开头 38 | - 环境变量要建议设置为全大写 39 | - 环境变量需要 export 导出,完整设置,比如下面设置 JDK: 40 | 41 | ``` 42 | JAVA_HOME=/usr/program/jdk1.8.0_121 43 | export JAVA_HOME 44 | ``` 45 | 46 | - 普通字符串变量:`gitnavi_url="gitnavi.com"`,虽然也可以用单引号或是不使用任何符号,但是不推荐。 47 | - 使用双引号可以在变量中使用其他变量,双引号内容中有双引号,再加个转移斜杠即可,如下: 48 | - `str="Hello, \"${gitnavi_url}\"! \n"` 49 | - 数值型变量:`gitnavi_age=3` 50 | - 路径型变量:`gitnavi_patch=/com/gitnavi/youmeek` 51 | - 删除变量:`unset gitnavi_url` 52 | - 使用变量: 53 | - `echo $gitnavi_url`,不推荐这种 54 | - `echo ${gitnavi_url}`,推荐这种 55 | - 拼接字符串: 56 | 57 | ``` shell 58 | gitnavi_url="gitnavi.com" 59 | gitnavi_say="hello, ${gitnavi_url} !" 60 | 61 | echo ${gitnavi_say} 62 | ``` 63 | 64 | - 获取字符串长度,多加一个 # 号: 65 | 66 | ``` shell 67 | gitnavi_url="gitnavi.com" 68 | echo ${#gitnavi_url} 69 | ``` 70 | 71 | - 截取字符串(下标是从 0 开始): 72 | 73 | ``` shell 74 | gitnavi_url="gitnavi.com" 75 | echo ${gitnavi_url:1:4} 76 | ``` 77 | 78 | - 查找子字符串出现的最开始下标位置(下标开始是 0,所以下面结果是:2): 79 | 80 | ``` shell 81 | gitnavi_url="gitnavi.com" 82 | echo `expr index "${gitnavi_url}" navi` 83 | ``` 84 | 85 | ## 控制流 86 | 87 | ### 条件语句 88 | 89 | - if 90 | 91 | ``` shell 92 | if [ condition ] 93 | then 94 | command 95 | fi 96 | ``` 97 | 98 | - if - else 99 | 100 | ``` shell 101 | if [ condition ] 102 | then 103 | command 104 | else 105 | command 106 | fi 107 | ``` 108 | 109 | - if - else if - else if - else 110 | 111 | ``` shell 112 | if [ condition1 ] 113 | then 114 | command1 115 | elif [ condition2 ] 116 | command2 117 | elif [ condition3 ] 118 | command3 119 | else 120 | commandN 121 | fi 122 | ``` 123 | 124 | ### case 语句(switch - case) 125 | 126 | - 条件可以是一个变量或是常数 127 | 128 | ``` shell 129 | case "${gitnavi_url}" in 130 | "${condition1}" ) 131 | command1 132 | ;; 133 | 134 | "helloworld" ) 135 | command2 136 | ;; 137 | 138 | * ) 139 | command3 # 这里相当于 case 语句的 default 140 | ;; 141 | 142 | esac 143 | ``` 144 | 145 | 146 | ### 循环语句 147 | 148 | - for 语句 149 | - 列表是一组值(数字、**字符串**等)组成的序列,每个值通过空格分隔。每循环一次,就将列表中的下一个值赋给变量。 150 | 151 | ``` shell 152 | for 变量 in 列表 153 | do 154 | command1 155 | command2 156 | ... 157 | commandN 158 | done 159 | ``` 160 | 161 | - while 语句 162 | 163 | ``` shell 164 | while [ condition ] 165 | do 166 | command 167 | done 168 | ``` 169 | 170 | 171 | ## 资料 172 | 173 | - 174 | - 175 | - 176 | - 177 | - 178 | - 179 | -------------------------------------------------------------------------------- /TOC.md: -------------------------------------------------------------------------------- 1 | - [Linux 介绍](Linux.md) 2 | - [Ubuntu 介绍](Ubuntu.md) 3 | - [Ubuntu 安装](Ubuntu-Install.md) 4 | - [Ubuntu 设置(目录)](ubuntu-settings/ubuntu-settings-toc.md) 5 | - [CentOS 介绍](CentOS.md) 6 | - [CentOS 安装](CentOS-Install.md) 7 | - [CentOS 设置(目录)](centos-settings/centos-settings-toc.md) 8 | - [Ubuntu 安装 VMware](Ubuntu-Install-VMware.md) 9 | - [VMware 克隆 CentOS 后网卡信息修改](CentOS-Virtual-Machine-Copy-Settings.md) 10 | - [Vim 安装、配置、快捷键列表](Vim-Install-And-Settings.md) 11 | - [Bash 命令](Bash.md) 12 | - [Bash 其他常用命令](Bash-Other-Bash.md) 13 | - [Linux 下常用压缩文件的解压、压缩](File-Extract-Compress.md) 14 | - [Yum 下载安装包及对应依赖包](Off-line-Yum-Install.md) 15 | - [Zsh 入门](Zsh.md) 16 | - [日常维护](maintenance.md) 17 | - [nmon 系统性能监控工具](Nmon.md) 18 | - [SSH(Secure Shell)介绍](SSH.md) 19 | - [FTP(File Transfer Protocol)介绍](FTP.md) 20 | - [VPN(Virtual Private Network)介绍](VPN.md) 21 | - [NFS(Network FileSystem)介绍](NFS.md) 22 | - [NTP(Network Time Protocol)介绍](NTP.md) 23 | - [Samba 介绍](Samba.md) 24 | - [Crontab 介绍](Crontab.md) 25 | - [Iptables 介绍](Iptables.md) 26 | - [花生壳-安装介绍](Hsk-Install.md) 27 | - [JDK 安装](JDK-Install.md) 28 | - [SVN 安装和配置](SVN-Install-And-Settings.md) 29 | - [Tomcat 安装和配置、优化](Tomcat-Install-And-Settings.md) 30 | - [Jenkins 安装和配置](Jenkins-Install-And-Settings.md) 31 | - [Maven 安装和配置](Maven-Install-And-Settings.md) 32 | - [Nexus 安装和配置](Nexus-Install-And-Settings.md) 33 | - [MySQL 安装和配置](Mysql-Install-And-Settings.md) 34 | - [MySQL 优化](Mysql-Optimize.md) 35 | - [MySQL 教程](Mysql-Tutorial.md) 36 | - [Redis 安装和配置](Redis-Install-And-Settings.md) 37 | - [Solr 安装和配置](Solr-Install-And-Settings.md) 38 | - [Jira 安装和配置](Jira-Install-And-Settings.md) 39 | - [Jenkins 安装和配置](Jenkins-Install-And-Settings.md) 40 | - [TeamCity 安装和配置](TeamCity-Install-And-Settings.md) 41 | - [Nginx 安装和配置](Nginx-Install-And-Settings.md) 42 | - [FastDFS 安装和配置](FastDFS-Install-And-Settings.md) 43 | - [FastDFS 结合 GraphicsMagick](FastDFS-Nginx-Lua-GraphicsMagick.md) 44 | - [RabbitMQ 安装和配置](RabbitMQ-Install-And-Settings.md) 45 | - [Openfire 安装和配置](Openfire-Install-And-Settings.md) 46 | - [Rap 安装和配置](Rap-Install-And-Settings.md) 47 | - [Nginx + Keepalived 高可用](Nginx-Keepalived-Install-And-Settings.md) 48 | - [黑客入侵检查](Was-Hacked.md) 49 | - [Shadowsocks 安装和配置](http://code.youmeek.com/2016/08/19/2016/08/VPS/) 50 | - [Mycat 安装和配置](Mycat-Install-And-Settings.md) -------------------------------------------------------------------------------- /Tmux-Install-And-Settings.md: -------------------------------------------------------------------------------- 1 | # Tmux 安装和配置 2 | 3 | ## 介绍 4 | 5 | - 说明:`tmux is a "terminal multiplexer", it enables a number of terminals (or windows) to be accessed and controlled from a single terminal. tmux is intended to be a simple, modern, BSD-licensed alternative to programs such as GNU screen.` 6 | - 大家的主要用途:`提供了一个窗体组随时存储和恢复的功能`,本质有点类似守护进程感。 7 | - 官网: 8 | - 官网 Github: 9 | - 当前(201703)最新版本:**2.3** 10 | 11 | ## 安装 12 | 13 | - CentOS:`yum install -y tmux` 14 | - Ubuntu:`apt-get install -y tmux` 15 | - Mac:`brew install tmux` 16 | - 也可以看官网 GitHub 进行编译安装。 17 | 18 | ## 基本概念 19 | 20 | - session:一个服务器可以包含多个会话,可以理解成是一个特定的终端组合,通常将同一任务下的工作放到一个会话中。 21 | - window:一个会话可以包含多个窗口,一个窗口就相当于普通终端的一个标签,通常在不同的窗口中完成不同的工作。 22 | - pane:一个窗口可以被分割成多个小的窗格。 23 | 24 | ## 基础用法 25 | 26 | - 启动:`tmux` 27 | - 信息查询: 28 | - `tmux list-keys` 列出所有可以的快捷键和其运行的 tmux 命令 29 | - `tmux list-commands` 列出所有的 tmux 命令及其参数 30 | - `tmux info` 流出所有的 session, window, pane, 运行的进程号,等。 31 | - 窗口的控制: 32 | - session 会话:session是一个特定的终端组合。输入tmux就可以打开一个新的session 33 | - `tmux new -s session_name` 创建一个叫做 session_name 的 tmux session 34 | - `tmux attach -t session_name` 重新开启叫做 session_name 的 tmux session 35 | - `tmux switch -t session_name` 转换到叫做 session_name 的 tmux session 36 | - `tmux list-sessions` / tmux ls 列出现有的所有 session 37 | - `tmux detach` 离开当前开启的 session 38 | - `tmux kill-server` 关闭所有 session 39 | - window 窗口:session 中可以有不同的 window(但是同时只能看到一个 window) 40 | - `tmux new-window` 创建一个新的 window 41 | - `tmux list-windows` 42 | - `tmux select-window -t :0-9` 根据索引转到该 window 43 | - `tmux rename-window` 重命名当前 window 44 | - pane 面板:window 中可以有不同的 pane(可以把 window 分成不同的部分) 45 | - `tmux split-window` 将 window 垂直划分为两个 pane 46 | - `tmux split-window -h` 将 window 水平划分为两个 pane 47 | - `tmux swap-pane -U` 在指定的方向(方向有:U、D、L、R 四种)交换 pane 48 | - `tmux select-pane -U` 在指定的方向(方向有:U、D、L、R 四种)选择下一个 pane 49 | 50 | ## 高级用法 51 | 52 | - **注意:** 有一个前缀快捷键的概念,也称作:``,默认快捷键:`Ctrl + B`,下面的这些操作都是必须先按这个快捷键后再输入对应的命令: 53 | - 基本操作 54 | - `?` 列出所有快捷键;按q返回 55 | - `d` 脱离当前会话,可暂时返回Shell界面 56 | - `s` 选择并切换会话;在同时开启了多个会话时使用 57 | - `D` 选择要脱离的会话;在同时开启了多个会话时使用 58 | - `:` 进入命令行模式;此时可输入支持的命令,例如 kill-server 关闭所有tmux会话 59 | - `[` 复制模式,光标移动到复制内容位置,空格键开始,方向键选择复制,回车确认,q/Esc退出 60 | - `]` 进入粘贴模式,粘贴之前复制的内容,按q/Esc退出 61 | - `~` 列出提示信息缓存;其中包含了之前tmux返回的各种提示信息 62 | - `t` 显示当前的时间 63 | - `ctrl + z` 挂起当前会话 64 | - 窗口操作 65 | - `c` 创建新窗口 66 | - `&` 关闭当前窗口 67 | - `[0-9]` 数字键切换到指定窗口 68 | - `p` 切换至上一窗口 69 | - `n` 切换至下一窗口 70 | - `l` 前后窗口间互相切换 71 | - `w` 通过窗口列表切换窗口 72 | - `,` 重命名当前窗口,便于识别 73 | - `.` 修改当前窗口编号,相当于重新排序 74 | - `f` 在所有窗口中查找关键词,便于窗口多了切换 75 | - 面板操作 76 | - `"` 将当前面板上下分屏(我自己改成了 |) 77 | - `%` 将当前面板左右分屏(我自己改成了 -) 78 | - `x` 关闭当前分屏 79 | - `!` 将当前面板置于新窗口,即新建一个窗口,其中仅包含当前面板 80 | - `Ctrl + 方向键` 以1个单元格为单位移动边缘以调整当前面板大小 81 | - `Alt + 方向键` 以5个单元格为单位移动边缘以调整当前面板大小 82 | - `q` 显示面板编号 83 | - `o` 选择当前窗口中下一个面板 84 | - `方向键` 移动光标选择对应面板 85 | - `{` 向前置换当前面板 86 | - `}` 向后置换当前面板 87 | - `Alt+o` 逆时针旋转当前窗口的面板 88 | - `Ctrl+o` 顺时针旋转当前窗口的面板 89 | - `z` 最大化当前所在面板 90 | - `page up` 向上滚动屏幕,q 退出 91 | - `page down` 向下滚动屏幕,q 退出 92 | 93 | 94 | 95 | 96 | ## 资料 97 | 98 | - 99 | - 100 | - 101 | - 102 | - 103 | - 104 | - 105 | - <> 106 | - <> -------------------------------------------------------------------------------- /Ubuntu-Install-VMware.md: -------------------------------------------------------------------------------- 1 | # Ubuntu 安装 VMware 2 | 3 | - 我个人习惯使用 VMware,在一些个性化和兼容性上,我觉得 VMware 比 box 好很多 4 | 5 | 6 | ## 安装说明 7 | 8 | - 下载:VMware-Workstation-Full-10.0.4-2249910.x86_64.bundle 9 | - 下载地址(rzb0): 10 | - 安装组件: 11 | 12 | ``` nginx 13 | 命令:sudo apt-get update 14 | 命令:sudo apt-get install build-essential linux-headers-`uname -r` 15 | ``` 16 | - 进入软件下载后目录,比如我在 /opt/setups 下 17 | - `cd /opt/setups` 18 | - `chmod +x VMware*.bundle` 19 | - `sudo ./VMware*.bundle` 20 | - 接下来会弹出图形界面,则效果跟 Windows 一样,那就没啥好说了。 21 | 22 | 23 | ## 资料 24 | 25 | - [How To Install VMware Workstation 11 On Ubuntu 14.10](https://www.liberiangeek.net/2014/12/install-vmware-workstation-11-ubuntu-14-10/) 26 | 27 | -------------------------------------------------------------------------------- /Ubuntu-Install.md: -------------------------------------------------------------------------------- 1 | # Ubuntu 安装和分区 2 | 3 | - 先下载该系列教程: 4 | 5 | ![Ubuntu 安装和分区视频](images/Ubuntu-a-1.jpg) 6 | 7 | - 找到如图箭头目录上的两个视频,并看完,你对 Ubuntu 的安装就有了一个大概的了解,视频中 Ubuntu 虽然版本较早 13.04 的, 但是没关系,对于 Ubuntu 来讲新旧版本安装基本都一样的,所以别担心,驱动的问题也别担心,我们不是要在 Ubuntu 打游戏的,所以常见驱动系统是已经帮我们集成的不会影响使用。但是分区这一块的话,我个人建议是手工分区,视频中没有最终执行手动分区,只是演示了一下又返回了。 我个人是要求你手动分区的。 8 | 9 | - 但是再讲分区之前,用什么设备安装是第一前提,我这里推荐用 U 盘,你准备一个 4 G 以上的 U 盘,把 Ubuntu 系统进行格式化到里面,用这个 U 盘作为安装盘进行安装。这个过程不难,具体看如下文章: 10 | 11 | - [http://www.Ubuntukylin.com/ask/index.php?qa=jc_1](http://www.Ubuntukylin.com/ask/index.php?qa=jc_1) 12 | - [http://www.wubantu.com/36bc2075036fab76.html](http://www.wubantu.com/36bc2075036fab76.html) 13 | - [http://tieba.baidu.com/p/2795415868](http://tieba.baidu.com/p/2795415868) 14 | - [http://www.Ubuntukylin.com/public/pdf/UK1410install.pdf](http://www.Ubuntukylin.com/public/pdf/UK1410install.pdf) 15 | 16 | - 好了假设你现在已经格式化好 U 盘,现在可以开始讲分区了。这里特别说明的是有多个硬盘的,多块硬盘分区方案就没视频中那么简单,特别是 Linux 的盘符不了解的就更加难了,所以看下图: 17 | 18 | ![Ubuntu 安装和分区视频](images/Ubuntu-a-2.jpg) 19 | 20 | - 以我这边为例:我这边机子的硬盘是:一个 128 G 固态 + 500 G 的机械,我给一个分区方案给你们参考。下面的内容需要你先看过视频才能看懂: 21 | 22 | - Linux 一般可分 3 个分区,分别是 `boot 分区`、`swap 分区` 和 `根分区`(根分区也就是斜杠/) boot 是主分区类型,swap 是是逻辑分区,/ 是逻辑分区,其他如果你还想划分的也都是逻辑分区。 最近年代生产的的主板,可能还需要分出一个 EFI 分区启动。EFI 的选择和 swap 一样,都在那个下拉菜单中。 怎么判断你要不要分出一个 EFI 呢?如果你根据我的要求分了 boot,swap,根之后,点击下一步报错,有提示 EFI 相关的错误信息,那就分一个给它,我这边就是有报错的。 23 | 24 | - **120 G 固态硬盘:** 25 | - `/boot` == 1G(主分区),这里为boot单独挂载是有必要的。系统崩溃的时候,损坏的是这个分区。我们重装系统之后,其他分区我们保留下来,重新挂载上去就可以用了。 26 | - `/EFI` == 100M(主分区)(我有提示报错需要分这个,我就分了) 27 | - `/swap` == 12G(逻辑分区)一般大家的说法这个大小是跟你机子的内存大小相关的,也有说法内存大不需要这个,但是还是建议分,我内存是12G,所以我分12G。 28 | - `/` == 100G(逻辑分区) 29 | 30 | - **500 G 机械硬盘:** 31 | - `/home` == 500G(逻辑分区) 32 | 33 | - 分区后的安装都是下一步的,而且 Ubuntu kylin 还是中文的说明,所以没啥难度。 到此假设你给自己的电脑安装了 Ubuntu,那下一讲我将讲 Ubuntu 的相关设置。 34 | 35 | - 如果你想用 VMware 虚拟机安装,这个教程推荐给你,讲得很详细。 36 | - [http://www.jikexueyuan.com/course/1583.html](http://www.jikexueyuan.com/course/1583.html) 37 | -------------------------------------------------------------------------------- /Ubuntu-Popular-Software.md: -------------------------------------------------------------------------------- 1 | # Ubuntu 常用的软件 2 | 3 | ## 安装软件基础 4 | 5 | - 取回更新的软件包列表信息:`sudo apt-get update`,如果安装某个软件报:`Unable to locate package`,就得这样 update 下。 6 | - 查看已经安装了哪些包:`sudo dpkg -l` 7 | - 查看已安装列表中是否有 Vim 软件,没有安装则没有数据显示:`sudo dpkg -l | grep vim` 8 | - 查看 Vim 软件安装位置:`sudo dpkg -L vim` 9 | - 安装名为 Vim 的软件:`sudo apt-get install vim` 10 | - 卸载名为 Vim 的软件(保留配置文档):`sudo apt-get remove vim` 11 | - 卸载名为 Vim 的软件(删除配置文档):`sudo apt-get –purge remove vim` 12 | - 升级系统所有有新版本的软件:`sudo apt-get upgrade` 13 | - 删除已下载的旧包文件:`sudo apt-get autoclean` 14 | - 删除所有已下载的包文件:`sudo apt-get clean` 15 | - 卸载所有自动安装且不再使用的软件包:`sudo apt-get autoremove` 16 | 17 | 18 | ## 安装常用系统软件 19 | 20 | - sysv-rc-conf 21 | - 介绍:管理启动项,一般是用在 Ubuntu 系统上的,CentOS 一般用的 chkconfig,两者用法差不多 22 | - 安装:`sudo apt-get install -y sysv-rc-conf` 23 | - 资料: 24 | - 图文资料: 25 | - 图文资料: 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Ubuntu-Specific-Command.md: -------------------------------------------------------------------------------- 1 | # Ubuntu 特殊命令 2 | 3 | 4 | - `lsb_release -a`,查看发行代号 5 | - `cat /etc/issue`,查看 Ubuntu 发行版本 6 | - `sudo ufw disable`,禁用防火墙 7 | - `sudo ufw enable`,开启防火墙 8 | - `apt-get remove iptables`,卸载防火墙 9 | - `` 10 | - `` 11 | - `` 12 | - `` 13 | - `` 14 | - `` 15 | 16 | -------------------------------------------------------------------------------- /Ubuntu.md: -------------------------------------------------------------------------------- 1 | # Ubuntu 介绍 2 | 3 | - Ubuntu 母公司 Canonical: 4 | - Ubuntu 百科: 5 | - Ubuntu Wiki: 6 | - Ubuntu 英文官网: 7 | - Ubuntu 中文官网: 8 | - Ubuntu kylin 官网: 9 | - Ubuntu 标准桌面版下载: 10 | - Ubuntu 官网回答社区: 11 | - Ubuntu 正式衍生版本: 12 | - Ubuntu 非正式衍生版本: 13 | - Unity 桌面介绍: 14 | - GNOME 桌面介绍: 15 | - KDE 桌面介绍: 16 | 17 | # Ubuntu 原型系统:Debian 18 | 19 | - Debian Wiki: 20 | - Debian 百科: 21 | - Debian 官网: 22 | - Debian 自我介绍: 23 | - 关键字: 24 | - [Debian 社群契约](https://www.debian.org/social_contract) 25 | - [何谓自由 (Free)? 或者说,何谓自由软件 (Free Software)?](https://www.debian.org/intro/free) 26 | - [什么是自由软件?](http://www.gnu.org/philosophy/free-sw) 27 | - [Debian 历史](https://www.debian.org/doc/manuals/project-history/) 28 | - Debian 的发行版介绍: 29 | - Debian 官网稳定版下载 1: 30 | - Debian 官网稳定版下载 2: 31 | - Debian 中国镜像 1: 32 | - Debian 中国镜像 2: 33 | - Debian 中国镜像 3: 34 | - Debian 中文安装手册: 35 | - Debian 软件列表: 36 | 37 | 38 | -------------------------------------------------------------------------------- /Vim-Install-And-Settings.md: -------------------------------------------------------------------------------- 1 | # Vim 安装和配置、优化 2 | 3 | ## Vim 介绍 4 | 5 | - Vim 官网: 6 | 7 | ## Vim 安装 8 | 9 | - CentOS:`sudo yum install -y vim` 10 | - Ubuntu:`sudo apt-get install -y vim` 11 | - Windows GVim 下载: 12 | 13 | ## Vim 配置(CentOS 环境) 14 | 15 | - 编辑配置文件是:`sudo vim /etc/vimrc` 16 | 17 | 18 | ## Vim 基础快捷键 19 | 20 | 21 | - 注意 22 | - 严格区分字母大小写 23 | - 含有 `Ctrl` 字眼都表示 Ctrl 键盘按钮 24 | - 特定符号需要配合 Shift 键,比如字母键盘区上面的数字区:!@#%%^&*() 25 | - 要按出冒号键 `:` 也是需要 Shift 的 26 | - 移动 27 | - `j`,下 28 | - `k`,上 29 | - `h`,左 30 | - `l`,右 31 | - `v`,按 v 之后按方向键可以选中你要选中的文字 32 | - `gg`,跳到第 1 行 33 | - `G`,跳到第最后行 34 | - `16G` 或 `:16`,跳到第 16 行 35 | - `$`,到本行 **行尾** 36 | - `0`,到本行 **行头** 37 | - `w`,到下一个单词的 **开头** 38 | - `e`,到下一个单词的 **结尾** 39 | - `Ctrl + u`,向文件 **首翻** 半屏 40 | - `Ctrl + d`,向文件 **尾翻** 半屏 41 | - `Ctrl + f`,向文件 **尾翻** 一屏 42 | - `Ctrl + b`,向文件 **首翻** 一屏 43 | - `*`,匹配光标当前所在的单词,移动光标到 **下一个** 匹配单词 44 | - `#`,匹配光标当前所在的单词,移动光标到 **上一个** 匹配单词 45 | - `^`,到本行第一个单词头 46 | - `g_`,到本行最后一个单词尾巴 47 | - `%`,匹配括号移动,包括 **(、{、[** 48 | - 插入 49 | - `I`,在当前 **行首** 插入 50 | - `A`,在当前 **行尾** 插入 51 | - `i`,在当前字符的 **左边** 插入 52 | - `a`,在当前字符的 **右边** 插入 53 | - `o`,在当前行 **下面** 插入一个新行 54 | - `O`,在当前行 **上面** 插入一个新行 55 | - 编辑 56 | - 删除 57 | - `x`,删除 **光标后** 的 1 个字符 58 | - `2x`,删除 **光标后** 的 2 个字符 59 | - `X`,删除 **光标前** 的 1 个字符 60 | - `2X`,删除 **光标前** 的 2 个字符 61 | - `dd`,删除当前行 62 | - `cc`,删除当前行后进入 insert 模式 63 | - `dw`,删除当前光标下的单词/空格 64 | - `d$`,删除光标至 **行尾** 所有字符 65 | - `dG`,删除光标至 **文件尾** 所有字符 66 | - `3dd`,从当前光标开始,删掉 3 行 67 | - 复制 68 | - `y`,复制光标所选字符 69 | - `yw`,复制光标后单词 70 | - `yy`,复制当前行 71 | - `4yy`,复制当前行及下面 4 行 72 | - `y$`,复制光标位置至 **行尾** 的内容 73 | - `y^`,复制光标位置至 **行首** 的内容 74 | - 粘贴 75 | - `p`,将粘贴板中内容复制到 **光标之后** 76 | - `P`,将粘贴板中内容复制到 **光标之前** 77 | - 其他 78 | - `ddp`,交换当前光标所在行和下一行的位置 79 | - `u`,撤销 80 | - `:wq`,退出并 **保存** 81 | - `:q!`,退出并 **不保存** 82 | - `Ctrl + v`,进入 Vim 列编辑 83 | - `guu`,把当前行的字母全部转换成 **小写** 84 | - `gUU`,把当前行的字母全部转换成 **大写** 85 | - `g~~`,把当前行的字母是大写的转换成小写,是小写的转换成大写 86 | - `:saveas /opt/setups/text.txt`,另存到 /opt/setups/text.txt 87 | - 搜索 88 | - `/YouMeek`,从光标开始处向文件尾搜索 YouMeek 字符,按 `n` 继续向下找,按 `N` 继续向上找 89 | - `?YouMeek`,从光标开始处向文件首搜索 YouMeek 字符,按 `n` 继续向下找,按 `N` 继续向上找 90 | - 替换 91 | - `:%s/YouMeek/Judasn/g`,把文件中所有 YouMeek 替换为:Judasn 92 | - `:%s/YouMeek/Judasn/`,把文件中所有行中第一个 YouMeek 替换为:Judasn 93 | - `:s/YouMeek/Judasn/`,把光标当前行第一个 YouMeek 替换为 Judasn 94 | - `:s/YouMeek/Judasn/g`,把光标当前行所有 YouMeek 替换为 Judasn 95 | - `:s#YouMeek/#Judasn/#`,除了使用斜杠作为分隔符之外,还可以使用 # 作为分隔符,此时中间出现的 / 不会作为分隔符,该命令表示:把光标当前行第一个 YouMeek/ 替换为 Judasn/ 96 | - `:10,31s/YouMeek/Judasng`,把第 10 行到 31 行之间所有 YouMeek 替换为 Judasn 97 | 98 | 99 | ## Vim 的特殊复制、黏贴 100 | 101 | - Vim 提供了 12 个剪贴板,分别是:`0,1,2,3,4,5,6,7,8,9,a,"`,默认采用的是 `"`,也就是双引号,可能你初读感觉很奇怪。你可以用 Vim 编辑某个文件,然后输入:`:reg`。你可以看到如下内容: 102 | - ![vim](images/Vim-Cut-And-Paste-a-1.png) 103 | - 复制到某个剪切板的命令:`"7y`,表示使用 7 号剪切板。 104 | - 黏贴某个剪切板内容:`"7p`,表示使用 7 号剪切板内容进行黏贴 105 | 106 | 107 | 108 | ## Vim 配置 109 | 110 | - 我个人本地不使用 Vim 的,基本上都是在操作服务器的时候使用,所以这里推荐这个配置文件 111 | - [vim-for-server](https://github.com/wklken/vim-for-server) 112 | - 在假设你已经备份好你的 Vim 配置文件后,使用该配置文件:`curl https://raw.githubusercontent.com/wklken/vim-for-server/master/vimrc > ~/.vimrc` 113 | - 效果如下: 114 | - ![vim-for-server](https://raw.githubusercontent.com/wklken/gallery/master/vim/vim-for-server.png) 115 | 116 | ## 资料 117 | 118 | - [vim几个小技巧(批量替换,列编辑)](http://blogread.cn/it/article/1010?f=sa) 119 | - [最佳vim技巧](http://www.2maomao.com/blog/wp-content/uploads/vim_tips.txt) 120 | - [简明 Vim 练级攻略](http://coolshell.cn/articles/5426.html) 121 | - [vim 批量查找替换](http://blog.csdn.net/wangchong0/article/details/6801956) 122 | -------------------------------------------------------------------------------- /Was-Hacked.md: -------------------------------------------------------------------------------- 1 | # 黑客入侵检查 2 | 3 | ------ 4 | 5 | ## 思路 6 | 7 | - 扫描木马工具:`clamAV` 8 | - 官网: 9 | - CentOS 安装:`yum install -y clamav*` 10 | - 启动 clamAV 服务:`service clamd restart` 11 | - 更新病毒库:`freshclam` 12 | - 扫描方法: 13 | - 扫描 /etc 目录,并把扫描结果放在 /root 目录下:`clamscan -r /etc --max-dir-recursion=5 -l /root/etcclamav.log` 14 | - 扫描 /bin 目录,并把扫描结果放在 /root 目录下:`clamscan -r /bin --max-dir-recursion=5 -l /root/binclamav.log` 15 | - 扫描 /usr 目录,并把扫描结果放在 /root 目录下:`clamscan -r /usr --max-dir-recursion=5 -l /root/usrclamav.log` 16 | - 如果日志有类似内容,表示有木马病毒: 17 | - `/usr/bin/.sshd: Linux.Trojan.Agent FOUND` 18 | - `/usr/sbin/ss: Linux.Trojan.Agent FOUND` 19 | - `/usr/sbin/lsof: Linux.Trojan.Agent FOUND` 20 | - 看下当前有多少登录者:`who` 21 | - 看下最近有哪些登录者:`last` 22 | - 查看最近尝试登录的账号信息:`grep "sshd" /var/log/secure` 23 | - 很多这种信息就表示有人在不断地尝试用 root 登录:`Failed password for root from 222.186.56.168 port 4080 ssh2` 24 | - 查看最近登录成功的账号信息:`grep "Accepted" /var/log/secure`,可以看到:pop3, ssh, telnet, ftp 类型 25 | - 看下查看系统资源占用有无异常:`top` 26 | - 看下所有进程:`ps aux` 27 | - 查看当前系统登录者有哪些,及其登录记录:`last | more` 28 | - 把最近执行的所有命令输出到一个文件,然后下载下来细细研究:`history >> /opt/test.txt` 29 | - 查看当前系统所有用户有哪些:`cat /etc/passwd |awk -F \: '{print $1}'` 30 | - 更多详细可以用:`cat /etc/passwd` 31 | - 查看开放的端口,比如常用的80,22,8009,后面的箭头表示端口对应占用的程序:`netstat -lnp` 32 | - 检查某个端口的具体信息:`lsof -i :18954` 33 | - 检查启动项:`chkconfig` 34 | - 检查定时器:`cat /etc/crontab` 35 | - 检查其他系统重要文件: 36 | - `cat /etc/rc.local` 37 | - `cd /etc/init.d;ll` 38 | - 检查文件: 39 | - `find / -uid 0 –perm -4000 –print` 40 | - `find / -size +10000k –print` 41 | - `find / -name "…" –print` 42 | - `find / -name ".. " –print` 43 | - `find / -name ". " –print` 44 | - `find / -name " " –print` 45 | - 下载 iftop 分析流量,查看是否被黑客当做肉鸡使用 46 | - 安装 iftop 47 | - 官网: 48 | - 使用文章: 49 | - 没有安装第三方源的情况: 50 | - 安装依赖包:`yum install -y flex byacc libpcap ncurses ncurses-devel libpcap-devel` 51 | - 下载源码包:`wget http://www.ex-parrot.com/pdw/iftop/download/iftop-0.17.tar.gz` 52 | - 解压:`tar zxf iftop-0.17.tar.gz` 53 | - 进入解压目录:`cd iftop-0.17/` 54 | - 编译:`./configure` 55 | - 安装:`make && make install` 56 | - 有第三方源的情况(eg:EPEL): 57 | - `yum install -y iftop` 58 | - 运行:`iftop` 59 | - 显示端口与 IP 信息:`iftop -nP` 60 | 61 | ``` nginx 62 | 中间部分:外部连接列表,即记录了哪些ip正在和本机的网络连接 63 | 64 | 右边部分:实时参数分别是该访问 ip 连接到本机 2 秒,10 秒和 40 秒的平均流量 65 | 66 | => 代表发送数据,<= 代表接收数据 67 | 68 | 底部会显示一些全局的统计数据,peek 是指峰值情况,cumm 是从 iftop 运行至今的累计情况,而 rates 表示最近 2 秒、10 秒、40 秒内总共接收或者发送的平均网络流量。 69 | 70 | TX:(发送流量) cumm: 143MB peak: 10.5Mb rates: 1.03Mb 1.54Mb 2.10Mb 71 | RX:(接收流量) 12.7GB 228Mb 189Mb 191Mb 183Mb 72 | TOTAL:(总的流量) 12.9GB 229Mb 190Mb 193Mb 185MbW 73 | 74 | ``` 75 | 76 | - 禁用 root 账号登录:`vim /etc/ssh/sshd_config` 77 | - 把 PermitRootLogin 属性 yes 改为 no 78 | - 如果安全度要更高,可以考虑禁用口令登录,采用私钥/公钥方式:`vim /etc/ssh/sshd_config` 79 | - 设置属性:PasswordAuthentication 为 no 80 | - 如果还要限制指定 IP 登录,可以考虑编辑:hosts.allow 和 hosts.deny 两个文件 81 | 82 | 83 | 84 | ## 资料 85 | 86 | - 87 | - 88 | - 89 | - 90 | - 91 | -------------------------------------------------------------------------------- /Zookeeper-Install.md: -------------------------------------------------------------------------------- 1 | # Zookeeper 安装 2 | 3 | 4 | ## 需要环境 5 | 6 | - JDK 安装 7 | 8 | ## 下载安装 9 | 10 | - 官网: 11 | - 此时(201702)最新稳定版本:Release 3.4.9` 12 | - 官网下载: 13 | - 我这里以:`zookeeper-3.4.8.tar.gz` 为例 14 | - 安装过程: 15 | - `mkdir -p /usr/program/zookeeper/data` 16 | - `cd /opt/setups` 17 | - `tar zxvf zookeeper-3.4.8.tar.gz` 18 | - `mv /opt/setups/zookeeper-3.4.8 /usr/program/zookeeper` 19 | - `cd /usr/program/zookeeper/zookeeper-3.4.8/conf` 20 | - `mv zoo_sample.cfg zoo.cfg` 21 | - `vim zoo.cfg` 22 | - 将配置文件中的这个值: 23 | - 原值:`dataDir=/tmp/zookeeper` 24 | - 改为:`dataDir=/usr/program/zookeeper/data` 25 | - 防火墙开放2181端口 26 | - `iptables -A INPUT -p tcp -m tcp --dport 2181 -j ACCEPT` 27 | - `service iptables save` 28 | - `service iptables restart` 29 | - 启动 zookeeper:`sh /usr/program/zookeeper/zookeeper-3.4.8/bin/zkServer.sh start` 30 | - 停止 zookeeper:`sh /usr/program/zookeeper/zookeeper-3.4.8/bin/zkServer.sh stop` 31 | - 查看 zookeeper 状态:`sh /usr/program/zookeeper/zookeeper-3.4.8/bin/zkServer.sh status` 32 | - 如果是集群环境,下面几种角色 33 | - leader 34 | - follower 35 | 36 | ## 集群环境搭建 37 | 38 | ### 确定机子环境 39 | 40 | - 集群环境最少节点是:3,且节点数必须是奇数,生产环境推荐是:5 个机子节点。 41 | - 系统都是 CentOS 6 42 | - 机子 1:192.168.1.121 43 | - 机子 2:192.168.1.111 44 | - 机子 3:192.168.1.112 45 | 46 | ### 配置 47 | 48 | - 在三台机子上都做如上文的流程安装,再补充修改配置文件:`vim /usr/program/zookeeper/zookeeper-3.4.8/conf/zoo.cfg` 49 | - 三台机子都增加下面内容: 50 | 51 | ``` nginx 52 | server.1=192.168.1.121:2888:3888 53 | server.2=192.168.1.111:2888:3888 54 | server.3=192.168.1.112:2888:3888 55 | ``` 56 | 57 | - 在 机子 1 增加一个该文件:`vim /usr/program/zookeeper/data/myid`,文件内容填写:`1` 58 | - 在 机子 2 增加一个该文件:`vim /usr/program/zookeeper/data/myid`,文件内容填写:`2` 59 | - 在 机子 3 增加一个该文件:`vim /usr/program/zookeeper/data/myid`,文件内容填写:`3` 60 | - 然后在三台机子上都启动 zookeeper:`sh /usr/program/zookeeper/zookeeper-3.4.8/bin/zkServer.sh start` 61 | - 分别查看三台机子的状态:`sh /usr/program/zookeeper/zookeeper-3.4.8/bin/zkServer.sh status`,应该会得到类似这样的结果: 62 | 63 | ``` 64 | Using config: /usr/program/zookeeper/zookeeper-3.4.8/bin/../conf/zoo.cfg 65 | Mode: follower 或者 Mode: leader 66 | ``` -------------------------------------------------------------------------------- /Zsh.md: -------------------------------------------------------------------------------- 1 | # Zsh 入门 2 | 3 | 4 | ## 本文前提 5 | 6 | - CentOS 6.7 64 bit 7 | - root 用户 8 | 9 | 10 | ## Zsh 介绍 11 | 12 | - Zsh 兼容 Bash,据传说 99% 的 Bash 操作 和 Zsh 是相同的 13 | - Zsh 官网: 14 | - 先看下你的 CentOS 支持哪些 shell:`cat /etc/shells`,正常结果应该是这样的: 15 | 16 | ``` bash 17 | /bin/sh 18 | /bin/bash 19 | /sbin/nologin 20 | /bin/dash 21 | /bin/tcsh 22 | /bin/csh 23 | ``` 24 | 25 | - 默认 CentOS / Ubuntu / Mac 系统用的是 Bash,倒也不是说 Bash 不好,而是说我们有更好的选择。 26 | 27 | 28 | ## Zsh 安装 29 | 30 | - CentOS 安装:`sudo yum install -y zsh` 31 | - Ubuntu 安装:`sudo apt-get install -y zsh` 32 | - 在检查下系统的 shell:`cat /etc/shells`,你会发现多了一个:`/bin/zsh` 33 | 34 | 35 | ## 使用 Zsh 扩展集合:oh-my-zsh 36 | 37 | - oh-my-zsh 帮我们整理了一些常用的 Zsh 扩展功能和主题: 38 | - 我们无需自己去捣搞 Zsh,直接用 oh-my-zsh 就足够了,如果你想继续深造的话那再去弄。 39 | - 先安装 git:`sudo yum install -y git` 40 | - 安装 oh-my-zsh(这个过程可能会有点慢,或者需要重试几次):`wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O - | sh` 41 | - 整个过程效果如下图: 42 | - ![oh-my-zsh 安装](images/Zsh-a-1.jpg) 43 | - 在以 root 用户为前提下,oh-my-zsh 的安装目录:**/root/.oh-my-zsh** 44 | - 在以 root 用户为前提下,Zsh 的配置文件位置:**/root/.zshrc** 45 | - 为 root 用户设置 zsh 为系统默认 shell:`chsh -s /bin/zsh root` 46 | - 如果你要重新恢复到 bash:`chsh -s /bin/bash root` 47 | - 现在你关掉终端或是重新连上 shell,现在开头是一个箭头了,如下图: 48 | - ![oh-my-zsh 安装](images/Zsh-b-1.jpg) 49 | 50 | ## Home / End 失灵问题 51 | 52 | - 虽然可以通过配置解决,但是建议还是直接记快捷键吧: 53 | - Home = Ctrl + a 54 | - End = Ctrl + e 55 | 56 | 57 | ## Zsh 配置 58 | 59 | ### 插件 60 | 61 | - 启用 oh-my-zsh 中自带的插件。 62 | - oh-my-zsh 的插件列表介绍(太长了,用源码不精准地统计下有 149 个): 63 | - 我们看下安装 oh-my-zsh 的时候自带有多少个插件:`ls -l /root/.oh-my-zsh/plugins |grep "^d"|wc -l`,我这边得到的结果是:211 64 | - 编辑配置文件:`vim /root/.zshrc`,找到下图的地方,怎么安装,原作者注释写得很清楚了,别装太多了,默认 git 是安装的。 65 | - ![oh-my-zsh 安装](images/Zsh-c-1.jpg) 66 | - 插件推荐: 67 | - `wd` 68 | - 简单地讲就是给指定目录映射一个全局的名字,以后方便直接跳转到这个目录,比如: 69 | - 编辑配置文件,添加上 wd 的名字:`vim /root/.zshrc` 70 | - 我常去目录:**/opt/setups**,每次进入该目录下都需要这样:`cd /opt/setups` 71 | - 现在用 wd 给他映射一个快捷方式:`cd /opt/setups ; wd add setups` 72 | - 以后我在任何目录下只要运行:`wd setups` 就自动跑到 /opt/setups 目录下了 73 | - 插件官网: 74 | - `autojump` 75 | - 这个插件会记录你常去的那些目录,然后做一下权重记录,你可以用这个命令看到你的习惯:`j --stat`,如果这个里面有你的记录,那你就只要敲最后一个文件夹名字即可进入,比如我个人习惯的 program:`j program`,就可以直接到:`/usr/program` 76 | - 插件官网: 77 | - 官网插件下载地址: 78 | - 插件下载:`wget https://github.com/downloads/wting/autojump/autojump_v21.1.2.tar.gz` 79 | - 解压:`tar zxvf autojump_v21.1.2.tar.gz` 80 | - 进入解压后目录并安装:`cd autojump_v21.1.2/ ; ./install.sh` 81 | - 再执行下这个:`source /etc/profile.d/autojump.sh` 82 | - 编辑配置文件,添加上 autojump 的名字:`vim /root/.zshrc` 83 | - `zsh-syntax-highlighting` 84 | - 这个插件会对终端命令高亮显示,比如正确的拼写会是绿色标识,否则是红色,另外对于一些shell输出语句也会有高亮显示,算是不错的辅助插件 85 | - 插件官网: 86 | - 安装,复制该命令:'git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting' 87 | - 编辑:`vim ~/.zshrc`,找到这一行,后括号里面的后面添加:`plugins=( 前面的一些插件名称 zsh-syntax-highlighting)` 88 | - 刷新下配置:`source ~/.zshrc` 89 | 90 | ### 主题 91 | 92 | - 很多人喜欢捣搞这个 ╮( ̄▽ ̄)╭ 93 | - 捣搞主题和插件思路一样 94 | - oh-my-zsh 的主题列表介绍(还是太长了): 95 | - 我们看下安装 oh-my-zsh 的时候,自带有多少个:`ls -l /root/.oh-my-zsh/themes |grep "^-"|wc -l`,我这边得到的结果是:140 96 | - 我个人品味地推荐的是(排名有先后): 97 | - `ys` 98 | - `agnoster` 99 | - `avit` 100 | - `blinks` 101 | - 编辑配置文件:`vim /root/.zshrc`,找到下图的地方,怎么安装,原作者注释写得很清楚了,如果你没特别的喜欢那就选择随机吧。 102 | - ![oh-my-zsh 安装](images/Zsh-d-1.jpg) 103 | - 配置好新主题需要重新连接 shell 才能看到效果 104 | 105 | 106 | ## 一些人性化功能 107 | 108 | - 呃,这个其实可以不用讲的,你自己用的时候你自己会发现的,各种便捷,特别是用 Tab 多的人一定会有各种惊喜的。 109 | - 使用 ctrl-r 来搜索命令历史记录。按完此快捷键后,可以输入关键命令词语,如果历史记录有含有此词语会显示出来。 110 | - 命令别名: 111 | - 在命令行中输入 alias 可以查看已经有的命令别名 112 | - 自己新增一些别名,编辑文件:`vim ~/.zshrc`,在文件加入下面格式的命令,比如以下是网友提供的一些思路: 113 | 114 | ``` shell 115 | alias cls='clear' 116 | alias ll='ls -l' 117 | alias la='ls -a' 118 | alias grep="grep --color=auto" 119 | alias -s html='vim' # 在命令行直接输入后缀为 html 的文件名,会在 Vim 中打开 120 | alias -s rb='vim' # 在命令行直接输入 ruby 文件,会在 Vim 中打开 121 | alias -s py='vim' # 在命令行直接输入 python 文件,会用 vim 中打开,以下类似 122 | alias -s js='vim' 123 | alias -s c='vim' 124 | alias -s java='vim' 125 | alias -s txt='vim' 126 | alias -s gz='tar -xzvf' # 在命令行直接输入后缀为 gz 的文件名,会自动解压打开 127 | alias -s tgz='tar -xzvf' 128 | alias -s zip='unzip' 129 | alias -s bz2='tar -xjvf' 130 | ``` 131 | 132 | 133 | ## 差异 134 | 135 | - 我们现在增加系统变量在:/etc/profile 后,输入命令:source /etc/profile 之后,重启服务器发现刚刚的系统变量现在没效果。 136 | - 解决办法:`vim ~/.zshrc`,在该配置文件里面增加一行:`source /etc/profile`,然后刷新 zsh 的配置:`source ~/.zshrc`。 137 | 138 | 139 | ## 资料 140 | 141 | - 142 | - 143 | - 144 | - 145 | - 146 | - 147 | - 148 | - 149 | - 150 | - 151 | - 152 | - 153 | - 154 | -------------------------------------------------------------------------------- /centos-settings/CentOS-Extra-Packages.md: -------------------------------------------------------------------------------- 1 | # CentOS 源设置 2 | 3 | ## 修改官方源 4 | 5 | - 下面内容的一个简易集合版本脚本: 6 | 7 | ## 修改官方源 8 | 9 | > 国内常用源配置方法(该源和官方源是一样的,只是因为服务器在国内会起到加速作用而已): 10 | 11 | - 163 源: 12 | - 阿里源: 13 | - sohu: 14 | 15 | > CentOS 6 替换过程(这里以 163 源为例): 16 | 17 | - 备份官网源:`sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.20151219.backup` 18 | - `cd /etc/yum.repos.d/` 19 | - 下载对应版本 repo 文件, 放入 **/etc/yum.repos.d/** 20 | - 下载源文件: 21 | - CentOS6:`sudo wget http://mirrors.163.com/.help/CentOS6-Base-163.repo` 22 | - `sudo mv CentOS6-Base-163.repo CentOS-Base.repo` 23 | - 导入key:`rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6` 24 | - `sudo yum clean all` 25 | - `sudo yum makecache` 26 | - `sudo yum update -y` 27 | 28 | > CentOS 7 替换过程(这里以 163 源为例): 29 | 30 | - 备份官网源:`sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.20170219.backup` 31 | - `cd /etc/yum.repos.d/` 32 | - 下载对应版本 repo 文件, 放入 **/etc/yum.repos.d/** 33 | - 下载源文件: 34 | - CentOS7:`sudo wget http://mirrors.163.com/.help/CentOS7-Base-163.repo` 35 | - `sudo mv CentOS7-Base-163.repo CentOS-Base.repo` 36 | - 导入key:`rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7` 37 | - `sudo yum clean all` 38 | - `sudo yum makecache` 39 | - `sudo yum update -y` 40 | 41 | ## 第三方源 42 | 43 | > 加入第三方源主要是为了 yum 下载到官方没有提供的软件,在其他社区、第三方源里面有很多的软件包,有些软件是很好用的。CentOS 可以加入多个源,所以就存在一个源的优先级问题了,设置优先级的可以使用 yum-plugin-priorities 工具。一般我是建议官方的优先级是最高的,然后才是第三方的。 44 | 45 | - 安装 yum-plugin-priorities: 46 | - CentOS 4 或 CentOS 6:`sudo yum install -y yum-plugin-priorities` 47 | - CentOS 5:`sudo yum install -y yum-priorities` 48 | - 安装完 yum-plugin-priorities 插件后,默认是开启的,如果要关闭可以这样设置: 49 | - `sudo vim /etc/yum/pluginconf.d/priorities.conf` 50 | - 把 enabled=1 改为 enabled=0 即可 51 | - 设置默认源的优先级: 52 | - 一般默认的源配置里面 [base], [updates], [extras],[centosplus] 的 priority=1, [contrib] 的 priority=2,其他第三的软件源为:priority=N (推荐 N > 10,N 可以为1到99的正整数,数值越小越优先) 53 | - `sudo vim /etc/yum.repos.d/CentOS-Base.repo` 54 | - 配置内容如下图 55 | - ![CentOS 默认源的级别设置](../images/CentOS-Extra-Packages-a-1.jpg) 56 | 57 | - 安装 EPEL 源: 58 | - 官网中文材料: 59 | - 安装命令:`sudo yum install -y epel-release` 60 | - CentOS 6 导入 KEY:`rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6` 61 | - CentOS 7 导入 KEY:`rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7` 62 | - 设置 EPEL 源的级别:`vim /etc/yum.repos.d/epel.repo`,追加:priority=11 63 | - 卸载 EPEL 源 64 | - 如果你暂时不想使用 EPEL 源的话,把 epel.repo 里的 enabled=1 改成 enabled=0 即可,如果你完全不需要了,那就直接卸载掉 `sudo rpm -e epel-release` 65 | 66 | - 安装 RepoForge 源:(旧的名字为 rpmforge) 67 | - 官网下载 RPM包: 68 | - 我是 CentOS 6.7 64 位,所以下载 EL 6 x86_64,下载 RMP 安装文件大小:12.3 KB 69 | - 下载命令:`wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm`(我这边 wget 不下来,需要开 VPN,所以你最好有这个心理准备) 70 | - 安装 RPM 文件:`sudo rpm -ivh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm` 71 | - 导入 KEY:`sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag` 72 | - 设置 RepoForge 源的级别:`vim /etc/yum.repos.d/rpmforge.repo`,设置如下图 73 | - ![RepoForge 源的级别设置](../images/CentOS-Extra-Packages-a-2.jpg) 74 | 75 | - 更新包信息: 76 | - `sudo yum clean all` 77 | - `sudo yum makecache` 78 | - `sudo yum update -y` 79 | 80 | - 测试: 81 | - 命令:`sudo yum check-update` 82 | - 看到显示的结果中包括 rpmforge 和 epel 的列表表示成功。 83 | - `sudo yum install -y htop`(htop 官方源是没有的,所以如果能下载下来就表示已经使用了第三方源) 84 | 85 | 86 | > 资料: 87 | 88 | - 89 | - 90 | - 91 | - 92 | - 93 | - 94 | -------------------------------------------------------------------------------- /centos-settings/CentOS-Network-Settings.md: -------------------------------------------------------------------------------- 1 | # CentOS 网络设置 2 | 3 | 4 | - 由于前面虚拟机中安装 CentOS 使用的是桥接模式,为了让虚拟机中的系统能上网,我们需要进行网络设置。 5 | 6 | ## CentOS 6 7 | 8 | ### 界面化下设置网络(新手推荐使用这种) 9 | 10 | - ![界面化设置](../images/CentOS-Network-Settings-a-1.jpg) 11 | - 选择上图箭头所示 12 | - ![界面化设置](../images/CentOS-Network-Settings-a-2.jpg) 13 | - 如上图标注 3 所示:选择 `手动` 模式 14 | - 如上图标注 4 所示:填写自己局域网内的子网掩码、默认网关,以及你要分配的内网 IP 地址。这三个参数你可以参考你当前使用的主机信息,在 Windows 系统上使用:`cmd --- ipconfig`,查看你当前连接的网卡信息。如果你是无线网卡则读取对应的无线网卡信息,如果你是本地连接,则读取对应的本地连接信息。 15 | - 如上图标注 5 所示:填写你当前地区合适的 DNS 地址,我这边地区使用 360 测试出来的结果显示 114 的适合我,所以我这里填写该值 16 | 17 | 18 | ### 命令行下设置网络 19 | 20 | - 编辑网卡信息: 21 | - 备份:`cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0-20160205Back` 22 | - 把备份文件移动到其他目录:`mv /etc/sysconfig/network-scripts/ifcfg-eth0-20160205Back /opt/myBack` 23 | - 编辑网卡文件:`vim /etc/sysconfig/network-scripts/ifcfg-eth0` 24 | - 把网卡中信息改为下面对应内容: 25 | ``` 26 | DEVICE=eth0 (系统默认值) 27 | TYPE=Ethernet (系统默认值) 28 | UUID=a2c17f0c-a224-43d5-a203-48af1f0d9113 (系统默认值) 29 | ONBOOT=yes (系统默认值是 no,我改为 yes) 30 | NM_CONTROLLED=yes (系统默认值) 31 | BOOTPROTO=none (系统默认值是 dhcp,我改为 none,代表手动) 32 | USERCTL=no (自己补充的) 33 | IPV6INIT=no (自己补充的) 34 | NETMASK=255.255.255.0 (自己补充的) 35 | IPADDR=192.168.0.110 (自己补充的) 36 | GATEWAY=192.168.0.1 (自己补充的) 37 | DNS1=114.114.114.114 (自己补充的) 38 | PREFIX=24 (使用图形界面设置后生成的) 39 | DEFROUTE=yes (使用图形界面设置后生成的) 40 | IPV4_FAILURE_FATAL=yes (使用图形界面设置后生成的) 41 | NAME="System eth0" (使用图形界面设置后生成的) 42 | HWADDR=00:0C:29:A9:37:D4 (使用图形界面设置后生成的) 43 | LAST_CONNECT=1454626679 (使用图形界面设置后生成的) 44 | ``` 45 | - 重启网络配置:`service network restart` 46 | 47 | ## CentOS 7 48 | 49 | ### 命令行下设置网络 50 | 51 | - 查看系统下有哪些网卡:`ls /etc/sysconfig/network-scripts/`,新版本不叫 eth0 这类格式了,比如我当前这个叫做:ifcfg-ens33(你的肯定跟我不一样,但是格式类似) 52 | - 编辑该文件:`vim /etc/sysconfig/network-scripts/ifcfg-ens33`,改为如下信息:(IP 段自己改为自己的网络情况) 53 | 54 | ``` ini 55 | TYPE=Ethernet 56 | BOOTPROTO=static 57 | IPADDR=192.168.1.126 58 | NETMASK=255.255.255.0 59 | GATEWAY=192.168.1.1 60 | DNS1=8.8.8.8 61 | DNS1=114.114.114.114 62 | DEFROUTE=yes 63 | PEERDNS=yes 64 | PEERROUTES=yes 65 | IPV4_FAILURE_FATAL=no 66 | IPV6INIT=yes 67 | IPV6_AUTOCONF=yes 68 | IPV6_DEFROUTE=yes 69 | IPV6_PEERDNS=yes 70 | IPV6_PEERROUTES=yes 71 | IPV6_FAILURE_FATAL=no 72 | IPV6_ADDR_GEN_MODE=stable-privacy 73 | NAME=ens33 74 | UUID=15a16b51-0369-44d7-87b4-667f715a68df 75 | DEVICE=ens33 76 | ONBOOT=yes 77 | ``` 78 | 79 | - 修改后,重启网络服务:`systemctl restart network.service` -------------------------------------------------------------------------------- /centos-settings/Clear-Cache.md: -------------------------------------------------------------------------------- 1 | ## 清除系统缓存 2 | 3 | 4 | ## 初衷 5 | 6 | - 本身 Linux 有比较成熟的内存管理机制,但是不免也是会抽风的,有些程序在被 kill 掉之后系统内存依然没有大的变化,这时候就需要手动清除。 7 | 8 | 9 | ## 清除缓存 10 | 11 | - 官网说明: 12 | - 先查看目前系统内存使用情况:`free -m` 13 | - 同步缓存数据到硬盘:`sync` 14 | - 开始清理:`echo 3 > /proc/sys/vm/drop_caches` 15 | - 0:不清除 16 | - 1:清除页缓存 17 | - 2:清除目录项缓存与文件结点缓存 18 | - 3:清除所有缓存(常用) 19 | - 再查看清除后效果:`free -m` 20 | -------------------------------------------------------------------------------- /centos-settings/Clear-Tmp-Directory.md: -------------------------------------------------------------------------------- 1 | ## 修改定时清理 /tmp 目录下的文件 2 | 3 | 4 | ## 初衷 5 | 6 | - 默认系统是超过 30 天不访问的文件自动清除的,但是有时候硬盘用得紧可以考虑修改周期 7 | 8 | 9 | ## 设置方法 10 | 11 | - 编辑配置文件:`vim /etc/cron.daily/tmpwatch` 12 | 13 | ``` nginx 14 | #! /bin/sh 15 | flags=-umc 16 | /usr/sbin/tmpwatch "$flags" -x /tmp/.X11-unix -x /tmp/.XIM-unix \ 17 | -x /tmp/.font-unix -x /tmp/.ICE-unix -x /tmp/.Test-unix \ 18 | -X '/tmp/hsperfdata_*' 10d /tmp 19 | /usr/sbin/tmpwatch "$flags" 30d /var/tmp 20 | for d in /var/{cache/man,catman}/{cat?,X11R6/cat?,local/cat?}; do 21 | if [ -d "$d" ]; then 22 | /usr/sbin/tmpwatch "$flags" -f 30d "$d" 23 | fi 24 | done 25 | ``` 26 | 27 | - 上面这句话:`/usr/sbin/tmpwatch "$flags" -f 30d "$d"`,其中 **30d** 表示 30 天表示要备删除的周期文件,该值最低为 1。 28 | - 一般数据建议不要放在这个目录下,以免被系统误删 29 | -------------------------------------------------------------------------------- /centos-settings/Close-XWindow.md: -------------------------------------------------------------------------------- 1 | ## CentOS 图形界面的关闭与开启 2 | 3 | 4 | ## 初衷 5 | 6 | - 本地开多个虚拟机搞集群测试,为了节省资源,关掉图形界面更好点 7 | 8 | 9 | ## CentOS 6 设置方法 10 | 11 | - 编辑配置文件:`vim /etc/inittab` 12 | - 把默认值:`id:5:initdefault:`,改为:`id:3:initdefault:` 13 | - 重启系统:`reboot`,重启后就只有 shell 界面了。 14 | - 在 shell 界面中如果你还希望临时开启图形界面可以输入:`init 5` 15 | - 在图形界面中如果你希望临时关闭图形界面可以输入:`init 3` 16 | 17 | 18 | ## CentOS 7 设置方法 19 | 20 | - 关闭图形 21 | - `mv /etc/systemd/system/default.target /etc/systemd/system/default.target.bak` (改名备份) 22 | - `ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target` (重新软连接文本界面为启动默认值界面) 23 | - `systemctl reboot` (重启) 24 | 25 | - 恢复图形界面 26 | - `rm -rf /etc/systemd/system/default.target` (移除当前配置链接) 27 | - `mv /etc/systemd/system/default.target.bak /etc/systemd/system/default.target` (恢复备份配置链接) 28 | - `systemctl reboot` -------------------------------------------------------------------------------- /centos-settings/Cpu-Info.md: -------------------------------------------------------------------------------- 1 | ## CPU 信息分析 2 | 3 | 4 | ## 初衷 5 | 6 | - 了解服务器的性能,以方便我们如何更好地对程序进行部署 7 | 8 | 9 | ## CPU 信息 10 | 11 | - Demo CPU 型号:[Intel® Xeon® Processor E5-2620 v2(15M Cache, 2.10 GHz)](http://ark.intel.com/products/75789/Intel-Xeon-Processor-E5-2620-v2-15M-Cache-2_10-GHz) 12 | - 该 CPU 显示的数据中有一项这个要注意:`Intel® Hyper-Threading Technology` 是 `Yes`。表示该 CPU 支持超线程 13 | - `cat /proc/cpuinfo`,查看 CPU 总体信息 14 | - `grep 'physical id' /proc/cpuinfo | sort -u | wc -l`,查看物理 CPU 个数 15 | - 结果:2 16 | - 物理 CPU:物理 CPU 也就是机器外面就能看到的一个个 CPU,每个物理 CPU 还带有单独的风扇 17 | - `grep 'core id' /proc/cpuinfo | sort -u | wc -l`,查看每个物理 CPU 的核心数量 18 | - 结果:6,因为每个物理 CPU 是 6,所有 2 个物理 CPU 的总核心数量应该是:12 19 | - 核心数:一个核心就是一个物理线程,英特尔有个超线程技术可以把一个物理线程模拟出两个线程来用,充分发挥 CPU 性能,意思是一个核心可以有多个线程。 20 | - `grep 'processor' /proc/cpuinfo | sort -u | wc -l`,查看 CPU 总的线程数,一般也叫做:逻辑 CPU 数量 21 | - 结果:24,正常情况下:CPU 的总核心数量 == CPU 线程数,但是如果该 CPU 支持超线程,那结果是:CPU 的总核心数量 X 2 == CPU 线程数 22 | - 线程数:线程数是一种逻辑的概念,简单地说,就是模拟出的 CPU 核心数。比如,可以通过一个 CPU 核心数模拟出 2 线程的 CPU,也就是说,这个单核心的 CPU 被模拟成了一个类似双核心 CPU 的功能。 23 | -------------------------------------------------------------------------------- /centos-settings/centos-settings-toc.md: -------------------------------------------------------------------------------- 1 | - [CentOS 网络设置](CentOS-Network-Settings.md) 2 | - [CentOS 源设置](CentOS-Extra-Packages.md) 3 | - [CentOS 图形界面的关闭与开启](Close-XWindow.md) 4 | - [CPU 信息分析](Cpu-Info.md) 5 | - [清除系统缓存](Clear-Cache.md) 6 | - [修改定时清理 /tmp 目录下的文件](Clear-Tmp-Directory.md) 7 | 8 | 9 | -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Java 程序员眼中的 Linux", 3 | "introduction": "笔者从 Java 开发角度,全方位讲解各种环境搭建及常用工具详解,是一部适合程序员的百科全书。" 4 | 5 | } -------------------------------------------------------------------------------- /cover/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/cover/background.jpg -------------------------------------------------------------------------------- /cover/cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/cover/cover.jpg -------------------------------------------------------------------------------- /cover/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/cover/logo.png -------------------------------------------------------------------------------- /favorite-file/Keepalived-Settings/nginx_check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 如果进程中没有nginx则将keepalived进程kill掉 3 | A=`ps -C nginx --no-header |wc -l` ## 查看是否有 nginx进程 把值赋给变量A 4 | if [ $A -eq 0 ];then ## 如果没有进程值得为 零 5 | service keepalived stop ## 则结束 keepalived 进程 6 | fi -------------------------------------------------------------------------------- /favorite-file/MySQL-Settings/MySQL-5.6/1G-Memory-Machine/my-for-master.cnf: -------------------------------------------------------------------------------- 1 | 2 | # 适用于 Mysql 5.6 3 | # 该配置适合 1G 内存左右的机子,储存类型为 InnoDB 4 | # 官网配置说明:http://dev.mysql.com/doc/refman/5.6/en/mysqld-option-tables.html 5 | # 官网状态值说明:http://dev.mysql.com/doc/refman/5.6/en/server-status-variables.html 6 | # 官网环境变量说明:http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html 7 | # 在线生成配置工具:http://tools.percona.com(只是起到一个参考作用,生成的配置文件里面的参数名有的是用符号:-,而官网是用:_,所以这个也要注意改掉。) 8 | # 资料参考:https://blog.linuxeye.com/379.html 9 | # 注释内容为注释行下面的配置的解释 10 | # 这是一个综合配置,不是单独为主库或是从库考虑 11 | 12 | # ============================================================================================================ 13 | 14 | 15 | # 客户端设置 16 | [mysql] 17 | port = 3306 18 | socket = /usr/program/mysql/data/mysql.sock 19 | default-character-set = utf8 20 | 21 | # ============================================================================================================ 22 | 23 | 24 | # 服务端设置 25 | [mysqld] 26 | user = mysql 27 | port = 3306 28 | default-storage-engine = InnoDB 29 | socket = /usr/program/mysql/data/mysql.sock 30 | pid-file = /usr/program/mysql/data/mysql.pid 31 | 32 | collation-server = utf8_general_ci 33 | init_connect = 'SET NAMES utf8' 34 | character-set-server = utf8 35 | basedir = /usr/program/mysql 36 | datadir = /usr/program/mysql/data 37 | log-error = /usr/program/mysql/data/mysql-error.log 38 | 39 | # (重点修改)表示是本机的序号为1,一般配合设置主从的时候一定要修改的地方 40 | server-id = 1 41 | 42 | 43 | 44 | # back_log 值指出在 MySQL 暂时停止回答新请求之前的短时间内多少个请求可以被存在堆栈中。如果 MySQL 的连接数据达到 max_connections 时,新来的请求将会被存在堆栈中,以等待某一连接释放资源,该堆栈的数量即 back_log,如果等待连接的数量超过 back_log,将不被授予连接资源。 45 | # 另外,这值(back_log)限于您的操作系统对到来的 TCP/IP 连接的侦听队列的大小。你的操作系统在这个队列大小上有它自己的限制(可以检查你的 OS 文档找出这个变量的最大值),试图设定 back_log 高于你的操作系统的限制将是无效的。 46 | back_log = 512 47 | 48 | # MySQL 的最大并发连接数 49 | max_connections = 1000 50 | # 网络传输中一次小心传输量的最大值(最大值为 1G);增加该变量的值十分安全,这是因为仅当需要时才会分配额外内存。例如,仅当你发出长查询或 MySQL 必须返回大的结果行时 MySQL 才会分配更多内存。该变量之所以取较小默认值是一种预防措施,以捕获客户端和服务器之间的错误信息包,并确保不会因偶然使用大的信息包而导致内存溢出。 51 | max_allowed_packet = 16M 52 | # 对于同一主机,如果有超出该参数值个数的中断错误连接,则该主机将被禁止连接。如需对该主机进行解禁,执行 Mysql 命令:FLUSH HOST。 53 | max_connect_errors = 1000000 54 | # 禁止MySQL对外部连接进行DNS解析,使用这一选项可以消除MySQL进行DNS解析的时间。但需要注意,如果开启该选项,则所有远程主机连接授权都要使用IP地址方式,否则MySQL将无法正常处理连接请求 55 | skip-name-resolve 56 | # MySQL打开的文件描述符限制 57 | open_files_limit = 65535 58 | # MySQL 每打开一个表,都会读入一些数据到 table_open_cache 缓存中,当 MySQL 在这个缓存中找不到相应信息时,才会去磁盘上读取。默认值 400,最大值:524288。假定系统有 200 个并发连接,则需将此参数设置为 200*N (N 为每个连接所需的文件描述符数目);当把 table_open_cache 设置为很大时,如果系统处理不了那么多文件描述符,那么就会出现客户端失效,连接不上 59 | table_open_cache = 2048 60 | 61 | # 一个事务,在没有提交的时候,产生的日志,记录到 Cache 中;等到事务提交需要提交的时候,则把日志持久化到磁盘。默认 binlog_cache_size 大小32K 62 | binlog_cache_size = 1M 63 | # 定义了用户可以创建的内存表(memory table)的大小。这个值用来计算内存表的最大行数值。这个变量支持动态改变 64 | max_heap_table_size = 32M 65 | # MySQL的heap(堆积)表缓冲大小。如果超过该值,则会将临时表写入磁盘。其范围值:1KB~4GB 66 | tmp_table_size = 32M 67 | 68 | # MySQL读入缓冲区大小。该参数对应的分配内存也是每连接独享,所以,如果有100连接,那占用的内存是:100X2M=200M,所以4G内存的服务器,建议该值是6~8M 69 | read_buffer_size = 2M 70 | # MySQL的随机读缓冲区大小。 71 | read_rnd_buffer_size = 8M 72 | # MySQL执行排序使用的缓冲大小。该参数对应的分配内存也是每连接独享,所以,如果有100连接,那占用的内存是:100X2M=200M,所以4G内存的服务器,建议该值是6~8M 73 | sort_buffer_size = 2M 74 | # 联合查询操作所能使用的缓冲区大小,和sort_buffer_size一样,该参数对应的分配内存也是每连接独享,所以,如果有100连接,那占用的内存是:100X4M=400M,所以4G内存的服务器,建议该值是6~8M 75 | join_buffer_size = 4M 76 | # 指定用于索引的缓冲区大小,增加它可得到更好处理的索引(对所有读和多重写),对于4GB内存的服务器,该参数可以设置为:256M或384M 77 | key_buffer_size = 64M 78 | # 这个值(默认8)表示可以重新利用保存在缓存中线程的数量,当断开连接时如果缓存中还有空间,那么客户端的线程将被放到缓存中, 79 | # 根据物理内存设置规则如下: 80 | # 1G —> 8 81 | # 2G —> 16 82 | # 3G —> 32 83 | # 大于3G —> 64 84 | thread_cache_size = 8 85 | 86 | # 每个线程的堆栈大小,值范围:128K ~ 4GB,默认是192KB 87 | thread_stack = 256k 88 | 89 | # 0是关闭高速缓存,1是开启高速缓存 90 | query_cache_type = 0 91 | # 查询缓冲区的大小,如果是4G内存建议设置为64M。具体设置值还要根据运行环境来判断,你可以执行这个SQL语句:show status like 'Qcache%'; 92 | # 从SQL语句查询的结果中,查看Qcache_lowmem_prunes的值非常大表示查询缓冲不够,你应该增加该设置值 93 | query_cache_size = 0 94 | query_cache_limit = 2M 95 | 96 | # 分词词汇最小长度,默认4 97 | ft_min_word_len = 4 98 | 99 | log-bin = /usr/program/mysql/data/mysql-bin 100 | binlog-format = mixed 101 | expire_logs_days = 30 102 | # 该参数的说明:http://blog.csdn.net/wulantian/article/details/9965905 103 | sync_binlog = 1 104 | 105 | # 是否开启慢查询记录,1表示开启,0表示关闭,如果是主从环境下,主库不要开启,从库开启 106 | slow_query_log = 0 107 | # 慢查询时间 超过3秒则为慢查询 108 | long_query_time = 3 109 | slow_query_log_file = /usr/program/mysql/data/mysql-slow.log 110 | 111 | performance_schema = 0 112 | # 改参数的说明:http://www.cnblogs.com/digdeep/p/4727715.html 113 | explicit_defaults_for_timestamp = true 114 | 115 | # 数据库库名/表名是否区分大小写,0:区分大小写,1:不区分大小写 116 | lower_case_table_names = 1 117 | 118 | # MySQL选项以避免外部锁定,减少出错几率,增强稳定性 119 | skip_external_locking 120 | 121 | 122 | # 在网络上不允许TCP/IP连接到MySQL。所有到MySQL的连接必须经由Unix socket进行。如果要允许TCP/IP连接,则注释当前行即可 123 | # skip-networking 124 | 125 | 126 | table_definition_cache = 1024 127 | 128 | # 该设置值取值为:服务器机子的逻辑CPU数量X2,比如你的服务器机子是 Linux 系统你可以执行:grep 'processor' /proc/cpuinfo | sort -u | wc -l,可以查看到逻辑CPU数量值,比如我取到的值是24,那我这里应该设置为:24X2=48 129 | thread_concurrency = 2 130 | 131 | # 强制为 innodb类型 132 | innodb = FORCE 133 | innodb_file_per_table = 1 134 | # 限制Innodb能打开的表的数据,如果库里的表特别多的情况,请增加这个。这个值默认是300 135 | innodb_open_files = 500 136 | # InnoDB使用一个缓冲池来保存索引和原始数据, 不像MyISAM. 137 | # 这里你设置越大,你在存取表里面数据时所需要的磁盘I/O越少. 138 | # 在一个独立使用的数据库服务器上,你可以设置这个变量到服务器物理内存大小的70%左右 139 | # 不要设置过大,否则,由于物理内存的竞争可能导致操作系统的换页颠簸. 140 | innodb_buffer_pool_size = 592M 141 | 142 | # innodb使用后台线程处理数据页上的读写 I/O(输入输出)请求,根据你的 CPU 核数来更改,默认是4 143 | # 注:这两个参数不支持动态改变,需要把该参数加入到my.cnf里,修改完后重启MySQL服务,允许值的范围从 1-64 144 | innodb_write_io_threads = 4 145 | innodb_read_io_threads = 4 146 | 147 | # 默认设置为 0,表示不限制并发数,这里推荐设置为0,更好去发挥CPU多核处理能力,提高并发量 148 | innodb_thread_concurrency = 0 149 | innodb_purge_threads = 1 150 | innodb_flush_log_at_trx_commit = 1 151 | innodb_log_buffer_size = 2M 152 | innodb_log_file_size = 64M 153 | innodb_log_files_in_group = 3 154 | innodb_max_dirty_pages_pct = 90 155 | innodb_lock_wait_timeout = 120 156 | innodb_additional_mem_pool_size = 2M 157 | bulk_insert_buffer_size = 8M 158 | # 用于设置在 REPAIR TABLE 和 CREATE INDEX 创建索引或 ALTER TABLE 的过程中排序索引所分配的缓冲区大小,可设置范围:4MB~4GB,默认8MB,4G内存的服务器可以设置为32M~64M 159 | myisam_sort_buffer_size = 8M 160 | # 32位系统默认值是2147483648=2G,64位系统,默认值是9223372036854775807,单位是bytes. 161 | myisam_max_sort_file_size = 100G 162 | myisam_repair_threads = 1 163 | 164 | # 服务器关闭交互式连接前等待活动的秒数。单位秒 165 | interactive_timeout = 28800 166 | # 服务器关闭非交互连接之前等待活动的秒数。单位秒。通过show processlist命令查看当前系统的连接状态,如果发现有大量的sleep状态的连接进程,则说明该参数设置的过大。默认值:28800 167 | wait_timeout = 3600 168 | 169 | # ============================================================================================================ 170 | 171 | [mysqldump] 172 | quick 173 | # 服务器发送和接受的最大包长度 174 | max_allowed_packet = 16M 175 | 176 | [myisamchk] 177 | key_buffer_size = 8M 178 | sort_buffer_size = 8M 179 | read_buffer = 4M 180 | write_buffer = 4M 181 | -------------------------------------------------------------------------------- /favorite-file/MySQL-Settings/MySQL-5.6/8G-Memory-Machine/my.cnf: -------------------------------------------------------------------------------- 1 | [mysql] 2 | port = 3306 3 | socket = /usr/program/mysql/data/mysql.sock 4 | default-character-set = utf8 5 | 6 | [mysqld] 7 | user = mysql 8 | port = 3306 9 | server-id = 100866 10 | default-storage-engine = InnoDB 11 | socket = /usr/program/mysql/data/mysql.sock 12 | pid-file = /usr/program/mysql/data/mysql.pid 13 | collation-server = utf8_general_ci 14 | init_connect = 'SET NAMES utf8' 15 | character-set-server = utf8 16 | basedir = /usr/program/mysql 17 | datadir = /usr/program/mysql/data 18 | log-error = /usr/program/mysql/data/mysql-error.log 19 | 20 | back_log = 512 21 | max_connections = 1000 22 | max_allowed_packet = 120M 23 | max_connect_errors = 1000000 24 | skip-name-resolve 25 | open_files_limit = 65535 26 | table_open_cache = 2048 27 | binlog_cache_size = 20M 28 | max_heap_table_size = 40M 29 | tmp_table_size = 64M 30 | read_buffer_size = 20M 31 | read_rnd_buffer_size = 20M 32 | sort_buffer_size = 20M 33 | join_buffer_size = 20M 34 | key_buffer_size = 40M 35 | thread_cache_size = 100 36 | thread_stack = 20M 37 | 38 | # 5.6.8之后这个不再建议开启了,所以要关掉 39 | query_cache_type = 0 40 | query_cache_size = 40M 41 | query_cache_limit = 10M 42 | ft_min_word_len = 4 43 | log-bin = /usr/program/mysql/data/mysql-bin 44 | binlog-format = mixed 45 | expire_logs_days = 14 46 | sync_binlog = 0 47 | log-queries-not-using-indexes = 1 48 | slow_query_log = 0 49 | long_query_time = 3 50 | slow_query_log_file = /usr/program/mysql/data/mysql-slow.log 51 | performance_schema = 0 52 | explicit_defaults_for_timestamp = true 53 | lower_case_table_names = 1 54 | skip_external_locking 55 | table_definition_cache = 1024 56 | thread_concurrency = 2 57 | innodb = FORCE 58 | innodb_flush_method = O_DIRECT 59 | innodb_file_per_table = 1 60 | innodb_open_files = 500 61 | innodb_thread_concurrency = 0 62 | innodb_purge_threads = 1 63 | innodb_flush_log_at_trx_commit = 1 64 | innodb_log_buffer_size = 20M 65 | innodb_log_file_size = 256M 66 | innodb_log_files_in_group = 2 67 | innodb_lock_wait_timeout = 120 68 | innodb_additional_mem_pool_size = 20M 69 | 70 | 71 | innodb_buffer_pool_size = 3G 72 | innodb_read_io_threads = 8 73 | innodb_write_io_threads = 8 74 | innodb_io_capacity = 2000 75 | innodb_max_dirty_pages_pct = 90 76 | 77 | bulk_insert_buffer_size = 64M 78 | myisam_sort_buffer_size = 64M 79 | myisam_max_sort_file_size = 10G 80 | myisam_repair_threads = 1 81 | interactive_timeout = 28800 82 | wait_timeout = 3600 83 | 84 | [mysqldump] 85 | quick 86 | max_allowed_packet = 120M 87 | 88 | [myisamchk] 89 | key_buffer_size = 20M 90 | sort_buffer_size = 20M 91 | read_buffer = 20M 92 | write_buffer = 20M 93 | -------------------------------------------------------------------------------- /favorite-file/MySQL-Settings/MySQL-5.6/developer/my-Windows-8G-开发机.ini: -------------------------------------------------------------------------------- 1 | [client] 2 | no-beep 3 | port=3306 4 | 5 | 6 | [mysql] 7 | default-character-set=utf8 8 | 9 | [mysqld] 10 | port=3306 11 | basedir="C:/Program Files/MySQL/MySQL Server 5.6/" 12 | datadir="C:/ProgramData/MySQL/MySQL Server 5.6/data\" 13 | character-set-server=utf8 14 | default-storage-engine=INNODB 15 | sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" 16 | log-output=NONE 17 | general-log=0 18 | general_log_file="AJBC-1540.log" 19 | slow-query-log=0 20 | slow_query_log_file="AJBC-1540-slow.log" 21 | long_query_time=10 22 | log-error="AJBC-1540.err" 23 | max_connections=1000 24 | query_cache_size=10M 25 | table_open_cache=2000 26 | tmp_table_size=37M 27 | thread_cache_size=32 28 | myisam_max_sort_file_size=100G 29 | myisam_sort_buffer_size=72M 30 | key_buffer_size=256M 31 | read_buffer_size=6M 32 | read_rnd_buffer_size=8M 33 | sort_buffer_size=2M 34 | innodb_additional_mem_pool_size=5M 35 | innodb_flush_log_at_trx_commit=1 36 | innodb_log_buffer_size=3M 37 | innodb_buffer_pool_size=592M 38 | innodb_log_file_size=64M 39 | innodb_thread_concurrency=9 40 | innodb_autoextend_increment=64M 41 | innodb_buffer_pool_instances=8 42 | innodb_concurrency_tickets=5000 43 | innodb_old_blocks_time=1000 44 | innodb_open_files=500 45 | innodb_stats_on_metadata=0 46 | innodb_file_per_table=1 47 | innodb_checksum_algorithm=0 48 | back_log=512 49 | flush_time=0 50 | join_buffer_size=4M 51 | max_allowed_packet=50M 52 | max_connect_errors=1000000 53 | open_files_limit=65535 54 | query_cache_type=1 55 | table_definition_cache=1400 56 | binlog_row_event_max_size=8K 57 | sync_master_info=10000 58 | sync_relay_log=10000 59 | sync_relay_log_info=10000 60 | innodb_write_io_threads = 4 61 | innodb_read_io_threads = 4 62 | innodb_purge_threads = 1 63 | innodb_log_files_in_group = 3 64 | innodb_max_dirty_pages_pct = 90 65 | innodb_lock_wait_timeout = 120 66 | max_heap_table_size = 32M 67 | thread_stack = 256k 68 | ft_min_word_len = 4 69 | performance_schema = 0 70 | explicit_defaults_for_timestamp = true 71 | skip_external_locking 72 | bulk_insert_buffer_size = 8M 73 | wait_timeout = 3600 74 | interactive_timeout = 28800 75 | myisam_repair_threads = 1 76 | query_cache_limit = 5M -------------------------------------------------------------------------------- /favorite-file/Nginx-Settings/nginx: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | #nginx执行程序路径需要修改 5 | nginxd=/usr/local/nginx/sbin/nginx 6 | 7 | # nginx配置文件路径需要修改 8 | nginx_config=/usr/local/nginx/conf/nginx.conf 9 | 10 | # pid 地址需要修改 11 | nginx_pid=/var/local/nginx/nginx.pid 12 | 13 | 14 | RETVAL=0 15 | prog="nginx" 16 | 17 | # Source function library. 18 | . /etc/rc.d/init.d/functions 19 | # Source networking configuration. 20 | . /etc/sysconfig/network 21 | # Check that networking is up. 22 | [ ${NETWORKING} = "no" ] && exit 0 23 | [ -x $nginxd ] || exit 0 24 | 25 | # Start nginx daemons functions. 26 | start() { 27 | if [ -e $nginx_pid ];then 28 | echo "nginx already running...." 29 | exit 1 30 | fi 31 | 32 | echo -n $"Starting $prog: " 33 | daemon $nginxd -c ${nginx_config} 34 | RETVAL=$? 35 | echo 36 | [ $RETVAL = 0 ] && touch /var/lock/subsys/nginx 37 | return $RETVAL 38 | } 39 | 40 | # Stop nginx daemons functions. 41 | # pid 地址需要修改 42 | stop() { 43 | echo -n $"Stopping $prog: " 44 | killproc $nginxd 45 | RETVAL=$? 46 | echo 47 | [ $RETVAL = 0 ] && rm -f /var/lock/subsys/nginx /var/local/nginx/nginx.pid 48 | } 49 | 50 | # reload nginx service functions. 51 | reload() { 52 | echo -n $"Reloading $prog: " 53 | #kill -HUP `cat ${nginx_pid}` 54 | killproc $nginxd -HUP 55 | RETVAL=$? 56 | echo 57 | } 58 | 59 | # See how we were called. 60 | case "$1" in 61 | start) 62 | start 63 | ;; 64 | stop) 65 | stop 66 | ;; 67 | reload) 68 | reload 69 | ;; 70 | restart) 71 | stop 72 | start 73 | ;; 74 | status) 75 | status $prog 76 | RETVAL=$? 77 | ;; 78 | *) 79 | 80 | echo $"Usage: $prog {start|stop|restart|reload|status|help}" 81 | exit 1 82 | 83 | esac 84 | exit $RETVAL -------------------------------------------------------------------------------- /favorite-file/Nginx-Settings/nginx.conf: -------------------------------------------------------------------------------- 1 | user root; 2 | 3 | worker_processes 2;#Nginx进程数, 建议设置为等于CPU总核心数 4 | 5 | events { 6 | use epoll; #nginx工作模式,epoll是linux平台下的高效模式,配合nginx的异步非阻塞作用 7 | worker_connections 1024;#单个进程最大连接数 8 | } 9 | 10 | http { 11 | include mime.types;#扩展名与文件类型映射表:#nginx通过服务端文件的后缀名来判断这个文件属于什么类型,再将该数据类型写入http头部的Content-Type字段中,发送给客户端。mime.types这个文件里面全是文件类型的定义。 12 | default_type application/octet-stream;#当用户请求的文件后缀在mime.types这个文件没有定义,便使用默认的type为二进制流 13 | sendfile on;#开启高效文件传输模式 14 | tcp_nopush on;#启用之后,数据包会累积到一定大小才会发送,减小了额外开销,防止网络阻塞,提高网络效率 15 | tcp_nodelay on;#启用之后,尽快发送数据。可以看到tcp_nopush是要等数据包累积到一定大小才发送,tcp_nodelay是要尽快发送,二者相互矛盾。实际上,它们可以一起用,最终的效果是先填满包,再尽快发送。 16 | keepalive_timeout 65; 17 | charset utf8; 18 | 19 | #全局日志(也可以把这个配置到 server 中进行不同 server 的不同配置) 20 | access_log /var/log/nginx/access.log; 21 | error_log /var/log/nginx/error.log; 22 | 23 | # gzip 压缩设置 24 | gzip on; 25 | gzip_min_length 1k; 26 | gzip_buffers 4 16k; 27 | gzip_http_version 1.0; 28 | gzip_comp_level 2;#gzip的压缩程度,级别为1到9.级别越高,压缩程序越高,时间越多 29 | gzip_types text/plain application/x-javascript text/css text/xml application/xml text/javascript application/javascript application/json; 30 | gzip_vary on;#告诉接受方数据经过gzip压缩 31 | gzip_disable "MSIE[1-6]\."; #因为IE6对gzip不支持,所以在IE6及更旧的版本不使用gzip压缩 32 | 33 | server { 34 | 35 | listen 80; #监听80端口 36 | server_name localhost 127.0.0.1 120.77.84.121 gitnavi.com; 37 | 38 | location / { 39 | root /usr/program/tomcat8/webapps/ROOT;#静态文件直接读取硬盘,所有这里直接写tomcat的程序里面的静态资源目录 40 | index index.html index.jsp; 41 | } 42 | 43 | location = / { 44 | root /usr/program/tomcat8/webapps/ROOT;#静态文件直接读取硬盘,所有这里直接写tomcat的程序里面的静态资源目录 45 | index index.html; 46 | } 47 | 48 | # 匹配用户导航静态 html 目录路径 49 | location ^~ /u/ { 50 | root /usr/program/tomcat8/webapps/ROOT;#静态文件直接读取硬盘,所有这里直接写tomcat的程序里面的静态资源目录 51 | } 52 | 53 | # Controller 中前台的请求标识 54 | location ^~ /front/ { 55 | proxy_pass http://127.0.0.1:8080; #转发请求交给tomcat处理 56 | proxy_redirect off; 57 | proxy_set_header Host $host; #后端的Web服务器可以通过X-Forwarded-For获取用户真实IP 58 | proxy_set_header X-Real-IP $remote_addr; 59 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 60 | client_max_body_size 10m; #允许客户端请求的最大单文件字节数 61 | client_body_buffer_size 128k; #缓冲区代理缓冲用户端请求的最大字节数 62 | proxy_connect_timeout 300; #nginx跟后端服务器连接超时时间 63 | proxy_send_timeout 300; #后端服务器数据回传时间(代理发送超时) 64 | proxy_read_timeout 300; #连接成功后,后端服务器响应时间 65 | proxy_buffer_size 4k; #设置代理服务器(nginx)保存用户头信息的缓冲区大小 66 | proxy_buffers 6 32k; #proxy_buffers缓冲区,网页平均在32k以下的话,这样设置 67 | proxy_busy_buffers_size 64k; #高负荷下缓冲大小(proxy_buffers*2) 68 | proxy_temp_file_write_size 64k; #设定缓存文件夹大小,大于这个值,将从upstream服务器传 69 | } 70 | 71 | # Controller 中后台的请求标识 72 | location ^~ /admin/ { 73 | proxy_pass http://127.0.0.1:8080; #转发请求交给tomcat处理 74 | proxy_redirect off; 75 | proxy_set_header Host $host; #后端的Web服务器可以通过X-Forwarded-For获取用户真实IP 76 | proxy_set_header X-Real-IP $remote_addr; 77 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 78 | client_max_body_size 10m; #允许客户端请求的最大单文件字节数 79 | client_body_buffer_size 128k; #缓冲区代理缓冲用户端请求的最大字节数 80 | proxy_connect_timeout 300; #nginx跟后端服务器连接超时时间 81 | proxy_send_timeout 300; #后端服务器数据回传时间(代理发送超时) 82 | proxy_read_timeout 300; #连接成功后,后端服务器响应时间 83 | proxy_buffer_size 4k; #设置代理服务器(nginx)保存用户头信息的缓冲区大小 84 | proxy_buffers 6 32k; #proxy_buffers缓冲区,网页平均在32k以下的话,这样设置 85 | proxy_busy_buffers_size 64k; #高负荷下缓冲大小(proxy_buffers*2) 86 | proxy_temp_file_write_size 64k; #设定缓存文件夹大小,大于这个值,将从upstream服务器传 87 | } 88 | 89 | #静态资源转发 90 | #由nginx处理静态页面 91 | location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|ico|woff|woff2|ttf|eot)$ { 92 | root /usr/program/tomcat8/webapps/ROOT;#这里直接写tomcat的程序里面的静态资源目录 93 | expires 30d;#使用expires缓存模块,缓存到客户端30天(这个模块看下有没有安装) 94 | } 95 | #因为我的 html 页面经常变动,所以 html 我这里就不缓存了 96 | location ~ .*\.(js|css)?$ { 97 | root /usr/program/tomcat8/webapps/ROOT;#静态文件直接读取硬盘,所有这里直接写tomcat的程序里面的静态资源目录 98 | expires 1d;#也可以指定小时,比如:12h 99 | } 100 | # 读取一些静态页面,比如隐私政策等 101 | location ~ .*\.(html|htm)?$ { 102 | root /usr/program/tomcat8/webapps/ROOT;#静态文件直接读取硬盘,所有这里直接写tomcat的程序里面的静态资源目录 103 | expires 1d;#也可以指定小时,比如:12h 104 | } 105 | 106 | #其他请求都视为动态请求处理 107 | #location ~ .*$ { 108 | # proxy_pass http://127.0.0.1:8080; #转发请求交给tomcat处理 109 | # proxy_redirect off; 110 | # proxy_set_header Host $host; #后端的Web服务器可以通过X-Forwarded-For获取用户真实IP 111 | # proxy_set_header X-Real-IP $remote_addr; 112 | # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 113 | # client_max_body_size 10m; #允许客户端请求的最大单文件字节数 114 | # client_body_buffer_size 128k; #缓冲区代理缓冲用户端请求的最大字节数 115 | # proxy_connect_timeout 300; #nginx跟后端服务器连接超时时间 116 | # proxy_send_timeout 300; #后端服务器数据回传时间(代理发送超时) 117 | # proxy_read_timeout 300; #连接成功后,后端服务器响应时间 118 | # proxy_buffer_size 4k; #设置代理服务器(nginx)保存用户头信息的缓冲区大小 119 | # proxy_buffers 6 32k; #proxy_buffers缓冲区,网页平均在32k以下的话,这样设置 120 | # proxy_busy_buffers_size 64k; #高负荷下缓冲大小(proxy_buffers*2) 121 | # proxy_temp_file_write_size 64k; #设定缓存文件夹大小,大于这个值,将从upstream服务器传 122 | #} 123 | 124 | #常见错误页面设置 125 | error_page 404 /404.html; 126 | location = /404.html { 127 | root /usr/program/tomcat8/webapps/ROOT; 128 | } 129 | error_page 500 502 503 504 /500.html; 130 | location = /500.html { 131 | root /usr/program/tomcat8/webapps/ROOT; 132 | } 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /favorite-file/Tomcat-Settings/server.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 | 17 | 25 | 26 | 27 | 44 | 45 | 46 | 47 | 49 | 50 | 52 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /favorite-file/redis/redis: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # redis - this script starts and stops the redis-server daemon 4 | # 5 | # chkconfig: - 85 15 6 | # description: Redis is a persistent key-value database 7 | # processname: redis-server 8 | # config: /usr/local/redis-2.4.X/bin/redis-server 9 | # config: /usr/local/ /redis-2.4.X/etc/redis.conf 10 | # Source function library. 11 | . /etc/rc.d/init.d/functions 12 | # Source networking configuration. 13 | . /etc/sysconfig/network 14 | # Check that networking is up. 15 | [ "$NETWORKING" = "no" ] && exit 0 16 | redis="/usr/local/bin/redis-server" 17 | prog=$(basename $redis) 18 | REDIS_CONF_FILE="/etc/redis.conf" 19 | [ -f /etc/sysconfig/redis ] && . /etc/sysconfig/redis 20 | lockfile=/var/lock/subsys/redis 21 | start() { 22 | [ -x $redis ] || exit 5 23 | [ -f $REDIS_CONF_FILE ] || exit 6 24 | echo -n $"Starting $prog: " 25 | daemon $redis $REDIS_CONF_FILE 26 | retval=$? 27 | echo 28 | [ $retval -eq 0 ] && touch $lockfile 29 | return $retval 30 | } 31 | stop() { 32 | echo -n $"Stopping $prog: " 33 | killproc $prog -QUIT 34 | retval=$? 35 | echo 36 | [ $retval -eq 0 ] && rm -f $lockfile 37 | return $retval 38 | } 39 | restart() { 40 | stop 41 | start 42 | } 43 | reload() { 44 | echo -n $"Reloading $prog: " 45 | killproc $redis -HUP 46 | RETVAL=$? 47 | echo 48 | } 49 | force_reload() { 50 | restart 51 | } 52 | rh_status() { 53 | status $prog 54 | } 55 | rh_status_q() { 56 | rh_status >/dev/null 2>&1 57 | } 58 | case "$1" in 59 | start) 60 | rh_status_q && exit 0 61 | $1 62 | ;; 63 | stop) 64 | rh_status_q || exit 0 65 | $1 66 | ;; 67 | restart|configtest) 68 | $1 69 | ;; 70 | reload) 71 | rh_status_q || exit 7 72 | $1 73 | ;; 74 | force-reload) 75 | force_reload 76 | ;; 77 | status) 78 | rh_status 79 | ;; 80 | condrestart|try-restart) 81 | rh_status_q || exit 0 82 | ;; 83 | *) 84 | echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart| reload|orce-reload}" 85 | exit 2 86 | esac -------------------------------------------------------------------------------- /favorite-file/shell/install_mysql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "安装 mysql 开始" 4 | 5 | cd /opt/setups 6 | 7 | tar zxvf mysql-5.6.35.tar.gz 8 | 9 | mv /opt/setups/mysql-5.6.35 /usr/program/ 10 | 11 | yum install -y make gcc-c++ cmake bison-devel ncurses-devel 12 | 13 | cd /usr/program/mysql-5.6.35/ 14 | 15 | mkdir -p /usr/program/mysql/data 16 | 17 | cmake -DCMAKE_INSTALL_PREFIX=/usr/program/mysql -DMYSQL_DATADIR=/usr/program/mysql/data -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=utf8 -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 18 | 19 | make 20 | 21 | make install 22 | 23 | cp /usr/program/mysql-5.6.35/support-files/mysql.server /etc/init.d/mysql 24 | 25 | chmod 755 /etc/init.d/mysql 26 | 27 | chkconfig mysql on 28 | 29 | cp /usr/program/mysql-5.6.35/support-files/my-default.cnf /etc/my.cnf 30 | 31 | rm -rf /usr/program/mysql-5.6.35/ 32 | 33 | groupadd mysql 34 | 35 | useradd -g mysql mysql -s /bin/false 36 | 37 | chown -R mysql:mysql /usr/program/mysql/data 38 | 39 | /usr/program/mysql/scripts/mysql_install_db --basedir=/usr/program/mysql --datadir=/usr/program/mysql/data --skip-name-resolve --user=mysql 40 | 41 | ln -s /usr/program/mysql/bin/mysql /usr/bin 42 | 43 | ln -s /usr/program/mysql/bin/mysqladmin /usr/bin 44 | 45 | ln -s /usr/program/mysql/bin/mysqldump /usr/bin 46 | 47 | ln -s /usr/program/mysql/bin/mysqlslap /usr/bin 48 | 49 | iptables -I INPUT -p tcp -m tcp --dport 3306 -j ACCEPT 50 | 51 | service iptables save 52 | 53 | service iptables restart 54 | 55 | echo "安装 mysql 结束,现在需要手动设置防火墙和禁用 selinux." -------------------------------------------------------------------------------- /favorite-file/shell/install_nginx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "安装 nginx" 4 | 5 | cd /opt/setups 6 | 7 | yum install -y gcc gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel 8 | 9 | mkdir -p /usr/local/nginx /var/log/nginx /var/temp/nginx /var/lock/nginx 10 | 11 | tar zxvf nginx-1.10.2.tar.gz 12 | 13 | cd nginx-1.10.2/ 14 | 15 | ./configure --prefix=/usr/local/nginx --pid-path=/var/local/nginx/nginx.pid --lock-path=/var/lock/nginx/nginx.lock --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_gzip_static_module --http-client-body-temp-path=/var/temp/nginx/client --http-proxy-temp-path=/var/temp/nginx/proxy --http-fastcgi-temp-path=/var/temp/nginx/fastcgi --http-uwsgi-temp-path=/var/temp/nginx/uwsgi --http-scgi-temp-path=/var/temp/nginx/scgi 16 | 17 | make 18 | 19 | make install 20 | 21 | iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT 22 | 23 | service iptables save 24 | 25 | service iptables restart 26 | 27 | echo "完成安装 nginx,把端口加到防火墙中" 28 | -------------------------------------------------------------------------------- /favorite-file/shell/install_redis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "安装开始" 4 | 5 | yum install -y gcc-c++ tcl 6 | 7 | cd /opt/setups 8 | 9 | tar zxvf redis-3.2.8.tar.gz 10 | 11 | mv redis-3.2.8/ /usr/program/ 12 | 13 | cd /usr/program/redis-3.2.8 14 | 15 | make 16 | 17 | make install 18 | 19 | cp /usr/program/redis-3.2.8/redis.conf /etc/ 20 | 21 | sed -i 's/daemonize no/daemonize yes/g' /etc/redis.conf 22 | 23 | echo "/usr/local/bin/redis-server /etc/redis.conf" >> /etc/rc.local 24 | 25 | iptables -I INPUT -p tcp -m tcp --dport 6379 -j ACCEPT 26 | 27 | service iptables save 28 | 29 | service iptables restart 30 | 31 | rm -rf /usr/program/redis-3.2.8 32 | 33 | echo "安装结束" 34 | -------------------------------------------------------------------------------- /favorite-file/shell/install_vim_zsh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "安装 vim 和对应配置" 4 | 5 | yum install -y vim 6 | 7 | curl https://raw.githubusercontent.com/wklken/vim-for-server/master/vimrc > ~/.vimrc 8 | 9 | 10 | echo "安装 zsh 和 oh-my-zsh" 11 | 12 | yum install -y zsh 13 | 14 | yum install -y git 15 | 16 | wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O - | sh 17 | 18 | chsh -s /bin/zsh root 19 | 20 | echo "请重新连接就可以体验 zsh 了." 21 | -------------------------------------------------------------------------------- /favorite-file/shell/repo_install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 本文原内容来自:https://github.com/judasn/Linux-Tutorial/blob/master/CentOS-Extra-Packages.md 3 | 4 | echo "源设置开始" 5 | 6 | echo "备份默认源设置" 7 | sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 8 | cd /etc/yum.repos.d/ 9 | 10 | echo "下载网易 centos6 源" 11 | sudo wget http://mirrors.163.com/.help/CentOS6-Base-163.repo 12 | 13 | echo "安装网易 centos6 源" 14 | sudo mv CentOS6-Base-163.repo CentOS-Base.repo 15 | rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 16 | 17 | echo "清除缓存后更新程序" 18 | sudo yum clean all 19 | sudo yum makecache 20 | sudo yum update -y 21 | 22 | echo "使用第三方源" 23 | echo "安装 EPEL 源" 24 | sudo yum install -y epel-release 25 | rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 26 | 27 | echo "安装 RepoForge 源" 28 | wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm 29 | sudo rpm -ivh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm 30 | sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag 31 | 32 | echo "清除缓存后更新程序" 33 | sudo yum clean all 34 | sudo yum makecache 35 | sudo yum update -y 36 | 37 | echo "测试安装 htop" 38 | sudo yum install -y htop 39 | 40 | echo "完成源设置" 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /favorite-file/zsh/.zshrc: -------------------------------------------------------------------------------- 1 | # If you come from bash you might have to change your $PATH. 2 | # export PATH=$HOME/bin:/usr/local/bin:$PATH 3 | 4 | # Path to your oh-my-zsh installation. 5 | export ZSH=/root/.oh-my-zsh 6 | 7 | # Set name of the theme to load. Optionally, if you set this to "random" 8 | # it'll load a random theme each time that oh-my-zsh is loaded. 9 | # See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes 10 | ZSH_THEME="avit" 11 | 12 | # Uncomment the following line to use case-sensitive completion. 13 | # CASE_SENSITIVE="true" 14 | 15 | # Uncomment the following line to use hyphen-insensitive completion. Case 16 | # sensitive completion must be off. _ and - will be interchangeable. 17 | # HYPHEN_INSENSITIVE="true" 18 | 19 | # Uncomment the following line to disable bi-weekly auto-update checks. 20 | # DISABLE_AUTO_UPDATE="true" 21 | 22 | # Uncomment the following line to change how often to auto-update (in days). 23 | # export UPDATE_ZSH_DAYS=13 24 | 25 | # Uncomment the following line to disable colors in ls. 26 | # DISABLE_LS_COLORS="true" 27 | 28 | # Uncomment the following line to disable auto-setting terminal title. 29 | # DISABLE_AUTO_TITLE="true" 30 | 31 | # Uncomment the following line to enable command auto-correction. 32 | # ENABLE_CORRECTION="true" 33 | 34 | # Uncomment the following line to display red dots whilst waiting for completion. 35 | # COMPLETION_WAITING_DOTS="true" 36 | 37 | # Uncomment the following line if you want to disable marking untracked files 38 | # under VCS as dirty. This makes repository status check for large repositories 39 | # much, much faster. 40 | # DISABLE_UNTRACKED_FILES_DIRTY="true" 41 | 42 | # Uncomment the following line if you want to change the command execution time 43 | # stamp shown in the history command output. 44 | # The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" 45 | # HIST_STAMPS="mm/dd/yyyy" 46 | 47 | # Would you like to use another custom folder than $ZSH/custom? 48 | # ZSH_CUSTOM=/path/to/new-custom-folder 49 | 50 | # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) 51 | # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ 52 | # Example format: plugins=(rails git textmate ruby lighthouse) 53 | # Add wisely, as too many plugins slow down shell startup. 54 | plugins=(git) 55 | 56 | source $ZSH/oh-my-zsh.sh 57 | 58 | # User configuration 59 | 60 | # export MANPATH="/usr/local/man:$MANPATH" 61 | 62 | # You may need to manually set your language environment 63 | # export LANG=en_US.UTF-8 64 | 65 | # Preferred editor for local and remote sessions 66 | # if [[ -n $SSH_CONNECTION ]]; then 67 | # export EDITOR='vim' 68 | # else 69 | # export EDITOR='mvim' 70 | # fi 71 | 72 | # Compilation flags 73 | # export ARCHFLAGS="-arch x86_64" 74 | 75 | # ssh 76 | # export SSH_KEY_PATH="~/.ssh/rsa_id" 77 | 78 | # Set personal aliases, overriding those provided by oh-my-zsh libs, 79 | # plugins, and themes. Aliases can be placed here, though oh-my-zsh 80 | # users are encouraged to define aliases within the ZSH_CUSTOM folder. 81 | # For a full list of active aliases, run `alias`. 82 | # 83 | # Example aliases 84 | # alias zshconfig="mate ~/.zshrc" 85 | # alias ohmyzsh="mate ~/.oh-my-zsh" 86 | 87 | 88 | JAVA_HOME=/usr/program/jdk1.8.0_121 89 | JRE_HOME=$JAVA_HOME/jre 90 | PATH=$PATH:$JAVA_HOME/bin 91 | CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar 92 | export JAVA_HOME 93 | export JRE_HOME 94 | export PATH 95 | export CLASSPATH 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /images/Alfresco-Install-And-Settings-a-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Alfresco-Install-And-Settings-a-1.jpg -------------------------------------------------------------------------------- /images/Alfresco-Install-And-Settings-a-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Alfresco-Install-And-Settings-a-2.jpg -------------------------------------------------------------------------------- /images/Alfresco-Install-And-Settings-a-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Alfresco-Install-And-Settings-a-3.jpg -------------------------------------------------------------------------------- /images/Alfresco-Install-And-Settings-a-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Alfresco-Install-And-Settings-a-4.jpg -------------------------------------------------------------------------------- /images/CentOS-7-Install-a-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-7-Install-a-1.jpg -------------------------------------------------------------------------------- /images/CentOS-7-Install-a-10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-7-Install-a-10.jpg -------------------------------------------------------------------------------- /images/CentOS-7-Install-a-11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-7-Install-a-11.jpg -------------------------------------------------------------------------------- /images/CentOS-7-Install-a-12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-7-Install-a-12.jpg -------------------------------------------------------------------------------- /images/CentOS-7-Install-a-13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-7-Install-a-13.jpg -------------------------------------------------------------------------------- /images/CentOS-7-Install-a-14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-7-Install-a-14.jpg -------------------------------------------------------------------------------- /images/CentOS-7-Install-a-15.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-7-Install-a-15.jpg -------------------------------------------------------------------------------- /images/CentOS-7-Install-a-16.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-7-Install-a-16.jpg -------------------------------------------------------------------------------- /images/CentOS-7-Install-a-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-7-Install-a-2.jpg -------------------------------------------------------------------------------- /images/CentOS-7-Install-a-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-7-Install-a-3.jpg -------------------------------------------------------------------------------- /images/CentOS-7-Install-a-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-7-Install-a-4.jpg -------------------------------------------------------------------------------- /images/CentOS-7-Install-a-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-7-Install-a-5.jpg -------------------------------------------------------------------------------- /images/CentOS-7-Install-a-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-7-Install-a-6.jpg -------------------------------------------------------------------------------- /images/CentOS-7-Install-a-7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-7-Install-a-7.jpg -------------------------------------------------------------------------------- /images/CentOS-7-Install-a-8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-7-Install-a-8.jpg -------------------------------------------------------------------------------- /images/CentOS-7-Install-a-9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-7-Install-a-9.jpg -------------------------------------------------------------------------------- /images/CentOS-Extra-Packages-a-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Extra-Packages-a-1.jpg -------------------------------------------------------------------------------- /images/CentOS-Extra-Packages-a-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Extra-Packages-a-2.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-a-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-a-1.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-a-12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-a-12.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-a-13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-a-13.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-a-14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-a-14.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-a-15.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-a-15.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-a-16.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-a-16.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-a-17.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-a-17.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-a-18.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-a-18.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-a-19.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-a-19.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-a-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-a-2.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-a-20.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-a-20.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-a-21.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-a-21.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-a-22.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-a-22.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-a-23.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-a-23.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-a-24.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-a-24.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-a-25.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-a-25.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-a-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-a-3.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-a-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-a-4.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-a-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-a-5.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-a-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-a-6.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-a-7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-a-7.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-a-8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-a-8.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-a-9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-a-9.jpg -------------------------------------------------------------------------------- /images/CentOS-Install-VirtualBox-b-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Install-VirtualBox-b-1.gif -------------------------------------------------------------------------------- /images/CentOS-Network-Settings-a-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Network-Settings-a-1.jpg -------------------------------------------------------------------------------- /images/CentOS-Network-Settings-a-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Network-Settings-a-2.jpg -------------------------------------------------------------------------------- /images/CentOS-Virtual-Machine-Copy-Settings-a-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-Virtual-Machine-Copy-Settings-a-1.png -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-1.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-10.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-11.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-12.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-13.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-14.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-15.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-15.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-16.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-16.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-17.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-17.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-18.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-18.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-19.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-19.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-2.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-20.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-20.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-21.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-21.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-22.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-22.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-23.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-23.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-24.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-24.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-25.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-25.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-3.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-4.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-5.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-6.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-7.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-8.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-a-9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-a-9.jpg -------------------------------------------------------------------------------- /images/CentOS-install-VMware-b-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-b-1.gif -------------------------------------------------------------------------------- /images/CentOS-install-VMware-b-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS-install-VMware-b-2.gif -------------------------------------------------------------------------------- /images/CentOS6-and-CentOS7-a-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/CentOS6-and-CentOS7-a-1.png -------------------------------------------------------------------------------- /images/Crontab-a-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Crontab-a-1.jpg -------------------------------------------------------------------------------- /images/FTP-a-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/FTP-a-1.jpg -------------------------------------------------------------------------------- /images/FastDFS-a-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/FastDFS-a-1.jpg -------------------------------------------------------------------------------- /images/Iptables-a-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Iptables-a-1.jpg -------------------------------------------------------------------------------- /images/Jira-Install-And-Settings-a-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Jira-Install-And-Settings-a-1.jpg -------------------------------------------------------------------------------- /images/Jira-Install-And-Settings-a-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Jira-Install-And-Settings-a-2.jpg -------------------------------------------------------------------------------- /images/Jira-Install-And-Settings-a-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Jira-Install-And-Settings-a-3.jpg -------------------------------------------------------------------------------- /images/Jira-Install-And-Settings-a-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Jira-Install-And-Settings-a-4.jpg -------------------------------------------------------------------------------- /images/Jira-Install-And-Settings-a-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Jira-Install-And-Settings-a-5.jpg -------------------------------------------------------------------------------- /images/Jira-Install-And-Settings-a-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Jira-Install-And-Settings-a-6.jpg -------------------------------------------------------------------------------- /images/Ldap-Install-And-Settings-a-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Ldap-Install-And-Settings-a-1.png -------------------------------------------------------------------------------- /images/NTP-a-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/NTP-a-1.jpg -------------------------------------------------------------------------------- /images/Nexus-Install-And-Settings-a-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Nexus-Install-And-Settings-a-1.jpg -------------------------------------------------------------------------------- /images/Nexus-Install-And-Settings-a-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Nexus-Install-And-Settings-a-2.gif -------------------------------------------------------------------------------- /images/Openfire-Settings-a-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Openfire-Settings-a-1.jpg -------------------------------------------------------------------------------- /images/Openfire-Settings-a-10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Openfire-Settings-a-10.jpg -------------------------------------------------------------------------------- /images/Openfire-Settings-a-11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Openfire-Settings-a-11.jpg -------------------------------------------------------------------------------- /images/Openfire-Settings-a-12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Openfire-Settings-a-12.jpg -------------------------------------------------------------------------------- /images/Openfire-Settings-a-13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Openfire-Settings-a-13.jpg -------------------------------------------------------------------------------- /images/Openfire-Settings-a-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Openfire-Settings-a-2.jpg -------------------------------------------------------------------------------- /images/Openfire-Settings-a-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Openfire-Settings-a-3.jpg -------------------------------------------------------------------------------- /images/Openfire-Settings-a-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Openfire-Settings-a-4.jpg -------------------------------------------------------------------------------- /images/Openfire-Settings-a-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Openfire-Settings-a-5.jpg -------------------------------------------------------------------------------- /images/Openfire-Settings-a-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Openfire-Settings-a-6.jpg -------------------------------------------------------------------------------- /images/Openfire-Settings-a-7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Openfire-Settings-a-7.jpg -------------------------------------------------------------------------------- /images/Openfire-Settings-a-8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Openfire-Settings-a-8.jpg -------------------------------------------------------------------------------- /images/Openfire-Settings-a-9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Openfire-Settings-a-9.jpg -------------------------------------------------------------------------------- /images/RabbitMQ-Add-User-a-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/RabbitMQ-Add-User-a-1.jpg -------------------------------------------------------------------------------- /images/RabbitMQ-Add-User-a-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/RabbitMQ-Add-User-a-2.jpg -------------------------------------------------------------------------------- /images/RabbitMQ-Add-User-a-3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/RabbitMQ-Add-User-a-3.gif -------------------------------------------------------------------------------- /images/RabbitMQ-Bindings-Queue-a-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/RabbitMQ-Bindings-Queue-a-1.gif -------------------------------------------------------------------------------- /images/Redis-GUI-a-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Redis-GUI-a-1.jpg -------------------------------------------------------------------------------- /images/SVN-Install-And-Settings-a-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/SVN-Install-And-Settings-a-1.jpg -------------------------------------------------------------------------------- /images/SVN-Install-And-Settings-a-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/SVN-Install-And-Settings-a-2.jpg -------------------------------------------------------------------------------- /images/SVN-Install-And-Settings-a-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/SVN-Install-And-Settings-a-3.jpg -------------------------------------------------------------------------------- /images/SVN-Install-And-Settings-a-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/SVN-Install-And-Settings-a-4.jpg -------------------------------------------------------------------------------- /images/Ubuntu-a-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Ubuntu-a-1.jpg -------------------------------------------------------------------------------- /images/Ubuntu-a-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Ubuntu-a-2.jpg -------------------------------------------------------------------------------- /images/Ubuntu-a-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Ubuntu-a-3.jpg -------------------------------------------------------------------------------- /images/Ubuntu-a-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Ubuntu-a-4.jpg -------------------------------------------------------------------------------- /images/Ubuntu-a-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Ubuntu-a-5.jpg -------------------------------------------------------------------------------- /images/Ubuntu-a-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Ubuntu-a-6.jpg -------------------------------------------------------------------------------- /images/Vim-Cut-And-Paste-a-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Vim-Cut-And-Paste-a-1.png -------------------------------------------------------------------------------- /images/Zsh-a-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Zsh-a-1.jpg -------------------------------------------------------------------------------- /images/Zsh-b-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Zsh-b-1.jpg -------------------------------------------------------------------------------- /images/Zsh-c-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Zsh-c-1.jpg -------------------------------------------------------------------------------- /images/Zsh-d-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dhcbox/Linux-Tutorial/abc5cdea0b871d6fa66de68320de266bfe44e2a7/images/Zsh-d-1.jpg -------------------------------------------------------------------------------- /maintenance.md: -------------------------------------------------------------------------------- 1 | # 常见日常维护 2 | 3 | 4 | 5 | ## Vim 编辑文件报:Swap file "Hello.java.swp" already exists! 6 | 7 | - 问题原因: 8 | - Vim 编辑 Hello.java 文件的时候,非正常退出,然后又重新再 Vim 这个文件一般都会提示这个。 9 | - 解决办法: 10 | - 进入被编辑的文件目录,比如:Hello.java 我放在 /opt 目录下,那就先:`cd /opt`, 11 | - 然后:`ls -A`,会发现有一个:.Hello.java.swp,把这个文件删除掉:`rm -rf .Hello.java.swp`,然后重新 Vim 文件即可。 12 | 13 | 14 | -------------------------------------------------------------------------------- /other.md: -------------------------------------------------------------------------------- 1 | # Linux-Tutorial 2 | 3 | 在线常见命令整理: 4 | http://man.linuxde.net 5 | https://www.centos.bz/linux-basic-knowledge/ 6 | http://itlab.idcquan.com/linux/special/linuxcom/Index.html 7 | http://ganquan.info/linux/ 8 | http://wiki.open.qq.com/wiki/faq/linux……BB%A4 9 | http://i.linuxtoy.org/files/pdf/fwunixref.pdf 10 | http://waterlab.whu.edu.cn/hpc/upload/2010/6/LinuxCommand.pdf 11 | http://www.linux265.com/download/linux_cmd.pdf 12 | 13 | CHM文件常用命令整理: 14 | http://www.centoscn.com/CentosSoft/pdf/2013/0413/277.html 15 | 16 | 常见快捷键(在Ubuntu桌面上,常按win键也可以调用出系统快捷键目录列表说明): 17 | http://blog.csdn.net/xiaojianpitt/article/details/7393058 18 | http://www.ubuntukylin.com/ask/index.php?qa=jc_4 19 | 20 | 不错的ubuntu社区,可以在上面找资料和问题: 21 | http://www.wikihow.com/Category:Ubuntu 22 | 23 | 源列表推荐: 24 | http://wiki.ubuntu.org.cn/Qref/Source 25 | http://www.zhihu.com/question/19816319 26 | -------------------------------------------------------------------------------- /ubuntu-settings/Network-Settings.md: -------------------------------------------------------------------------------- 1 | # Ubuntu 网络相关设置问题 2 | 3 | 4 | ## 网络配置 5 | 6 | 7 | - 现在大家默认家里都是有路由器来着,所以如果只是为了联网,基本这些都不需要配置,直接插上网线一般就可以用了。 比较特殊的可能就是有的家里没路由器,而且还是 PPPOE 拨号上网的,那这个也有对应的设置可以参考: 8 | - 9 | - 10 | - 11 | - 12 | - 上面四篇文章讲了很多方法,我个人平时是喜好用进入DOS的图形界面进行设置方式,命令:`sudo pppoeconf` 13 | - 如果你在 Ubuntu 网络连接的时候出现这种情况:未找到合法的活动链接 可以编辑 **/etc/NetworkManager/NetworkManager.conf**,把文件里的 `managed=false` 改成 `managed=true`,重启电脑后应该就可以了。 14 | - 具体可以看: 15 | - 如果你是某个高校的学生,学校联网有自己的独立客户端的话,那你就关注下是否有linux系统的客户端了,这里我就帮不上了。 16 | - 你有可能跟我一样还需要不时穿越,通用设置VPN的方法我也准备好了,你只要根据下面图片设置即可,但是需要注意的是,配置好后,最好重启电脑,不然可能没办法连接上,这点很重要。 17 | 18 | 19 | ## 设置局域网静态 IP(固定 IP) 20 | 21 | - 我目前有一台 Windows,一台 Ubuntu,Ubuntu 有时候是直接在 Windows 上直接 SSH 连接上去的,所以如果自动分配 IP 的话就比较麻烦。 22 | - 编辑配置文件:`sudo vim /etc/network/interfaces` 23 | - 配置文件内容中,部分信息改为如下: 24 | 25 | ``` nginx 26 | auto eth0 27 | # iface eth0 inet dhcp 28 | # 注释上面默认配置的 DHCP 设置,改为下面这个 static 29 | iface eth0 inet static 30 | address 192.168.1.103 # IP 地址 31 | netmask 255.255.255.0 # 子网掩码 32 | gateway 192.168.1.1 # 网关 33 | ``` 34 | 35 | 36 | ## 设置DNS服务器 37 | 38 | - 编辑配置文件:`sudo vim /etc/resolvconf/resolv.conf.d/base` 39 | - 如果里面没内容,则新增下面两个:(我是广州电信,这两个 DNS 是我根据 360 安全卫士 DNS 优选功能自动筛选出来的,每个地区的人得到结果可能都不一样) 40 | ``` nginx 41 | nameserver 123.125.81.6 42 | nameserver 8.8.8.8 43 | ``` 44 | - 更新 resolv.conf 文件:`sudo resolvconf -u` 45 | - 重启服务:`sudo /etc/init.d/networking restart`,如果重启服务没效果那就重启系统试试看。 46 | 47 | 48 | ## 配置 VPN(作为开发者经常用): 49 | 50 | - ![Ubuntu VPN 配置](../images/Ubuntu-a-3.jpg) 51 | - ![Ubuntu VPN 配置](../images/Ubuntu-a-4.jpg) 52 | - ![Ubuntu VPN 配置](../images/Ubuntu-a-5.jpg) 53 | - ![Ubuntu VPN 配置](../images/Ubuntu-a-6.jpg) 54 | 55 | 56 | ## 其他常见问题 57 | 58 | - 如果你的 Ubuntu 设置固定 IP 后网络图标消失且无法查看 IP:`sudo vim /etc/NetworkManager/NetworkManager.conf` 59 | - 修改该值为:`managed=true` (原值为 false) 60 | 61 | 62 | ## 资料: 63 | 64 | - 65 | - 66 | 67 | 68 | -------------------------------------------------------------------------------- /ubuntu-settings/Ubuntu-Create-Desktop.md: -------------------------------------------------------------------------------- 1 | # Ubuntu 给 Dash 添加程序图标 2 | 3 | ## 创建图标文件 4 | 5 | - 我们建设以创建 Eclipse 程序图标为例 6 | - 进入图标存放目录|:`cd /usr/share/applications` 7 | - 创建文件并编辑:`sudo gedit eclipse.desktop` 8 | ``` ini 9 | [Desktop Entry] 10 | Name=eclipse 11 | Name[zh_CN]=eclipse 12 | Comment=eclipse Client 13 | Exec=/usr/programa/tools/eclipse/eclipse 14 | Icon=/usr/programa/tools/eclipse/icon.xpm 15 | Terminal=false 16 | Type=Application 17 | Categories=Application; 18 | Encoding=UTF-8 19 | StartupNotify=true 20 | ``` 21 | - 重点参数说明(注意:路径使用完整路径) 22 | - Name 为你想要显示在 Launcher 中的名称 23 | - Comment 为说明。 24 | - Exec 为程序执行位置 25 | - Icon 为图标所在路径 26 | - 最后,打开 Dash,在顶部搜索框搜索 **eclipse**,此时你应该能搜到它,先单击试一下看能不能打开,如果可以打开,拖到该图标启动器上,下次就可以直接从启动器打开了 27 | 28 | ## 资料 29 | 30 | - 图文资料: 31 | - 图文资料: 32 | - 图文资料: 33 | -------------------------------------------------------------------------------- /ubuntu-settings/Ubuntu-Extra-Packages.md: -------------------------------------------------------------------------------- 1 | # Ubuntu 源设置 2 | 3 | 4 | ## 介绍 5 | 6 | - 简单地讲:修改资源源地址主要是为了加快下载速度,默认的资源源地址在是境外,速度肯定没有境内速度快。 7 | - 了解源这东西: 8 | - 文章的重点是页面最下面,每个版本的源地址都是不一样的,所以要懂得替换对应的版本英文名称,各个版本的英文名称大家自己找下,然后进行修改。 9 | 10 | 11 | ## 修改源 12 | 13 | - 国内常用源配置方法: 14 | - 163 源: 15 | - 阿里源: 16 | - sohu: 17 | - 替换过程(更换之前最好备份一下 sources.list 配置文件): 18 | - 我以 Ubuntu 14.04 为例,使用网易源: 19 | - 备份下:`sudo cp /etc/apt/sources.list /etc/apt/sources_20151128_back.list` 20 | - 用 gedit 编辑器打开配置文件:`sudo gedit /etc/apt/sources.list`,替换里面所有内容为下面这些内容: 21 | ``` ini 22 | deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse 23 | deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse 24 | deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse 25 | deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse 26 | deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse 27 | deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse 28 | deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse 29 | deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse 30 | deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse 31 | deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse 32 | ``` 33 | - 更换源之后,需要在终端中执行:`sudo apt-get update`,这是必须做的,不然你后面可能会遇到 apt-get 安装会提示:未发现软件包。 34 | -------------------------------------------------------------------------------- /ubuntu-settings/Ubuntu-Popular-Settings.md: -------------------------------------------------------------------------------- 1 | # Ubuntu 常用的设置 2 | 3 | 4 | 5 | 右键桌面设置中有一个“开启工作区“这个类似虚拟桌面,可以有多个桌面,工作的时候很有用。 6 | 7 | 桌面右键设置唤醒和黑屏之后唤醒不需要输入密码,既然是平时的开发机,那就没啥多大隐私,而且是在自己家里, 设置密码太麻烦了。 8 | 9 | 10 | 改变鼠标图标大小,小了我看着不爽,下面三个文章是我找的,但是都不适合我: 11 | 我最终的方式是:安装 dconf-tools 12 | 安装后好,编辑这个文件,命令:gedit ~/ .Xresources 13 | 在打开的文件中添加这句话:Xcursor.size:48,其中48是文字大小,默认系统是24的大小,然后重启电脑即可。 14 | 15 | 16 | 17 | 查看隐藏文件和目录:按 Ctrl+H 18 | http://jingyan.baidu.com/article/49711c61415945fa441b7c89.html 19 | 20 | 21 | 22 | Ubuntu使用root账号登录图形界面,必须先给root设置密码,并解锁: 23 | 设置密码:sudo passwd root 24 | 解锁:sudo passwd -u root 25 | 锁住:sudo passwd -l root 26 | 解锁之后,修改这个配置文件,命令:vi /etc/lightdm/lightdm.conf,最后添加一行:greeter-show-manual-login=true (这一行表示可以输入用户名的方式登录账号),重启电脑,登录界面就有一个可以输入用户名的输入框,直接输入root,再输入密码。 27 | 28 | 29 | 30 | 不输入密码执行sudo命令方法介绍: 31 | http://www.nenew.net/nopasswd-exec-sudo-sudoers.html 32 | http://blog.xuite.net/chingwei/blog/38359401……A2%BC(需要穿越) 33 | 34 | 35 | -------------------------------------------------------------------------------- /ubuntu-settings/ubuntu-settings-toc.md: -------------------------------------------------------------------------------- 1 | - [Ubuntu 网络相关设置问题](Network-Settings.md) 2 | - [Ubuntu 源设置](Ubuntu-Extra-Packages.md) 3 | - [Ubuntu 给 Dash 添加程序图标](Ubuntu-Create-Desktop.md) 4 | - [Ubuntu 常用设置](Ubuntu-Popular-Settings.md) 5 | - []() 6 | - []() 7 | - []() 8 | - []() 9 | - []() 10 | - []() 11 | - []() 12 | 13 | 14 | 15 | --------------------------------------------------------------------------------