Change gitlab repository location - gitlab

I'm running Gitlab 8.9.4 CE Omnibus on Ubuntu server 14.04 a DigitalOcean droplet with a block storage volume formatted and mounted at /mnt/volume-fra1-01-part1 I have created a subdirectory git-data (0755 git:git) on the volume and I want Gitlab to use that as its git repository location.
I have followed the instructions here to update the Ruby variable, but changing it and running gitlab-ctl reconfigure has no effect. My /etc/gitlab/gitlab.rb file looks like this:
external_url "<my URL here>"
git_data_dirs({"default" => "/mnt/volume-fra1-01-part1/git-data"})
gitlab_rails['lfs_enabled'] = true
gitlab_rails['lfs_storage_path'] = "/mnt/volume-fra1-01-part1/gitlab-lfs-objects"
The git LFS settings work OK, so it definitely reads the config file.
Any ideas what I might have missed?

I had a similar case just recently. I am using Ubuntu server 16.04 LTS and my hard-driver is mounted under /mnt/sdb.
sudo gitlab-ctl reconfigure gave me permission error.
I used the following command and it fixed the issue:
sudo chmod 755 /mnt/sdb
Here are the complete steps:
sudo gedit /etc/gitlab/gitlab.rb -> git_data_dirs({"default" => "/mnt/sdb/gitlab/git-data"})
sudo chmod 755 /mnt/sdb
sudo gitlab-ctl reconfigure
sudo gitlab-ctl stop
sudo rsync -av /var/opt/gitlab/git-data/repositories /mnt/sdb/gitlab/git-data/
sudo gitlab-ctl upgrade
sudo ls -l /mnt/sdb/gitlab/git-data/
sudo gitlab-ctl start
Hope that helps.

Related

Setting wordpress in a VM with ubuntu

Some time ago a friend of mine configured me a VM Ubuntu built to allow me construct a Wordpress site through SSH... given some technical issues I had to delete the VM and Im trying to remake one, I already know how to set the wordpress through SSH but not how to configure the VM so It can LET me do it (I tried making one but it doesnt have the same folders like WWW inside /var)
I guess you're trying to deploy wordpress on a LAMP stack.
There are some prerequisites:
open your terminal and
run this commands to install the server:
sudo apt-get update && apt-get upgrade
​sudo apt-get install lamp-server^
run this commands to install php:
sudo apt-get install php7.0 php7.0-mysql libapache2-mod-php7.0 php7.0-cli php7.0-cgi php7.0-gd
Then you have to create a database like this:
CREATE DATABASE wpdb;
​GRANT ALL PRIVILEGES ON wpdb.* TO 'USERNAME'#'localhost' IDENTIFIED BY 'ADMIN_PASSWORD';
​FLUSH PRIVILEGES;
​EXIT;
and finally get and install wordpress:
wget -c http://wordpress.org/latest.tar.gz
​​tar -xzvf latest.tar.gz
sudo mv wordpress /var/www/html
sudo chown -R www-data:www-data /var/www/html/wordpress
​ sudo chmod -R 755 /var/www/html/wordpress
and rename the config file
cd /var/www/html/wordpress
​ sudo mv wp-config-sample.php wp-config.php
restart the server:
sudo systemctl restart apache2.service
​ sudo systemctl restart mysql.service
and voila', wordpress is ready to be served

Install Jenkins in specific folder in RHEL

When we install jenkins, by default it installs at /var/lib directory in the RHEL machine. But I want to install jenkins in other folder or filesystem. for example /jenkins.
Before installing jenkins I changed JENKINS_HOME=/jenkins and tried installing jenkins but it wont work.
These are the steps which I followed to install Jenkins
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install jenkins
But the result is same it installs in /var/lib.
How can I install in /jenkins directory this?
Edit the /etc/sysconfig/jenkins file and change:
JENKINS_HOME = /var/lib/jenkins
to
JENKINS_HOME = /jenkins
and restart Jenkins.

How to uninstall gitlab from local ubuntu 14.04 server

Can you please help me to uninstall gitlab. i deleted the /home/gitlab but it still open up when i browse to my hostname.
Thank you.
This worked on ubuntu 16.04
sudo apt-get remove gitlab-ce
sudo rm -rf /var/opt/gitlab
--kill all process live
sudo pkill -f gitlab
-- Remove paths
sudo rm -rf /opt/gitlab
sudo rm -rf /etc/gitlab
rm -rf /var/opt/gitlab
Stop the gitlab service. Try doing.
sudo apt-get remove gitlab-ce
Then remove gitlab files from the system. Some files are in /etc directory.
Have a look at the official documentation.
uninstall Gitlab:
1- Stop the gitlab service
Command : sudo gitlab-ctl stop
2- Start commonde of service facility
command : sudo gitlab-ctl uninstall
3- Delete the package of gitlab
command : Locat gitlab
4- restart machine

How to Install Gitlab on Centos 6.6 VPS?

I tried installing as mentioned here: https://about.gitlab.com/downloads/
sudo yum install openssh-server
sudo yum install postfix
sudo yum install cronie
sudo service postfix start
sudo chkconfig postfix on
sudo lokkit -s http -s ssh
curl -O https://downloads-packages.s3.amazonaws.com/centos-6.6/gitlab-7.7.2_omnibus.5.4.2.ci-1.el6.x86_64.rpm
sudo rpm -i gitlab-7.7.2_omnibus.5.4.2.ci-1.el6.x86_64.rpm
sudo gitlab-ctl reconfigure
It looks like everything went successfully, but but I don't get anything on my hostname. Is there anything I missed?
GitLab will try to setup the FQDN by using the hostname of your machine. To do this manually, open /etc/gitlab/gitlab.rb and edit the external url according to the documentation, which by the way if you haven't already read, I suggest that you do it!

cannot connect to fresh installed gitlab 7.0 on CentOS 6.5

When i try to connect with ssh to the fresh installed gitlab he ask for a password. the http is working aswel the webinterface.
I have already added the rsa key to gitlab but it looks like the openssh server not use the gitlab authorized_keys file.
Gitlab version 7.0
installed fresh CentOS 6.5 and followed this commands:
wget https://downloads-packages.s3.amazonaws.com/centos-6.5/gitlab-7.0.0_omnibus-1.el6.x86_64.rpm
sudo yum install openssh-server
sudo yum install postfix # Select 'Internet Site', using sendmail or exim is also OK
sudo rpm -i gitlab-7.0.0_omnibus-1.el6.x86_64.rpm
sudo -e /etc/gitlab/gitlab.rb
(added my hostname)
sudo gitlab-ctl reconfigure
sudo lokkit -s http -s ssh
I had the same issue on GitLab 7 omnibus on CentOS 6.5: after a fresh install, when I git push git#.... it was asking for a password. I fixed it by changing the permissions on .ssh folder and .ssh/authorized_keys:
yum install policycoreutils-python -y
chmod 700 /var/opt/gitlab/.ssh/
chmod 600 /var/opt/gitlab/.ssh/authorized_keys
semanage fcontext -a -t ssh_home_t "/var/opt/gitlab/.ssh"
semanage fcontext -a -t ssh_home_t "/var/opt/gitlab/.ssh/authorized_keys"
restorecon -R -v /var/opt/gitlab/.ssh/
You will probably need policycoreutils-python package to run semanage. Install it with yum if needed !

Resources