centos 32位下安装gitlab
来源:互联网 发布:windows资源管理器 编辑:程序博客网 时间:2024/06/08 13:50
目前系统的环境
centos6.4 32位
已经安装mysql nginx下载并安装GPG key
wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 https://www.fedoraproject.org/static/0608B895.txtrpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6检验下是否安装成功
rpm -qa gpg*安装epel-release-6-8.noarch包
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpmPS.不要在意x86_64(64位),在i686(32位)的机器上一样能使用
增加PUIAS安装源
vi /etc/yum.repos.d/PUIAS_6_computational.repo添加如下内容:
[PUIAS_6_computational]name=PUIAS computational Base $releasever - $basearchmirrorlist=http://puias.math.ias.edu/data/puias/computational/$releasever/$basearch/mirrorlist#baseurl=http://puias.math.ias.edu/data/puias/computational/$releasever/$basearchgpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puias下载并安装GPG key
wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-puias http://springdale.math.ias.edu/data/puias/6/x86_64/os/RPM-GPG-KEY-puiasrpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-puias安装GitLab的所需依赖包和工具
su -yum -y groupinstall 'Development Tools'yum -y install vim-enhanced readline readline-devel ncurses-devel gdbm-devel glibc-devel tcl-devel openssl-devel curl-devel expat-devel db4-devel byacc sqlite-devel gcc-c++ libyaml libyaml-devel libffi libffi-devel libxml2 libxml2-devel libxslt libxslt-devel libicu libicu-devel system-config-firewall-tui python-devel redis sudo wget crontabs logwatch logrotate perl-Time-HiRes git配置redis
chkconfig redis onservice redis start安装Ruby
su -mkdir /tmp/ruby && cd /tmp/rubycurl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.3/ruby-2.3.0.tar.gz| tar xzcd ruby-2.3.0./configure --prefix=/usr/local/make && make installPS.安装完成后,重新登录终端确保$PATH生效,检测ruby的安装成功与否:
ruby -v安装bundle
gem install bundler --no-ri --no-rdoc创建用户git
adduser --system --shell /bin/bash --comment 'GitLab' --create-home --home-dir /home/git/ gitPS.因为git用户不需要登录,所以这里不需要设置git的密码
下载gitlab shell
https://github.com/gitlabhq/gitlab-shell/tree/v2.7.2
我这里用游览器下载的然后传到服务器上,然后修改权限chmod -R 777 /home/git/gitlab-shell也可以用git下载,但是比较慢
su - gitgit clone https://github.com/gitlabhq/gitlab-shell.gitcd gitlab-shellgit checkout v3.4.0我这里安装的是2.7.2
配置gitlab shell
cd gitlab-shellcp config.yml.example config.yml这里最重要的是将gitlab_url修改成gitlab的访问域名。比如:http://git.phpsong.com/
修改hosts
vi /etc/hosts添加
127.0.0.1 git.phpsong.com安装一些需要的目录和文件
./bin/install安装GitLab
下载地址
https://github.com/gitlabhq/gitlabhq/tree/7-14-stable
我这里用游览器下载的然后传到服务器上,然后修改权限chmod -R 777 /home/git/gitlab也可以用git下载,但是比较慢
su - gitgit clone https://github.com/gitlabhq/gitlabhq.git gitlabcd /home/git/gitlabgit checkout 7-14-stable配置项目
cd /home/git/gitlabcp config/gitlab.yml.example config/gitlab.ymlsed -i 's|localhost|git.phpsong.com|g' config/gitlab.ymlsu -cd /home/git/gitlabchown -R git log/chown -R git tmp/chmod -R u+rwX log/chmod -R u+rwX tmp/chmod -R u+rwX tmp/pids/chmod -R u+rwX tmp/sockets/chmod -R u+rwX public/uploadssu - gitmkdir /home/git/gitlab-satellitescd /home/git/gitlabcp config/unicorn.rb.example config/unicorn.rb配置数据库访问文件
cp config/database.yml.mysql config/database.ymlvi config/database.yml比如我的配置
## PRODUCTION#production: adapter: mysql2 encoding: utf8 collation: utf8_general_ci reconnect: false database: gitlabhq_production pool: 10 username: root password: "123456" # host: localhost # socket: /tmp/mysql.sockPS.MySQL的引擎必须是Innodb,myisam的安装会失败,可以用mysql命令show engines查看
安装Gems
su -gem install charlock_holmes初始化数据和激活高级功能
PS.修改gitlab目录下的Gemfile和Gemfile.lock问首行的域名rubygems.org修改成ruby.taobao.org,修改之后执行名的命令就会比较快
su - gitcd /home/git/gitlab/bundle install --deployment --without development test postgres puma awsbundle exec rake gitlab:setup RAILS_ENV=productionPS.安装的时候出现如下错误
解决方法
安装nodejs http://www.phpsong.com/2117.html
执行gem install execjsgem install therubyracer安装成功之后会显示用户名和密码
login………root
password……5iveL!fe
在执行下面的命令,不然没有样式bundle exec rake assets:precompile RAILS_ENV=production安装启动脚本
su -wget -O /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlab-recipes/master/init/sysvinit/centos/gitlab-unicornchmod +x /etc/init.d/gitlabchkconfig --add gitlab#开机时启动chkconfig gitlab on启动GitLab实例
service gitlab startnginx配置
su -cp /home/git/gitlab/lib/support/nginx/gitlab /usr/local/nginx/conf/vhost/git.phpsong.com.conf修改一下里面的配置
vi /usr/local/nginx/conf/vhost/git.phpsong.com.confmkdir /var/log/nginx里面的内容主要修改端口和域名,如我下面的配置
# listen 0.0.0.0:80 default_server;# listen [::]:80 default_server;listen 80;server_name git.phpsong.com; ## Replace this with something like gitlab.example.com检查一下nginx配置nginx -t我这里的nginx是www的用户启动
ps aux|grep nginx将www加入git用户组
usermod -a -G git wwwPS. 如果查看/var/log/nginx/gitlab_error.log发现错误connect() to unix:/home/git/gitlab/tmp/sockets/gitlab-workhorse.socket failed错误
解决方法
vi /usr/local/nginx/conf/vhost/git.phpsong.com.conf把修改成
upstream gitlab-workhorse {# server unix:/home/git/gitlab/tmp/sockets/gitlab-workhorse.socket fail_timeout=0; server unix:/home/git/gitlab/tmp/sockets/gitlab.socket fail_timeout=0;}重要错误日志文件
/home/git/gitlab/log/unicorn.stderr.log/var/log/nginx/gitlab_error.log参考网址: http://my.oschina.net/wzlee/blog/262181
- centos 32位下安装gitlab
- centos下安装gitlab
- Centos下安装GitLab
- 32位系统ubuntu下安装gitlab
- centos下gitlab安装过程和问题
- 关于Centos 7下安装gitlab服务
- Centos安装gitlab安装
- CentOS 6安装Gitlab
- CentOS下一键安装GitLab
- CentOS上安装gitlab
- CentOS上安装GitLab
- centOS 7安装 gitLab
- Centos 安装gitlab
- CentOS安装GitLab
- CentOS 7 安装 Gitlab
- CentOS安装GitLab
- Centos 7 安装 GitLab
- CentOS 7 安装GitLab
- Eclipse实现Android混淆打包注意事项
- kibana一个最简单的过滤
- scala的Stack类源码
- kibana运行的时候找不到node命令
- Unity3D中的自动寻路
- centos 32位下安装gitlab
- spring+hibernate 大批量处理数据
- 读取联系人信息
- 产品经理主观题/群面答法小记
- supervisor 一句话安装
- ViewPager的几种动画效果源代码
- [BZOJ2927][Poi1999]多边形之战(博弈)
- 用JS获取URL的方法(超级简单)
- 设计模式(五)——原型模式