Does Xrdp 0.9.5 only support IPV6 and not IPv4? - xrdp

My OS is ubuntu 18.04.5。Xrdp is 0.9.5
it#it51:~$ sudo netstat -ptan | grep xrdp
tcp6 0 0 ::1:3350 :::* LISTEN 4576/xrdp-sesman
tcp6 0 0 :::3389 :::* LISTEN 4587/xrdp
it#it51:~$ xrdp -v
xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2004-2014
See http://www.xrdp.org for more information.
Version 0.9.5
Xrdp 0.9.5 only bind ipv6,Can it be bound to ipv4? If so, how should I configure it?

Use port=tcp://:3389
I managed to get IPv4 port listening on Ubuntu 20.04 with these steps:
sudo nano /etc/xrdp/xrdp.ini
Change port=3389 to port=tcp://:3389 & save,exit
sudo systemctl restart xrdp
I had setup xrdp with the xrdp-installer from c-nergy.be

Related

How to use the Azure docker API

I have a problem when I upload my API on the Azure service app, a ping on port 80 does not find it and returns an error.
If I manually launch my docker on the machine via SSH with --network=host, and I ping on port 80 it works.
It may be a bad configuration on my part on the Dockerfile, but I don't know what it is.
How can I fix this problem?
FROM ruby:2.4
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && apt-get install -qq -y build-essential libpq-dev nodejs yarn
WORKDIR /api
COPY . .
RUN bundle install
CMD bundle exec thin -p 80 start
EXPOSE 80
In the Azure app service portal, under the settings -> configuration -> Application Settings , please check if you have added a property PORT.
If not, add 80.

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

Boot2Docker: can't get ports forwarding to work

I'm playing with boot2docker (docker 1.6) on windows 8.1. I wanted to make myself machine container to play with ruby and I want to be able to connect to rails server from my windows host. To start with small steps first I want to connect to my container from my boot2docker VM. I attach my docker file below, it builds without a problem and I can run a container from it. I do it like so:
docker run -it -p 3000:3000 3564860f7afd /bin/bash
Then in this container I say:
cd ~/myapp && bundle exec rails server -d
And to see if everything is working I do:
~/myapp$ sudo apt-get install wget && wget localhost:3000
and I get http 500, which is ok, I just wanted to check if server is running. Then I exit using ctrl+p, ctrl+q. But then on boot2docker machine I do agin
wget localhost:3000
and get
Connecting to localhost:3000 (127.0.0.1:3000)
wget: error getting response: Connection reset by peer
So it seems like port 3000 is not correctly forwarded to boot2docker VM. What have I done wrong? What did I miss? I googled extensively and tried couple of things like explicitly exposing port from dockerfile of or adding -P switch to run, but I always end up the same way - it's not working.
Any help will be greatly appreciated.
UPDATE 02.05.2015
I have also tried things described in comment from Markus W Mahlberg and reponse from VonC. My VM configuration seems to be ok, I also checked in GUI of VirtualBox and it seems fine. Some more info: When I start
boot2docker ssh -vnNTL 3000:localhost:3000
and then open localhost:3000 on my windows host I see in trace logs in boot2docker console, they look like this:
debug1: channel 1: free: direct-tcpip: listening port 3000 for localhost port 3000, connect from 127.0.0.1 port 50512 to 127.0.0.1 port 3000, nchannels 3
Chrome tells me that the response was empty. From checking the logs on container I know that request never got to it.
End of update
Update 03.05.2015
I thing that my problem have not so much to do with boot2docker or docker as with my computer configuration. I've been over my docker/boot2docker configuration so many times, that it is rather unlikely that I've made a mistake there.
Desperately I've reinstalled boot2docker and VirtualBox, still no effects. Any ideas how to debug what can be wrong with my configuration? Only other idea I have is to try doing the same on another machine. But even if this works my original problem is no less annoying.
End of update
Here is my dockerfile:
FROM ubuntu
MAINTAINER anonymous <anonymous#localhost.com>
LABEL Description="Ruby container"
# based on https://gorails.com/setup/ubuntu/14.10
RUN apt-get update
RUN apt-get -y upgrade
RUN apt-get -y install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \
&& groupadd anonymous \
&& useradd anonymous -m -g anonymous -g sudo
ENV HOME /home/anonymous
USER anonymous
RUN git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
RUN echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
RUN echo 'eval "$(rbenv init -)"' >> ~/.bashrc
RUN exec $SHELL
RUN git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
RUN echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
RUN exec $SHELL
RUN git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
ENV PATH "$HOME/.rbenv/bin:$HOME/.rbenv/plugins/ruby-build/bin:$PATH"
RUN rbenv install 2.2.1
RUN rbenv global 2.2.1
ENV PATH "$HOME/.rbenv/shims:$PATH"
RUN echo 'gem: --no-ri --no-rdoc' > ~/.gemrc
RUN gem install bundler
RUN git config --global color.ui true
RUN git config --global user.name "mindriven"
RUN git config --global user.email "3dcreator.pl#gmail.com"
RUN ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa -C "3dcreator.pl#gmail.com"
RUN sudo apt-get -qy install software-properties-common python-software-properties
RUN sudo add-apt-repository ppa:chris-lea/node.js
RUN sudo apt-get -y install nodejs
RUN gem install rails -v 4.2.0
RUN ~/.rbenv/bin/rbenv rehash
RUN rails -v
RUN sudo apt-get -qy install mysql-server mysql-client
RUN sudo apt-get install libmysqlclient-dev
RUN rails new ~/myapp -d mysql
RUN sudo /etc/init.d/mysql start && cd ~/myapp && rake db:create
See Boot2docker workarounds:
You can use VBoxManage.exe commands to open those ports on the boot2docker VM level, in order for your actual VM host to access them.
By default, only the port 2222 is open, for boot2docker ssh to work and open an interactive ssh boot2docker session.
Just make sure VirtualBox is in your PATH.
VBoxManage modifyvm: works when the boot2docker VM isn't started yet, or after a boot2docker stop,
VBoxManage controlvm: works when the boot2docker VM is running, after a boot2docker start.
Let's say your Docker container exposes the port 8000 and you want access it from your other computers on your LAN. You can do it temporarily, using ssh:
Run following command (and keep it open):
$ boot2docker ssh -vnNTL 8000:localhost:8000
or you can set up a permanent VirtualBox NAT Port forwarding:
$ VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port8000,tcp,,8000,,8000";
If the vm is already running, you should run this other command:
$ VBoxManage controlvm "boot2docker-vm" natpf1 "tcp-port8000,tcp,,8000,,8000";
Now you can access your container from your host machine under
localhost:8000
That way, you don't have to mess around with the VirtualBox GUI, selecting the computer called boot2docker-vm from the list on the left, choosing Settings from the Machine menu (or press Command-S on a Mac), selecting the Network icon at the top, and finally clicking the Port Forwarding button.
boot2docker on Windows (and OSX) is running a VirtualBox VM with Linux in it. By default it exposes only the ports necessary to ssh into the VM. You'll need to modify the VM to get it to expose more ports.
Adding ports to the VM is more about configuring VirtualBox and less about boot2docker (it is a property of the VM, not the software running inside it). Please see the VirtualBox documentation for "port forwarding" and other network configuration. https://www.virtualbox.org/manual/ch06.html
Yes you need to open the ports in the Virtualbox machines:
enter image description here

Can I run a LAMP server with a webmin interface on my raspberry pi on raspbian?

I would like to run a LAMP server with a webmin interface on my raspberry pi.
I am running the latest Raspbian. I have found some packages useful for parts of this, such as:
sudo apt-get install apache2 php5 mysql-server
...but I'm sure there should be more involved than that.
As for webmin, I tried the obvious:
sudo apt-get install webmin
..but it did not appear to find a package. I see that sourceforge has a .deb package up here:
http://sourceforge.net/projects/webadmin/files/webmin/1.720/
Can I install webmin on the Pi from the .deb package? And can I do it from the command line and completely from the Pi from SSH?
I would like it to be easy to install this entire LAMP / webmin setup on a fresh Raspberry Pi at will, as I like to experiment a lot. So, how can I write a bash shell script to automatically install the LAMP stack and webmin into a functional state? What is required?
NOTE:
I have discovered how to do this and am going to share by answering my own question, below.
In case anyone was interested, I've gotten this install script from my friend to work on my current vanilla Raspbian install. Plus, ascii art!:
echo $"
_________
d b
d b
d b
d b
d b
''':::.....:::'''
fff
.' '.
^ ^.'--.
b d ,
czzzzzd ..oOo
LAMP (Top-of-Stack) Installer by Circuit
"
sudo groupadd -f -g33 www-data
sudo apt-get -y update
sudo apt-get -y install apache2 php5 libapache2-mod-php5
sudo apt-get -y install mysql-server mysql-client php5-mysql
sudo apt-get -y install phpmyadmin
sudo apt-get -y install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python libapt-pkg-perl
wget http://downloads.sourceforge.net/project/webadmin/webmin/1.720/webmin_1.720_all.deb
sudo dpkg --install webmin_1.720_all.deb
Then I can access the interface by going to any web browser on my wifi network and typing:
https://raspberrypi.local:10000
Then log in with the default raspberry pi credentials (or whatever you changed them to):
user: pi
password: raspberry
Enjoy webmin awesomeness! Be warned, it eats up a fair amount of CPU cycles when you access various pages in webmin :)
I had a similar script that actually does the same as yours but on RHEL6 (Red Had Linux 6)
In addition there are prompts for if you want to install Ruby on Rails and Java JDK 1.7.
Now with LAMP ASCII art header. (for fun)
#!/bin/bash
echo $"
_________
d b
d b
d b
d b
d b
''':::.....:::'''
fff
.' '.
^ ^.'--.
b d ,
czzzzzd ..oOo
LAMP (Top-of-Stack) Installer by Circuit
"
echo "
Installing Apache Server
"
sudo yum install httpd
echo "
Starting Apache Server
"
sudo service httpd start
echo "
Opening Port :80 on Apache Firewall
"
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
sudo /sbin/service iptables save
echo "
Restarting Firewall for Changes to Take Effect
"
sudo service iptables restart
echo "
Installing MySQL
"
sudo yum install mysql
echo "
Installing PHP
"
sudo yum install php php-mysql
# Above Ends L(AMP) install. This section is additional common Linux Server Programs
selection=
until [ "$selection" = "0" ]; do
echo ""
echo "LAMP INSTALLED. CONTINUE WITH ADDITIONAL SOFTWARE?"
echo "1 - Yes, Continue with Additional Install"
echo "2 - No, Exit Installer"
echo ""
echo -n "Enter selection: "
read selection
echo ""
case $selection in
1 )
echo "Installing Ruby on Rails"
sudo yum install ruby
sudo yum install gcc g++ make automake autoconf curl-devel openssl-devel zlib-devel httpd-devel apr-devel apr-util-devel sqlite-devel
sudo yum install ruby-rdoc ruby-devel
sudo gem update
sudo gem update --system
sudo gem install rails
#Install Java JDK (1.7)
sudo yum install java-1.7.0-openjdk java-1.7.0-openjdk-devel
# Set Java Home
export JAVA_HOME=/opt/java/jdk_1.7.0/
export PATH= ${PATH}:{JAVA_HOME}/bin
;;
2 ) exit ;;
* ) echo "Please enter 1, or 2"
esac
done

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

Resources