# sudo chmod +x python.SlackBuild # sudo ./python.SlackBuild # sudo installpkg python
# sudo chmod +x ruby.SlackBuild # sudo ./ruby.SlackBuild # sudo installpkg ruby
# mkdir /tmp/ruby && cd /tmp/ruby # curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p353.tar.gz | tar xz # cd ruby-2.0.0-p353 ./configure --prefix=/usr/local/ make sudo make install
# which ruby # ruby --version # bundler, gem install bundler --no-ri --no-rdoc
# cd /tmp # mkdir redis cd redis # wget http://download.redis.io/redis-stable.tar.gz tar xvzf redis-stable.tar.gz cd redis-stable # make # cd src sudo cp redis-server /usr/local/bin/ sudo cp redis-cli /usr/local/bin/
# sudo nano /etc/local.conf # [components] /usr/local/bin/redis-server
# redis-cli ping # PONG
# cd /tmp && curl --progress https://git-core.googlecode.com/files/git-1.9.0.tar.gz | tar xz # cd git-1.9.0/ # make prefix=/usr/local all # git sudo make prefix=/usr/local install
sudo /usr/sbin/adduser --disabled-login git
# git cd /home/git # sudo -u git -H git clone https://github.com/gitlabhq/gitlab-shell.git cd gitlab-shell # VERSION , v1.9.0 sudo -u git -H git checkout VERSION # sudo -u git -H cp config.yml.example config.yml # nano config.yml # #gitlab_url: "http://localhost/" # http://localhost/ # git sudo -u git -H ./bin/install
-- USER_PASSWORD CREATE USER 'gitlab'@'localhost' IDENTIFIED BY 'USER_PASSWORD'; CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`; GRANT SELECT, LOCK TABLES, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost';
-- gitlab_tables.sql - source gitlab_tables.sql;
# git cd /home/git # gitlab gitlab sudo -u git -H git clone https://github.com/gitlabhq/gitlabhq.git gitlab cd /home/git/gitlab # VERSION , 7-2-stable sudo -u git -H git checkout VERSION # sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml # sudo -u git -H nano config/gitlab.yml # localhost ## Web server settings host: localhost port: 80 https: false # sudo -u git cp config/database.yml.mysql config/database.yml # gitlab mysql sudo -u git -H nano config/database.yml # , mysql database: gitlabhq_production username: root password: "secure password"
cd /home/git/gitlab sudo chown -R git log/ sudo chown -R git tmp/ sudo chmod -R u+rwX log/ sudo chmod -R u+rwX tmp/ sudo -u git -H mkdir /home/git/gitlab-satellites sudo -u git -H mkdir tmp/pids/ sudo -u git -H mkdir tmp/sockets/ sudo chmod -R u+rwX tmp/pids/ sudo chmod -R u+rwX tmp/sockets/ sudo -u git -H mkdir public/uploads sudo chmod -R u+rwX public/uploads sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb sudo -u git -H git config --global user.name "GitLab" sudo -u git -H git config --global user.email "gitlab@localhost" sudo -u git -H git config --global core.autocrlf input sudo -u git -H chmod o-rwx config/database.yml
# gitlab git cd /home/git/gitlab # charlock_holmes, 0.7.3 sudo gem install charlock_holmes --version '0.7.3' # ( , ) sudo -u git -H bundle install --deployment --without development test postgres aws
# root - , , # - 'yes' sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production
Administrator account created: login.........root password......5iveL!fe
# gitlab sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production # , , # sudo cp lib/support/init.d/gitlab /etc/init.d/gitlab # sudo chmod +x /etc/init.d/gitlab # local.conf: sudo nano /etc/local.conf # [components] git@/etc/init.d/gitlab #git -
sudo -u git -H /etc/init.d/gitlab start
The GitLab Unicorn web server with pid 15869 is running. The GitLab Sidekiq job dispatcher with pid 16468 is running. GitLab and all its components are up and running.
# lynx lynx localhost:8080
<VirtualHost *:80> ServerName OUR_COOL_URL ServerSignature Off ProxyPreserveHost On # Ensure that encoded slashes are not decoded but left in their encoded state. AllowEncodedSlashes Off <Location /gitlab> Order deny,allow Allow from all ProxyPassReverse http://127.0.0.1:8080 ProxyPassReverse http://OUR_COOL_URL/ </Location> # apache equivalent of nginx try files RewriteEngine on RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule .* http://127.0.0.1:8080%{REQUEST_URI} [P,QSA] # needed for downloading attachments DocumentRoot /home/git/gitlab/public Alias /gitlab /home/git/gitlab/public <Directory /home/git/gitlab/public> Options All -Indexes AllowOverride All Order deny,allow Allow from all </Directory> <Directory /home/git/gitlab/public/assets> Options All -Indexes AllowOverride All Order deny,allow Allow from all </Directory> LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common_forwarded ErrorLog /var/log/httpd/gitlab_error.log LogLevel warn CustomLog /var/log/httpd/gitlab_access.log combined env=!dontlog CustomLog /var/log/httpd/gitlab combined </VirtualHost>
# repos_path: "/home/gitlab/repositories" # auth_file: "/home/gitlab/.ssh/authorized_keys" # log_file: "/home/gitlab/gitlab-shell/gitlab-shell.log"
/home/git/gitlab/config/gitlab.teatro.yml: email_from: example@localhost /home/git/gitlab/config/gitlab.teatro.yml: support_email: example@localhost /home/git/gitlab/config/gitlab.yml: email_from: example@localhost /home/git/gitlab/db/fixtures/development/01_admin.rb: s.email = "example@localhost" /home/git/gitlab/db/fixtures/production/001_admin.rb: email: "example@localhost"
# sudo /sbin/pkgtool # View ruby ( "r") # which ruby which rake which gem # , 99% , pkgtool # boot gitlab sudo -u git -H nano config/boot.yml # require 'rubygems', RIGHT_PATH_TO_GEM_FROM_WHICH_RESULT # which gem ENV['GEM_PATH'] = "RIGHT_PATH_TO_GEM_FROM_WHICH_RESULT" Gem.clear_paths
# config gitlab-shell cd /home/git/gitlab-shell && sudo -u git -H nano config.yml # # Redis settings used for pushing commit notices to gitlab redis: bin: /usr/local/redis-cli # bin redis-cli
Source: https://habr.com/ru/post/235591/