git 邮箱服务配置 配置邮箱服务的用途 有合并请求时,邮件通知 账号注册时,邮件验证 修改密码时,通过邮件修改 配置步骤: 1.开启QQ邮箱的smtp服务(不建议使用163邮箱,发几次之后,就不能发送) 设置–》账户–》smtp–》密保验证–》验证成功返回一串字符串,形状如(ausdixersybgcgid) 保存返回的字符串 2.修改gitlab配置 vim /etc/gitlab/gitlab.rb 按/后输入smtp_enable,找到下面这一串文本,进行修改 gitlab_rails[‘smtp_enable’] = true gitlab_rails[‘smtp_address’] = “smtp.qq.com” gitlab_rails[‘smtp_port’] = 465 gitlab_rails[‘smtp_user_name’] = “879602389@qq.com” gitlab_rails[‘smtp_password’] = “开通smtp时返回的字符” gitlab_rails[‘smtp_domain’] = “qq.com” gitlab_rails[‘smtp_authentication’] = “login” gitlab_rails[‘smtp_enable_starttls_auto’] = true gitlab_rails[‘smtp_tls’] = true user[‘git_user_email’] = “879602389@qq.com” gitlab_rails[‘gitlab_email_from’] = ‘879602389@qq.com’ 按esc退出到命令行模式 之后:wq 保存并退出 gitlab-ctl reconfigure 3.测试邮件服务是否正常 gitlab-rails console Notify.test_email(‘接收方邮件地址’,’邮件标题’,’邮件内容’).deliver_now 按回车,测试发送。
-
来自分类:Uncategorized
-
#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } stream { upstream cloudsocket { hash $remote_addr consistent; # $binary_remote_addr; server 124.71.176.19:3307 weight=5 max_fails=3 fail_timeout=300s; } server { listen 3306; proxy_pass cloudsocket; } upstream redis { server 180.169.20.15:6380 max_fails=3 fail_timeout=30s; } server { listen 6379; proxy_connect_timeout 1s; proxy_timeout 3s; proxy_pass redis; } } http { include mime.types; default_type application/octet-stream; #log_format main ‘$remote_addr – $remote_user [$time_local] “$request” ‘ # ‘$status $body_bytes_sent “$http_referer” ‘ # ‘”$http_user_agent” “$http_x_forwarded_for”‘; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; } location /ftppic { alias /home/ftp_dir; } location /eden { proxy_redirect off; proxy_pass http://192.168.0.162:8085; proxy_set_header Host $host:$server_port; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Cookie $http_cookie; proxy_connect_timeout 10; proxy_read_timeout 600s; proxy_send_timeout 600s; } #error_page 404 /404.html; # redirect server error pages……
来自分类:Uncategorized -
防火墙配置列子:
来自分类:Uncategorized -
1、Nginx的负载分发策略 Nginx 的 upstream目前支持的分配算法: 1)、轮询 ——1:1 轮流处理请求(默认) 每个请求按时间顺序逐一分配到不同的应用服务器,如果应用服务器down掉,自动剔除,剩下的继续轮询。 upstream tomcatserver1 { server 192.168.72.49:8080; server 192.168.72.49:8081; } 2)、权重 ——you can you up 通过配置权重,指定轮询几率,权重和访问比率成正比,用于应用服务器性能不均的情况。 upstream tomcatserver1 { server 192.168.72.49:8080 weight=3; server 192.168.72.49:8081; } 3)、ip_哈希算法 每个请求按访问ip的hash(ip_hash)结果分配,这样每个访客固定访问一个应用服务器,可以解决session共享的问题。 upstream tomcatserver1 { server 192.168.72.49:8080 ; server 192.168.72.49:8081; ip_hash; } 4)、fair(第三方) 按后端服务器的相应时间来分配请求,相应时间越短的优先分配。 upstream tomcatserver1 { server 192.168.72.49:8080 ; server 192.168.72.49:8081; fair; } 5)、url_hash(第三方) 按访问url的hash结果来分配请求,使每个url定向到同一个后端服务器。 upstream tomcatserver1 { server 192.168.72.49:8080 ; server 192.168.72.49:8081; hash $request_uri; hash_method crc32; } 配置Nginx的负载均衡与分发策略 通过在upstream参数中添加的应用服务器IP后添加指定参数即可实现,如: server { listen 80; server_name 8080.max.com; #charset koi8-r; #access_log logs/host.access.log main; location / { proxy_pass http://tomcatserver1; index index.html index.htm; } }
来自分类:Uncategorized