试了下cd等简单命令都无法跑...那问题肯定出在字符格式上
vim xxx.sh
#按ECS键和冒号
:set ff //查看当前脚本格式,一般会显示是DOS格式的
:set ff=unix //设置unix格式就好了
完事
Remember me to one who lives there
试了下cd等简单命令都无法跑...那问题肯定出在字符格式上
vim xxx.sh
#按ECS键和冒号
:set ff //查看当前脚本格式,一般会显示是DOS格式的
:set ff=unix //设置unix格式就好了
完事
系统:centos7.5
1.安装
yum -y install epel-release
yum -y install goaccess
2.配置文件
vi ./goaccessrc
#加入以下内容
time-format %T
date-format %d/%b/%Y
log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u"
3.生成结果html
goaccess -f /logs/nginx.log -a -p ~/.goaccessrc > /usr/local/nginx/html/index.html
#以上为例子
因为想用ansible tower了...但3.2版本至少要ansible2+
前提:python2.6以上
1.首先备份原来的主机配置文件
cp /etc/ansible/hosts ~/hosts
2.卸载ansible
pip uninstall ansible #因为我是pip安装的
#brew安装的参考如下卸载办法
#brew update
#brew uninstall ansible19
#brew uninstall ansible
#brew cleanup -s
#brew install ansible
3.安装最新版本
因为懒...还是走yum吧
yum -y update
yum -y install ansible
ansible --version
cp ~/hosts /etc/ansible/
#完成
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 104.16.0.0/12;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2405:8100::/32;
set_real_ip_from 2c0f:f248::/32;
set_real_ip_from 2a06:98c0::/29;
# use any of the following two
real_ip_header CF-Connecting-IP;
#real_ip_header X-Forwarded-For;
其他的连接:https://support.cloudflare.com/hc/en-us/sections/200805497-Restoring-Visitor-IPs
本文将安装gitlab并且对其汉化和一些配置的修改。
往常一样交代下版本
gitlab:11.2.3
centos:7.5
gitlab下载
yum -y install policycoreutils-python
firewall-cmd --permanent --add-service=http
systemctl reload firewalld
#防火墙放行http
wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-11.2.3-ce.0.el7.x86_64.rpm/download.rpm
#下载gitlab的rpm包
rpm -ivh gitlab-ce-11.2.3-ce.0.el7.x86_64.rpm
yum -y install git
#汉化
git clone https://gitlab.com/xhang/gitlab.git
cd gitlab
#停止
git diff v11.2.3 v11.2.3-zh > ../v11.2.3-zh.diff
gitlab-ctl stop
patch -d /opt/gitlab/embedded/service/gitlab-rails -p1 < ../v11.2.3-zh.diff
#这一步可能会出一些报错,直接无视就好 一路回车
gitlab-ctl start
gitlab-ctl reconfigure
基本配置
vi /etc/gitlab/gitlab.rb
#需要修改的行数为13,911
external_url 'http://gitlab.domain.com' #域名,也可以写IP地址
nginx['client_max_body_size'] = '2048m' #上传限制大小
gitlab-ctl reconfigure
邮件配置
vi /etc/gitlab/gitlab.rb
#附邮件配置,行数为53,626,627,472-480。一般服务器25端口没法用,所以建议使用465端口发
gitlab_rails['gitlab_email_from'] = "gitlab@domain.com"
user['git_user_name'] = "GitLab"
user['git_user_email'] = "gitlab@domain.com"
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.exmail.qq.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "gitlab@domain.com"
gitlab_rails['smtp_password'] = "123456"
gitlab_rails['smtp_domain'] = "domain.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
#smtp_tls一定要注意配置,否则无法通过465端口发送邮件
gitlab-ctl reconfigure
设置密码,用root用户名+你刚刚设置的密码登录gitlab
然后如图进行设置,这里设置的是上传的大小限制,建议和配置文件中的一样
创建一个test项目,然后通过git上传,如图
git config --global user.name "Administrator" #自己的姓名,commit代码的时候用到
git config --global user.email "mail address" #自己的邮箱,commit代码的时候用到