thinkphp5 获取config怎么获取 CONTROLLER

Ubuntu 14.04下安装GitLab指南 - 博客频道 - CSDN.NET
get_set的专栏
一只想做程序猿的咨询汪
分类:【打怪升级】Linux
转载:http://my.oschina.net/u/160089/blog/421168
GitLab 是一个用于仓库管理系统的开源项目。使用Git作为代码管理工具,并在此基础上搭建起来的web服务。 在GitLab的官方网站上面对Ubuntu的支持也是很好的,有比较详尽的安装指南。 在介绍postfix的地方有少部分的坑,本文抛砖引玉,解决一些我遇到的坑。 本文主要针对Ubuntu 14.04,介绍如何安装GitLab。其他的Ubuntu可以作为一个参考。
1.安装需要的库和软件
更多详细的请参考官方的下载地址,里面有安装的介绍。 你也可以什么都不管直接执行下面的命令。需要注意的就是安装postfix的时候,需要进行一些选择 简单来说,就是postfix就是用来发送邮件的,由于需要发送验证邮件,所以这个是需要装的,至于具体装什么来发送邮件是可选的,这里选择了官方推荐的postfix,也许会坑比较少吧。 我觉得如果是postfix来配置SMTP服务器比较复杂,我这里就不做介绍了,你可以参照其他的资料。 我为了更方便的把邮件发出去,直接使用了企业邮箱的邮件服务,只需要设置smtp服务器就行了。
sudo apt-get
curl openssh- ca-certificates postfix
2. 添加GitLab的包并进行安装
curl https://packages.gitlab./install/repositories/gitlab/gitlab-/script.. | sudo bash
sudo apt-get install gitlab-
你可以使用上面的方法来进行安装,但是中国大陆的网速估计会比较蛋疼。我把我下载的一个Ubuntu 64位的版本放在百度云上面了。不知道是否可以下载。 gitlab-ce_7.10.5~omnibus-1_amd64.deb百度云下载地址:&
下载了之后:
sudo dpkg - gitlab-ce_7.10.5~omnibus-1_amd64.deb
3. 配置和启动GitLab
sudo vim /etc/gitlab/gitlab.rb
上面是一些我的配置信息。希望对你有帮助。下面的图片是官方给的文档。 (上面的邮箱需要根据你自己邮箱来确定,更多的可以抄Gmail的例子。)&&配置完成之后,需要执行下面的命令使得变更生效。
sudo gitlab-ctl reconfigure
有时候你还需要重启postfix。(可选)
sudo /etc/.d/ restart
4. 访问GitLab
这样你就可以通过访问:&&来进行GitLab的访问了。
默认管理员的账户密码:
Username: root
Password: 5iveL!fe
5. 参考资料(很重要的都是放在最后)
&GitLab安装篇-Ubuntu 14.04 LTS&GitLab官网安装指南&GitLab中的SMTP服务器设置的例子&postfix的基础介绍和新手指南
排名:千里之外
(7)(2)(10)(0)(2)(0)(12)(3)(2)(1)Linux系统下安装Gitlab
GitLab是利用 Ruby on Rails 一个开源的版本管理系统,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目。它拥有与Github类似的功能,能够浏览源代码,管理缺陷和注释。可以管理团队对仓库的访问,它非常易于浏览提交过的版本并提供一个文件历史库。团队成员可以利用内置的简单聊天程序(Wall)进行交流。它还提供一个代码片段收集功能可以轻松实现代码复用,便于日后有需要的时候进行查找。
1)apt-get方式
curl -s /install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bashsudo apt-get install gitlab-cesudo gitlab-ctl reconfigure
2)deb包方式
wget /gitlab/gitlab-ce//pool/trusty/main/g/gitlab-ce/gitlab-ce_8.3.4-ce.0_amd64.debdpkg -i gitlab-ce_8.3.4-ce.0_amd64.debsudo gitlab-ctl reconfigure
Ubuntu 14.04下安装GitLab指南&&
如何在Ubuntu Server 14.04下安装Gitlab中文版&&
源码安装GitLab汉化版&&
在 Ubuntu 12.04 上安装 GitLab&
GitLab 5.3 升级注意事项&
在 CentOS 上部署 GitLab (自托管的Git项目仓库)&
在RHEL6/CentOS6/ScientificLinux6上安装GitLab 6.0.2&
CentOS 6.5安装GitLab教程及相关问题解决&
GitLab 的详细介绍:GitLab 的下载地址:
本文永久更新链接地址:
阅读(...) 评论()requirement & version
14.04 List
1.4.6install更新环境
apt-get update -y
apt-get upgrade -y
sudo apt-get install -y vim
sudo update-alternatives –set editor /usr/bin/vim.basic
sudo apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev curl openssh-server redis-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev logrotate python-docutils pkg-config cmake nodejsInstall Gitsudo apt-get install -y git-coreInstall postfix fro mailsudo apt-get install -y postfixInstall Ruby
mkdir /tmp/ruby && cd /tmp/ruby
curl -L –progress http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.6.tar.gz | tar xz
cd ruby-2.1.6
./configure –disable-install-rdoc
sudo make installInstall the Bundler Gem:由于无法翻墙,这里不能按找官方文档安装,需要把源指向淘宝的源
gem sources –remove https://rubygems.org/
gem sources -a https://ruby.taobao.org/
gem sources -l
sudo gem install bundler –no-ri –no-rdocCreate a git user for GitLab:
sudo adduser –disabled-login –gecos ‘GitLab’ gitInstall mysql
sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev
mysql -u root -p
CREATE USER
IDENTIFIED BY ‘$password’;
SET storage_engine=INNODB;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES ON gitlabhq_production.* TO ;
确认帐号可以登录及数据库建立完成
sudo -u git -H mysql -u git -p -D gitlabhq_production
/qInstall redis
sudo apt-get install redis-server
sudo cp /etc/redis/redis.conf /etc/redis/redis.conf.orig
sed ‘s/^port .*/port 0/’ /etc/redis/redis.conf.orig | sudo tee /etc/redis/redis.conf
echo ‘unixsocket /var/run/redis/redis.sock’ | sudo tee -a /etc/redis/redis.conf
echo ‘unixsocketperm 770’ | sudo tee -a /etc/redis/redis.conf
sudo mkdir /var/run/redis
sudo chown redis:redis /var/run/redis
sudo chmod 755 /var/run/redis
if [ -d /etc/tmpfiles.d ]; then
/var/run/redis
-’ | sudo tee -a /etc/tmpfiles.d/redis.conf
sudo service redis-server restart
sudo usermod -aG redis gitinstall gitlab (为了兼容已有的gitlab指定安装7.9 官方已出7-12)
cd /home/git
sudo -u git -H git clone /gitlab-org/gitlab-ce.git -b 7-9-stable gitlabConfigure It
cd /home/git/gitlab
sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml
sudo chown -R git log/
sudo chown -R git tmp/
sudo chmod -R u+rwX,go-w log/
sudo chmod -R u+rwX tmp/
sudo -u git -H mkdir /home/git/gitlab-satellites
sudo chmod u+rwx,g=rx,o-rwx /home/git/gitlab-satellites
sudo chmod -R u+rwX tmp/pids/
sudo chmod -R u+rwX tmp/sockets/
sudo chmod -R u+rwX
public/uploads
sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb
sudo -u git -H editor config/unicorn.rb
sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb
sudo -u git -H git config –global core.autocrlf input
sudo -u git -H cp config/resque.yml.example config/resque.ymlsudo -u git cp config/database.yml.mysql config/database.yml需要修改的 sudo -u git -H cp config/resque.yml.example config/resque.yml 配置 production: 下的3个属性host: git.carbit.loemail_from: _display_name: GitLabsudo -u git -H editor config/database.yml 配置 production: 下的1个属性password:你的数据库密码install
Gems由于无法翻墙,这里不能按找官方文档安装,需要把源指向淘宝的源
sudo vi /home/git/gitlab/Gemfile替换第一行source "https://ruby.taobao.org/"
sudo -u git -H bundle install –deployment –without development test postgres aws kerberosInstall GitLab Shell
sudo -u git -H bundle exec rake gitlab:shell:install[v2.6.3] REDIS_URL=unix:/var/run/redis/redis.sock RAILS_ENV=production
sudo -u git -H editor /home/git/gitlab-shell/config.yml配置 1个属性 你gitlab的域名 gitlab_url: http://git.carbit.lo/Initialize Database and Activate Advanced Features
sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=productionInstall Init Script
sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab
sudo cp lib/support/init.d/gitlab.default.example /etc/default/gitlab
sudo update-rc.d gitlab defaults 21
sudo cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlabCheck Application Status
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=productionCompile Assets
sudo -u git -H bundle exec rake assets:precompile RAILS_ENV=productionStart Your GitLab Instance
sudo service gitlab startinstall nginx
sudo apt-get install -y nginx
sudo cp lib/support/nginx/gitlab /etc/nginx/sites-available/gitlab
sudo ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlabedit nginx
sudo editor /etc/nginx/sites-available/gitlab
修改 一个属性server_name git.carbit.lo
sudo nginx -t
sudo service nginx restartdone访问你的域名 或者ip 使用初始密码登录 root 5iveL!fe原有gitlab数据迁移步骤mysql 数据迁移在原有gitlab服务器上
mysqldump -uroot -p
gitlabdb & gitlabdb.sql将 gitlabdb.sql 拷贝至新服务器/home/stat/app/
scp gitlabdb.sql :/home/stat/app/在新gitlab服务器上
mysql -uroot -p
/home/stat/app/gitlabdb.sql提交记录数据迁移将原服务器/home/git/repositories文件夹打包
tar -zcvf repositories.tar.gz
/home/git/repositories
将打包文件拷贝至新服务器解压到同名文件夹4 将 /home/git/.ssh/authorized_keys
拷贝至新服务器同名文件夹redis数据迁移停止新服务器redis服务将 /var/lib/redis/dump.rdb
拷贝至新服务器同名文件夹启动新服务器redis服务重启新服务器gitlab服务
无相关信息
最新教程周点击榜
微信扫一扫

我要回帖

更多关于 thinkphp5获取ip 的文章

 

随机推荐