If you install Postfix to send email please select ‘Internet Site’ during setup. Instead of using Postfix you can also use Sendmail or configure a custom SMTP server and configure it as an SMTP server.
On Centos 6 and 7, the commands below will also open HTTP and SSH access in the system firewall.
If you are not comfortable installing the repository through a piped script, you can find the entire script here and select and download the package manually and install using gitlab/gitlab-ce
On your first visit, you’ll be redirected to a password reset screen to provide the password for the initial administrator account. Enter your desired password and you’ll be redirected back to the login screen.
The default account’s username is root. Provide the password you created earlier and login. After login you can change the username if you wish.
# Remove private_token from the request URI # In: /foo?private_token=unfiltered&authenticity_token=unfiltered&rss_token=unfiltered&... # Out: /foo?private_token=[FILTERED]&authenticity_token=unfiltered&rss_token=unfiltered&... map$request_uri$temp_request_uri_1 { default$request_uri; ~(?i)^(?<start>.*)(?<temp>[\?&]private[\-_]token)=[^&]*(?<rest>.*)$ "$start$temp=[FILTERED]$rest"; } # Remove authenticity_token from the request URI # In: /foo?private_token=[FILTERED]&authenticity_token=unfiltered&rss_token=unfiltered&... # Out: /foo?private_token=[FILTERED]&authenticity_token=[FILTERED]&rss_token=unfiltered&... map$temp_request_uri_1$temp_request_uri_2 { default$temp_request_uri_1; ~(?i)^(?<start>.*)(?<temp>[\?&]authenticity[\-_]token)=[^&]*(?<rest>.*)$ "$start$temp=[FILTERED]$rest"; } # Remove rss_token from the request URI # In: /foo?private_token=[FILTERED]&authenticity_token=[FILTERED]&rss_token=unfiltered&... # Out: /foo?private_token=[FILTERED]&authenticity_token=[FILTERED]&rss_token=[FILTERED]&... map$temp_request_uri_2$filtered_request_uri { default$temp_request_uri_2; ~(?i)^(?<start>.*)(?<temp>[\?&]rss[\-_]token)=[^&]*(?<rest>.*)$ "$start$temp=[FILTERED]$rest"; } # A version of the referer without the query string map$http_referer$filtered_http_referer { default$http_referer; ~^(?<temp>.*)\? $temp; } }
gitlab preinstall: Automatically backing up only the GitLab SQL database (excluding everything else!) Dumping database ... Dumping PostgreSQL database gitlabhq_production ... pg_dump: [archiver (db)] connection to database "gitlabhq_production" failed: could not connect to server: 没有那个文件或目录 Is the server running locally and accepting connections on Unix domain socket "/var/opt/gitlab/postgresql/.s.PGSQL.5432"? Backup failed [FAILED] gitlab preinstall: gitlab preinstall: Backup failed! If you want to skip this backup, run the following command and gitlab preinstall: try again: gitlab preinstall: gitlab preinstall: sudo touch /etc/gitlab/skip-auto-migrations gitlab preinstall: error: %pre(gitlab-ce-8.15.2-ce.0.el6.x86_64) scriptlet failed, exit status 1 Error in PREIN scriptlet in rpm package gitlab-ce-8.15.2-ce.0.el6.x86_64 error: install: %pre scriptlet failed (2), skipping gitlab-ce-8.15.2-ce.0.el6 gitlab-ce-8.11.5-ce.0.el6.x86_64 was supposed to be removed but is not! Verifying : gitlab-ce-8.11.5-ce.0.el6.x86_64 1/2 Verifying : gitlab-ce-8.15.2-ce.0.el6.x86_64 2/2
... gitlab: Thank you for installing GitLab! gitlab: To configure and start GitLab, RUN THE FOLLOWING COMMAND:
sudo gitlab-ctl reconfigure
gitlab: GitLab should be reachable at http://114.55.148.71:8081 gitlab: Otherwise configure GitLab for your system by editing /etc/gitlab/gitlab.rb file gitlab: And running reconfigure again. gitlab: gitlab: For a comprehensive list of configuration options please see the Omnibus GitLab readme gitlab: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md gitlab:
gitlab: GitLab now ships with a newer version of PostgreSQL (9.6.1), and will be used gitlab: as the default in the next major relase. To upgrade, RUN THE FOLLOWING COMMANDS:
sudo gitlab-ctl pg-upgrade
gitlab: For more details, please see: gitlab: https://docs.gitlab.com/omnibus/settings/database.html#upgrade-packaged-postgresql-server gitlab: 清理 : gitlab-ce-8.11.5-ce.0.el6.x86_64 2/2 Found /etc/gitlab/skip-auto-migrations, exiting... Verifying : gitlab-ce-8.15.2-ce.0.el6.x86_64 1/2 Verifying : gitlab-ce-8.11.5-ce.0.el6.x86_64 2/2
chown -R root:root /usr/local/nginx/proxy_temp # 编辑 nginx.conf sudo vi /usr/local/nginx/conf/nginx.conf # 在第一行添加 user root;
webhooks 错误
错误显示不允许发送本地请求
1
Url is blocked: Requests to the local network are not allowed
解决方法,在设置中设置允许本地连接即可
admin => Settings => Outbound requests
服务无法启动
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
[root@localhost gitlab]# gitlab-ctl status fail: alertmanager: runsv not running fail: gitaly: runsv not running fail: gitlab-monitor: runsv not running fail: gitlab-workhorse: runsv not running fail: logrotate: runsv not running fail: nginx: runsv not running fail: node-exporter: runsv not running fail: postgres-exporter: runsv not running fail: postgresql: runsv not running fail: prometheus: runsv not running fail: redis: runsv not running fail: redis-exporter: runsv not running fail: sidekiq: runsv not running fail: unicorn: runsv not running
Connected to 192.168.188.114. 220 (vsFTPd 3.0.2) Name (192.168.188.114:kennywang): ftp 331 Please specify the password. Password: 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> ls 229 Entering Extended Passive Mode (|||47867|). 150 Here comes the directory listing. -rw-r--r-- 1 0 0 12 Jan 18 06:31 README.md drwxr-xr-x 2 0 0 6 Nov 05 19:43 pub 226 Directory send OK.
$ find ~ -name "*.txt" -print#在$HOME中查.txt文件并显示 $ find . -name "*.txt" -print $ find . -name "[A-Z]*" -print#查以大写字母开头的文件 $ find /etc -name "host*" -print#查以host开头的文件 # 查以两个小写字母和两个数字开头的txt文件 $ find . -name "[a-z][a-z][0–9][0–9].txt" -print $ ind . -perm 755 -print $ ind . -perm -007 -exec ls -l {} \; #查所有用户都可读写执行的文件同-perm 777 $ ind . -type d -print $ ind . ! -type d -print $ ind . -type l -print
ls
类似于dos下的dir命令
ls最常用的参数有三个: -a -l -F。
ls –a
Linux上的文件以.开头的文件被系统视为隐藏文件,仅用ls命令是看不到他们的,而用ls - a除了显示一般文件名外,连隐藏文件也会显示出来。 ls –l 该参数显示更详细的文件信息。 ls –F 使用这个参数表示在文件的后面多添加表示文件类型的符号,例如*表示可执行,/表示目录,@表示连结文件,这都是因为使用了-F这个参数。但是现在基本上所有的Linux发行版本的ls都已经内建了-F参数,也就是说,不用输入这个参数,我们也能看到各种分辨符号。
cd
用于切换用户当前工作目录
cd aaa 进入aaa目录 cd 命令后不指定目录,会切换到当前用户的home 目录 cd ~ 作用同cd后不指定目录,切换到当前用户的home 目录 cd - 命令后跟一个减号,则会退回到切换前的目录 cd .. 返回到当前目录下的上一级目录
grep是(global search regular expression(RE) and print out the line的缩写,用于从文件面搜索包含指定模式的行并打印出来,它是一种强大的文本搜索工具,支持使用正则表达式搜索文本。grep的工作方式是这样的,它在一个或多个文件中搜索字符串模板。如果模板包括空格,则必须被””引用,模板后的所有字符串被看作文件名。搜索结果送到屏幕,不影响原文件内容。
利用Linux所提供的管道符“|”将两个命令隔开,管道符左边命令的输出就会作为管道符右边命令的输入。连续使用管道意味着第一个命令的输出会作为第二个命令的输入,第二个命令的输出又会作为第三个命令的输入,依此类推。 注意:管道左边命令的输入作为管道右边命令的输入(命令的输入是一定的),不是参数,并不是所有命令都支持管道 例子:ls | grep a 查看当前目录下名称包含a的文件或文件夹
xargs
大多数 Linux 命令都会产生输出:文件列表、字符串列表等。但如果要使用其他某个命令并将前一个命令的输出作为参数该怎么办?例如,file 命令显示文件类型(可执行文件、ascii 文本等);你能处理输出,使其仅显示文件名,目前你希望将这些名称传递给 ls -l 命令以查看时间戳记。xargs 命令就是用来完成此项工作的。 注意:find命令把匹配到的文件传递给xargs命令,而xargs命令每次只获取一部分文件而不是全部,不像-exec选项那样。这样它可以先处理最先获取的一部分文件,然后是下一批,并如此继续下去