How to install wildcard SSL certificate in ubuntu AWS EC2 instance - amazon-ec2

Installed JITSI but unable to enable audio and video ...it throw an error saying SSL certificate is required. Can I get the exact steps to install SSL in ubuntu 16.04 instance in AWS EC2.

In ubuntu you can find the nginx conf file in the directory /etc/nginx/sites-available and you will find <your_domain>.conf file.
Edit the config file to point the SSL certificate
ssl_certificate /etc/ssl/<your_domain>.crt;
ssl_certificate_key /etc/ssl/<your_domain>.key;
More information on how to setup SSL certificate with Nginx: http://nginx.org/en/docs/http/configuring_https_servers.html

Install certbot, it will place correctly your certificates.
sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot --nginx
Jitsi only works if it have SSL.

Related

Error on install SSL in EC2 with Let's Encrypt

I'm pretty new on aws ec2, I'm trying to get a free ssl with Let's Encrypt. I've watched a video in youtube to learn it, but I have a problem, my terminal says sudo: add-apt-repository: command not found, always when I type the command add-apt-repository ppa:certbot/certbot
I'm using Amazon Linux AMI 2018.03.0 (HVM), is it the problem? If it is the problem, how can I fix it? Which command I need to use to install?
apt is the package manager for Debian-based Linux distros. Amazon Linux is CentOS/RHEL-based distro, it uses yum as package manager.
To install Let's Encrypt SSL certificate on Amazon Linux you can follow the step-by-step tutorial by AWS: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/SSL-on-amazon-linux-2.html#letsencrypt
You will have to import EPEL repository from Fedora (instead of PPA), then install Certbot from Let's Encrypt and issue an SSL certificate using Certbot.
Minimal command set for Amazon Linux:
sudo wget -r --no-parent -A 'epel-release-*.rpm' http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/
sudo rpm -Uvh dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-*.rpm
sudo yum-config-manager --enable epel*
sudo yum install -y certbot python2-certbot-apache
sudo certbot

Install ElasticSearch APM

I am trying to setup ElasticSearch APM, my OS is Ubuntu 16.04,
I installed ElasticSearch and Kibana on the system,
I am referring the following site for installation steps -
https://jee-appy.blogspot.com/2018/02/setup-kibana-elastisearch.html
The installation commands for ElasticSearch and Kibana are as follows-
# Install Elasticsearch-6
curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.0.1.tar.gz
echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list
sudo apt-get update && sudo apt-get install elasticsearch
ls /etc/init.d/elasticsearch
sudo service elasticsearch status
Change bind address and JVM heap option as per requirement
Change network.host to 0.0.0.0 in elasticsearch.yml and set -Xms 4g & -Xmx 4g in jvm.options
sudo vi /etc/elasticsearch/elasticsearch.yml
sudo vi /etc/elasticsearch/jvm.options
Setting read replicas to 0 if you are creating single node cluster
curl -XPUT H 'Content-Type: application/json' 'http://localhost:9200/_all/_settings?preserve_existing=false' -d '{"index.number_of_replicas" : "0"}'
Install Kibana
sudo apt-get update && sudo apt-get install kibana
sudo service kibana restart
Install nginx
sudo apt-get -y install nginx
Add nginx config file for kibana
sudo vi /etc/nginx/conf.d/kibana.conf
Replace mykibana.com with your server_name or IP. We will setup auth in next step, hence we have placed a line for auth_basic in kibana.conf
server {
listen 80;
server_name mykibana.com;
auth_basic "Restricted Access";
auth_basic_user_file /etc/nginx/htpasswd.users;
location / {
proxy_pass http://localhost:5601;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
Setup auth
After installing apache2-utils when you run htpasswd, it will ask for a password, provide a password. This username and password would be useful when you try to access kibana from browser.
sudo apt-get install apache2-utils
sudo htpasswd -c /etc/nginx/htpasswd.users efkadmin
sudo service nginx restart
Web view of Kibana
After successful Setup, hit http://localhost:5601. Put username and password and you will see kibana web as shown below.
APM setup
After installing ElasticSearch and Kibana,
I am trying to install APM server into it.
I used the following commands to install it -
curl -L -O https://artifacts.elastic.co/downloads/apm-server/apm-server-6.3.1-amd64.deb
sudo dpkg -i apm-server-6.3.1-amd64.deb
Import dashboard -
./apm-server setup
On firing the above command I get the following error -
bash: ./apm-server: No such file or directory
Please help to setup APM
If the command following command is executed sucessfully
> sudo dpkg -i apm-server-6.3.1-amd64.deb
The apm-server must have been installed.
You are trying to run apm-server by ./apm-server, where you specifying that the binary apm-server is present in current directory.
But that is not the case, by installing via dpkg cmd the package is installed somewhere in /usr directory.
So you just need to run apm-server -e cmd in the shell.
No need to add ./
If you get permission deniod error.
Run the command with sudo

Letsencrypt how to use --preferred-challenges

This command:
$ letsencrypt certonly --manual --preferred-challenges dns --email foo#bar.com --domains test001.bar.com
outputs:
letsencrypt: error: unrecognized arguments: --preferred-challenges dns
From the documentation here: https://certbot.eff.org/docs/using.html#certbot-command-line-options
I find:
--preferred-challenges PREF_CHALLS
A sorted, comma delimited list of the preferred
challenge to use during authorization with the most
preferred challenge listed first (Eg, "dns" or "tls-
sni-01,http,dns"). Not all plugins support all
challenges. See
https://certbot.eff.org/docs/using.html#plugins for
details. ACME Challenges are versioned, but if you
pick "http" rather than "http-01", Certbot will select
the latest version automatically. (default: [])
Why do I get this error?
Found the answer, although the website states that letsencrypt and certbot are the same. It seems to not be the case.
$ apt-get install letsencrypt
$ apt-get install python-pip
$ pip install --upgrade pip
$ pip install certbot
$ certbot certonly --manual --preferred-challenges dns --email foo#bar.com --domains test001.bar.com
Does the trick

Hadoop: connect to host localhost port 22: Connection refused when running start-dfs.sh

When starting the latest (Okt 2014) Hadoop with start-dfs.sh we are seeing:
connect to host localhost port 22: Connection refused when running
Install openssh server.
For Ubuntu command is :
sudo apt-get install openssh-server
In hadoop-env.sh file ( present in /etc/hadoop) add the following line :
export HADOOP_SSH_OPTS="-p 22"
Configure "HADOOP_SSH_OPTS" in your hadoop-env.sh, to add any SSH CLI
options you need to always be present when the Hadoop scripts use SSH.
A line like 'export HADOOP_SSH_OPTS="-p "' perhaps would be what
you are looking for.
Source: Interweb
Install and start openssh server. Here is the command for CentOS:
Install Open SSH server:
sudo yum -y install openssh-server openssh-clients
Start SSH server:
sudo service sshd start
OS
On Ubuntu 20.04.1 LTS
Install OpenSSH
sudo apt install openssh-server openssh-client -y
Start SSH
sudo service ssh start

How to install and configure LAMP on ubuntu 12.04

Could somebody please tell me how to install and configure LAMP on ubuntu 12.04 ? Is there a package similar to WAMP Server that is all-in-one ? I have tried to install from command line ,PHP,MySQL work but apache gives me this after sudo service apache2 restart
* Restarting web server apache2
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
And I think probably I did something wrong when installing !
Thank you !
From this tutorial,
Run this commands in Ubuntu Terminal-
sudo apt-get install apache2
sudo apt-get install mysql-server
sudo apt-get install php5 libapache2-mod-php5
sudo /etc/init.d/apache2 restart
For Checking-
php -r 'echo "\n\nYour PHP installation is working fine.\n\n\n";'
If u get-
Your PHP installation is working fine.
Then you are done.
You can follow tutorial from below link to setup LAMP on your Ubuntu 12,
http://technarco.com/ubuntu-linux/how-install-lamp-ubuntu-12
Enjoy, :)
To resolve this error, you need to stop other process using this port.
In some of cases it is nginx. you can stop it
sudo /etc/init.d/nginx stop
you can install lamp server using Tasksel (Tasksel is a Debian/Ubuntu tool that installs multiple related packages as a co-ordinated “task” onto your system. This program is used during the installation process, but users can also use tasksel at any time)
check this post http://wiki.workassis.com/ubuntu-install-lamp-using-tasksel/

Resources