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 !
Related
I've been trying to install Jenkins on ubuntu using Vagrant. Even though I am not getting any errors along the way I am not able to open http://localhost:8080
Here's my steps:
Install Vagrant and Virtual Box on MAC
Create a folder for the vagrant
vagrant init bento/ubuntu-16.04
nano Vagrantfile - delete the hasztag from the port forwarding to 8080
Vagrant up
Vagrant ssh
Install git:
Sudo apt-get install git
Git --version
Installing Java:
sudo apt update
Sudo apt-get upgrade
sudo apt install default-jdk
sudo apt install default-jre
Install Jenkins:
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get install -y jenkins --allow-unauthenticated
To check the password: vi /var/log/jenkins/jenkins.log
To start Jenkins: systemctl start jenkins
systemctl status jenkins
When I start the jenkins server I can do telnet 127.0.0.1 8080 but when I turn it off it doesn't work. Any idea why I cannot access GUI using the browser?
Try in ubuntu to do "curl http://localhost:8080" , if response is not some error code page, like 4xx/5xx, check firewall and allow traffic on port 8080. Therefore try to access Jenkins from Host Machine.
Make sure you don't have a service running on port 8080 on your guest machine.
On my Linux server, Jenkins was already installed, and I tried to install GitLab on same server, with following commands:
sudo yum install -y curl policycoreutils-python openssh-server cronie
sudo lokkit -s http -s ssh
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
sudo EXTERNAL_URL="http://gitlab.fabcd.com" yum -y install gitlab-ee
It says that GitLab is now installed, but when i open the URL in browser, its not opening and also my Jenkins URL isn't working.
Please help me rollback this GitLab installation as I don't want to mess with my Jenkins.
Both servers exposed in port 8080.
You should change one of it to be different port.
To set the GitLab port, edit the file /etc/gitlab/gitlab.rb
external_port "8888"
Then run reconfigure:
gitlab-ctl reconfigure
I am writing a script where I should install MySQL on my Centos hard disk when I run it.
I downloaded the following :
mysql-apt-config_0.8.5-1_all.deb
But I don't figure out how to install it from the shell script.
I am new to Linux and any help is appreciated !!
Since Centos is yum package manager just run the following commands to install MySql
If you are using Centos 7, you need to first add the repository as follows
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum update
To install MySql on Centos, we run
sudo yum install mysql-server
sudo systemctl start mysqld
Note: .deb files are only used for Debian based Linux Distros. Centos uses .rpm files.
Try to save following command in a shell file(extension with .sh) and run with sudo.
#!/bin/bash**strong text**
export http_proxy= $Write proxy
export https_proxy= $ write proxy
sudo -E yum -y update
sudo -E yum -y install wget
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
sudo -E yum -y update
sudo -E yum -y install mysql-server
sudo systemctl start mysqld
sleep 1s
mysql -u root <<-EOF
UPDATE mysql.user SET Password=PASSWORD('123') WHERE User='root';
DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');
DELETE FROM mysql.user WHERE User='';
DELETE FROM mysql.db WHERE Db='test' OR Db='test_%';
FLUSH PRIVILEGES;
EOF
I installed Nginx 1.8 (compiled from source) on Debian 7:
cd /opt/
sudo wget http://nginx.org/download/nginx-1.8.0.tar.gz
sudo wget http://labs.frickle.com/files/ngx_cache_purge-2.3.tar.gz
sudo tar -zxvf nginx-1.8.0.tar.gz
sudo tar -zxzf ngx_cache_purge-2.3.tar.gz
cd /opt/nginx-1.8.0/
sudo ./configure --prefix=/opt/nginx --user=nginx --group=nginx --with-http_ssl_module --with-ipv6 --add-module=/tmp/ngx_cache_purge-2.3
sudo make && make install
sudo adduser --system --no-create-home --disabled-login --disabled-password --group nginx
sudo wget -O init-deb.sh http://www.linode.com/docs/assets/1538-init-deb.sh
sudo mv init-deb.sh /etc/init.d/nginx
sudo chmod +x /etc/init.d/nginx
sudo /usr/sbin/update-rc.d -f nginx defaults
Than I start nginx with the following command:
sudo /etc/init.d/nginx start
And everything works fine until now.
The problem is when I try to install HHVM it doesn't work:
sudo wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add -
sudo echo deb http://dl.hhvm.com/debian wheezy main | sudo tee /etc/apt/sources.list.d/hhvm.list
sudo apt-get update
sudo apt-get install hhvm libgmp-dev libmemcached-dev
sudo update-rc.d hhvm defaults
And when I finally run:
sudo /usr/share/hhvm/install_fastcgi.sh
I get the following error:
Checking if Nginx is installed
Nginx not found
Any thoughts how I can install HHVM with Nginx compiled from source?
You're going to have to read the script and apply its patch manually. It's hardcoded to work with the distro-supplied nginx, and assumes that it's installed in that location -- since the deb we provide for Debian sticks a particular script in the nginx system configuration anyways. Your manually built nginx is in a different location; the script would have no way of knowing where to find it!
Here's the source for the install_fastcgi.sh -- the relevant bit is that it inserts a line after server_name to include hhvm.conf. You can find that hhvm.conf either here or it's probably already on your system at /etc/nginx/hhvm.conf.
BTW, the script really isn't that complicated. In general, a good way to figure out why something broke is to skim through it and see what it's doing :)
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!