omnibus-gitlab与系统默认nginx的强行融合
只需从/var/opt/gitlab/nginx/conf/nginx.conf
中提取关键配置,插入到系统nginx.conf
之中。
将/etc/gitlab/gitlab.rb
中的nginx['enable']
禁用,unicorn['enable']
启用。
sudo gitlab-ctl reconfigure
只需从/var/opt/gitlab/nginx/conf/nginx.conf
中提取关键配置,插入到系统nginx.conf
之中。
将/etc/gitlab/gitlab.rb
中的nginx['enable']
禁用,unicorn['enable']
启用。
sudo gitlab-ctl reconfigure
iptables -L -n
Check /etc/sysconfig/iptables
and edit the rules, then restart the iptable service to make it work.
service iptables restart
See /usr/local/apache-tomcat/conf/server.xml
ps aux | grep nginx
/usr/local/nginx/conf/nginx.conf
listen 8080 default_server;
listen [::]:8080 default_server ipv6only=on;
error adding listener addr=/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket
chown git gitlab.socket
adding listener failed addr=127.0.0.1:8080 (in use)
gitlab-ctl tail unicorn
systemctl unmask firewalld
systemctl start firewalld
systemctl status firewalld
sudo firewall-cmd –permanent –add-service=http
# gitlab socket 文件地址 upstream gitlab { server unix://var/opt/gitlab/gitlab-rails/sockets/gitlab.socket; } server { listen *:8080; server_name gitlab.semprathlon.net; # server_tokens off; # don't show the version number, a security best practice root /opt/gitlab/embedded/service/gitlab-rails/public; # Increase this if you want to upload large attachments # Or if you want to accept large git objects over http client_max_body_size 250m; # individual nginx logs for this gitlab vhost access_log /var/log/gitlab/nginx/gitlab_access.log; error_log /var/log/gitlab/nginx/gitlab_error.log; location / { # serve static files from defined root folder;. # @gitlab is a named location for the upstream fallback, see below try_files $uri $uri/index.html $uri.html @gitlab; } # if a file, which is not found in the root folder is requested, # then the proxy pass the request to the upsteam (gitlab unicorn) location @gitlab { # If you use https make sure you disable gzip compression # to be safe against BREACH attack proxy_read_timeout 300; # Some requests take more than 30 seconds. proxy_connect_timeout 300; # Some requests take more than 30 seconds. proxy_redirect off; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Frame-Options SAMEORIGIN; proxy_pass http://gitlab; } # Enable gzip compression as per rails guide: http://guides.rubyonrails.org/asset_pipeline.html#gzip-compression # WARNING: If you are using relative urls do remove the block below # See config/application.rb under "Relative url support" for the list of # other files that need to be changed for relative url support location ~ ^/(assets)/ { root /opt/gitlab/embedded/service/gitlab-rails/public; # gzip_static on; # to serve pre-gzipped version expires max; add_header Cache-Control public; } error_page 502 /502.html; }
gitlab-ctl tail
gitlab.socket permission denied
sudo usermod -aG gitlab-www git
http://www.doocr.com/articles/58b1599ee21ae505cb93a717
chgrp -R gitlab-www /var/opt/gitlab/gitlab-rails
chown -R www /var/opt/gitlab/gitlab-rails
https://askubuntu.com/questions/210210/pkg-config-path-environment-variable
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
sudo ldconfig
在前证书过期一周有余,期末考试完成之后,新的SSL免费证书总算申请上了。
WoSign竟然早已关闭了免费证书申请。这次是向腾讯云申请到的。
在企业型的大型网关设备上常见Unix操作系统,TTL=255.
在个人型的小型路由器、交换机上常见Linux操作系统,TTL=63.
通过端口扫描可得到目标主机上开放的端口、运行的服务,进而推断操作系统。
ssh常用端口为22,telnet常用端口为23.
Switch Ubuntu apt-get source
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
sudo nano /etc/apt/sources.list
Be aware to choose the corresponding version.
deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
uname -a
SET PASSWORD FOR ‘user-name-here‘@’hostname-name-here’ = PASSWORD(‘new-password-here’);
sudo apt-get install php5-curl
错误信息:通过端口 1433 连接到主机 localhost 的 TCP/IP 连接失败。错误:“connect timed out。请验证连接属性。确保 SQL Server 的实例正在主机上运行,且在此端口接受 TCP/IP 连接,还要确保防火墙没有阻止到此端口的 TCP 连接。”。
重要前提:
检查错误:
打开Sql Server Configuration Manager
,选中左栏SQL Server网络配置
=>< 服务名>的协议
,双击TCP/IP以弹出对话框。
特别注意最下方IPAll项的端口设置。
按图设置,重启SQL Server服务后生效。
telnet 127.0.0.1 1433
可供测试端口。
Ubuntu查看运行中的进程及其id、监听端口
sudo netstat -anp
查询进程id
pidof
安全终止某个进程
kill -15
后台运行某个进程
nohup&
内存空间不足的临时解决办法
How To Create A Swap File In Linux
linux下由于内存不足造成的 virtual memory exhausted: Cannot allocate memory, qt **.o文件 file not found
为了从http跳转到https网址,在本站点根目录的.htaccess
中增加一条转向规则:RewriteCond %{SERVER_PORT} ^80$ RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]