Jenkins Amazon Linux Setup - linux

I have setup jenkins on my ec2 instance using the below steps from a tutorial online. I am novice in linux environment and deployments. My problem is that the jenkins dashboard is not showing up in browser at <myIp>:8080/jenkins. Can someone help me out for this.
sudo yum install -y docker nginx git
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
sudo vim /etc/nginx/nginx.conf
Change as below
server {
listen 80;
server_name _;
location /jenkins {
proxy_pass http://127.0.0.1:8080;
}
}
sudo usermod -a -G docker jenkins
sudo service docker start
sudo service jenkins start
sudo service nginx start
sudo chkconfig docker on
sudo chkconfig jenkins on
sudo chkconfig nginx on

I had faced similar problem before, you can check following:
Check security groups of the instance for specific ports
Check IP tables on the instance
Hope that helps

Related

Jenkins installation on Ubuntu using Vagrant - NO HTTP access

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.

Publish Asp.net Core 3.1 Web Api on Azure Linux Ubuntu 18.04 VM

I am trying to publish the application on Azure Linux Ubuntu 18.04 VM. i configure step mention below step on VM but i am facing 404 url Not Found issue.
The requested URL was not found on this server.
Apache/2.4.29 (Ubuntu) Server at myipaddress Port 80 error
I have only simple WeatheForeCast web api controller which is default in asp.net core web api 3.1
I have followed below commands by connecting VM
sudo -i
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-3.1
sudo apt-get install aspnetcore-runtime-3.1
sudo apt-get install dotnet-runtime-3.1
sudo apt-get install apache2
systemctl restart apache2
a2enmod proxy proxy_http proxy_html proxy_wstunnel
sudo a2enmod rewrite
vi /etc/apache2/conf-enabled/webapplication4.conf
<VirtualHost *:80>
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:5000/
ProxyPassReverse / http://127.0.0.1:5000/
ErrorLog /var/log/apache2/webapplication4-error.log
CustomLog /var/log/apache2/webapplication4-access.log common
</VirtualHost>
cat /etc/apache2/conf-enabled/webapplication4.conf
vi /etc/apache2/conf-enabled/webapplication4.conf
cat /etc/apache2/conf-enabled/webapplication4.conf
systemctl restart apache2
sudo chmod 777 /etc/apache2/conf-enabled/webapplication4.conf
cd /var/
mkdir WebApi
cd WebApi
i have published webapi with folder option
With netcoreapp3.0 as Target Framework and Framework-Dependent as Deployment Mode
Selected linux-x64 as Target Runtime, as we want to host our application in Linux environment
and tranfer file using winscp software and Copied file using below command
cp -R * /var/WebApi/
vi /etc/systemd/system/kestrel-webapplication4.service
[Unit]
Description=Aspnet Core Web Api running on Ubuntu 18.04
[Service]
WorkingDirectory=/var/WebApi
ExecStart=/usr/bin/dotnet /var/WebApi/webapplication4.dll
Restart=always
RestartSec=10
SyslogIdentifier=dotnet-demo
User=www-data
Environment=ASPNETCORE_ENVIRONMENT=Production
[Install]
WantedBy=multi-user.target
sudo systemctl enable /etc/systemd/system/kestrel-webapplication4.service
sudo systemctl start kestrel-webapplication4.service
http://MyIpaddress/WeatherForeCast it shows 404 url not found. Apache/2.4.29 (Ubuntu) Server at MyIpaddress Port 80

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

Why both Jenkins and GitLab are not opening in browser when they are in the same server?

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

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!

Resources