Django server is not reachable although ssh to the computer works - redhat

I am running a Django server on a redhat computer. I can remotely connect to the computer via ssh connection, so I am assuming there is no firewall issue. However, when I execute the following command (which supposedly should make the server publicly available)
python3 manage.py runserver 0.0.0.0:8080
The server is not reachable from any other computer. Locally (from the redhat machine itself) I can see the server is running.
I am new to redhat, so if there is any other information I should provide, please let me know.
So far, I have found that I can make my server reachable using localtunnel, however, since it changes the url, I prefer to solve the issue some other way.
UPDATE: the problem had nothing to do with Django. What made confusion was that the server was running with no problem and turned unreachable with no specific reason.
Anyways, I needed to add some configurations (found in here) to make port:8080 reachable.

Open the port 8080 with
firewall-cmd --zone=public --add-port=8080/tcp
To add it permanently to the system, add --permanent like so:
firewall-cmd --zone=public --add-port=8080/tcp --permanent

Related

installing openfire on centos7

I have succesfully installed openfire on centos7 with mariadb as database, and created a user to test chat username=mickey, password=mickey.
Centos machine on which openfire is installed with ip (192.168.1.141).
Now i have installed spark messenger on my windows laptop to test chat, but somehow i am unable to login.
As on windows i am successfully accessing admin console(192.168.1.141:9090).
But spark login is not working.
Spark is giving error "unable to verify certificate"
Under the 'advanced' link on the Spark login screen, there's an option that allows you to ignore the certificate warnings - that is the short answer.
The issue that you would ignore is a security-related (which you arguably should not ignore). When you installed Openfire, you were asked to provide an XMPP domain name (as well as the fully qualified domain name for the server on which Openfire is installed). These can, but should not be an IP address. Based on these values, Openfire will generate self-signed certificates, which are presented to Spark.
You should review your setup, and make sure that you properly defined your XMPP domain name (eg: example.com) and the FQDN for your server (eg: myserver.example.com). When both values differ, you should set up DNS records - the Openfire admin console will warn you of this, and will provide configuration for your specific setup.
As i was accessing openfire server that is installed in centos7 pc, on my windows pc(in which i have installed spark web app), spark was not connecting to centos server. I have to open these ports for public on centos, this helped me
firewall-cmd --zone=public --add-port=9090/tcp --permanent
firewall-cmd --zone=public --add-port=9094/tcp --permanent
firewall-cmd --zone=public --add-port=5222/tcp --permanent
firewall-cmd --zone=public --add-port=7777/tcp --permanent

Can't access SVN on CentOS 7 VM in VirtualBox

I installed VirtualBox on Windows 7, and created a virtual machine, where I installed CentOS 7. Then in CentOS 7 I installed CollabNet Subversion Edge, following this information as a guide and
performed all the steps provided there, but I can not access the server.
The installation should be performed on a desktop machine and the server I'm trying to access from a notebook, which is connected to the same network as the desktop machine. Also obviously, as the network has a proxy to surf, I had to configure it, and doing well because I can surf the internet and others. It's using 'Bridged Adapter' networking in the VM settings.
Can you think of any idea why I do not have access? Any help is welcome.
I found a response similar to what I'm looking for, but do not quite understand what it says. I'm only in CentOS7 enp0s3 interface, and there is collabnet running, not running on another interface.
NEWS:Gain access the server using its IP (172.x.x.x:3343/svn or 172.x.x.x:18080/svn), but not by name. Maybe there is a problem in the computer name, applies only to Windows, and CentOS running on the virtual machine, use another computer name. Can it be? If so, you know how to identify such equipment?
Looks like a firewall issue. Try to run following commands:
firewall-cmd --permanent --zone=public --add-port=<dst_port>/tcp
firewall-cmd --reload
Hope this helps

Resolve hostnames with arch linux on a RaspberryPi

I have a Pi that runs hostapd and dhcpd on arch linux to create it's own land with the Pi's (routers) IP being 10.0.0.1. This uses the wlan0 interface and it only serves as a standalone router running a web server.
Once I connect to the Pi, I use 10.0.0.1 to display the web pages, but I want to use a hostname such as firepi. I have tried using dnsmasq, but I haven't been successful. Any help would be greatly appreciated especially if you can give me some detailed examples as I am a novice.
The purpose of this system is that I have created a web app that you can use to ignite fireworks over WiFi at a safe distance. I would just like the convenience of using a hostname instead of the IP address.
I must add that I will more than likely be using an iPhone to connect to the server, should this affect anything.
Not too sure how or why but this is what I did and it is successfully working now, so this is just for future users who may need a similar setup to mine.
First I installed hostapd and dhcpd and made sure they were working. Next I changed '/etc/hostname' to firepi and the '/etc/hosts' and added '10.0.0.1 firepi'. Then I installed dnsmasq, and set the interface to wlan0, and finally added '10.0.0.1 firepi' to '/etc/resolv.conf'.
After a full reboot, I joined the network on my iPhone, navigated to firepi and sure enough, it worked!
Thanks to the other users for their advice and tips.
You can use avahi on Arch as well to resolve your hostname:
sudo pacman -S avahi nss-mdns
Start the avahi daemon:
sudo systemctl enable avahi-daemon.service
sudo systemctl start avahi-daemon.service
Edit /etc/nsswitch.conf
sudo vim /etc/nsswitch.conf
Change the line:
hosts: files myhostname dns
to
hosts: files myhostname mdns_minimal [NOTFOUND=return] dns
Reboot
Note: don't forget to add .local to your hostname.
See also:
http://blog.pixxis.be/post/77285636682/resolve-hostname-with-arch-linux-on-a-raspberry-pi
If you just want to be able to use "firepi" as hostname to connect to it, you can simply add it to your /etc/hosts file using the syntax "IP host".
To make it as easy as possible, run this command as root:
echo "10.0.0.1 firepi" >> /etc/hosts
That'll do the trick.
Can you try avahi ?
sudo apt-get install avahi-daemon and
sudo apt-get install avahi-browse
I've successfully used that on Raspian. Unless you change the hostname using
sudo raspi-config you will access via raspberrypi.local
Note that if you plan to access the RPi from Windows you will need to install Bonjour Service first(if you have iTunes intalled, you might have those, run services.msc and check if the Bonjour Service is started)
Another note: On a friend's iphone I've installed a generic vnc client and had x11vnc running on the RPi and succesfully managed to connect to the RPi (since avahi-daemon was installed)

vagrant cannot access webserver on localhost:8080

I am running CentOS 6.4 through vagrant.
I have put this line inside my Vagrantfile:
config.vm.network :forwarded_port, guest: 80, host: 8080
Then I have installed nginx in the VM and verified it's working with:
wget http://locahost/
Works fine.
But from my host machine (Macbook Air, Mountain Lion) when I go to:
http://localhost:8080
It times out. Did I miss any configuration in Vagrantfile?
I have used this box:
https://github.com/NREL/vagrant-boxes
Have you checked your iptables?
It's a common mistake: when you use provisioning you also have to configure your iptables. (For puppet you have this module.) If you don't want to work with a firewall you can just do vagrant ssh followed by sudo service iptables stop.
What do you see when you go to your browser? Does it say Data not received or it never stops reloading? Do you get any messages in your browser? The server config file must be a bit messed up. Try reloading the server configuration, and restarting it.
Also, try changing the port number to something else. With the newer version of Vagrant, the syntex looks a bit different. So you have to do:
config.vm.forward_port 80, 2759
This is the config file that I use for one of my instances:
Vagrant::Config.run do |config|
config.vm.box = 'rails-dev-ready'
config.vm.host_name = 'rails-dev-ready'
config.vm.forward_port 5800, 5800
config.vm.forward_port 1080, 1090
config.vm.forward_port 80, 2759
config.vm.provision :puppet,
:manifests_path => 'puppet/manifests',
:module_path => 'puppet/modules'
config.vm.share_folder "sharedapps", "/home/vagrant/sharedapps", "sharedapps"
end
I recently set up a CentOS 6.4 box. My ports got all messed up because of iptables. I just disabled the service. It's in /sbin/sevices.
You may run the following command to find out if any other process (such as Tomcat) is bind to port 8080:
lsof -i :8080
If so, that may cause the problem.
I have found a solution,
I have found that there is an issue with Apache + vagrant, and sometimes Apache won't start automatically.
Please try: sudo service apache2 start once logged in via ssh.
I was having issues with Vagrant and all the error messages indicated a networking problem, but in reality my Apache service just wasn't starting on vagrant up

How to set nodejs debug mode don't listen 127.0.0.1

I want to remote debug the nodejs program in Eclipse. I start the node script with the debug option.
$node debug script.js
But I can't connect to the node in Eclispe. When I netstat the node's TCP port. I found that node only listen 127.0.0.1 in debug mode. So I can't connect it from different computer.
But I can't find any startup options that can change to listen to any address.
Anyone know to make it listen to any address to remote debug in other computer?
if anyone else stumble upon this: you can set the node debug to any address as you set the port
node --debug=169.168.1.2:5858 app.js
if that would be the ip of your remote machine or even better to every machine
node --debug=0.0.0.0:5858 app.js
but please be aware that the 2nd option should only be used if you are debugging in your own private network as you open it up for everyone
This is what I do in linux Debian:
install balancer
sudo apt-get install balance -y
then create a route in balancer to reroute your 5858 port to 5859
balance 5859 127.0.0.1:5858
start your app
node --debug app.js
now you can access it from everywhere on port 5859
I'm looking into V8 code that goes through deps/v8/src/debug-agent.* down to deps/v8/src/platform-posix.cpp (for linux) to POSIXSocket::Bind method and it can't seem to have any option about this (unless I'm missing something).
I bet you either hack it and recompile node or you'll need to build a small proxy beside your node process.
Here's a great tut on debugging nodejs from eclipse. Note at the bottom there is a script the author uses to forward localhost:5858 to the remote server's 127.0.0.1. You could also just use an SSH tunnel.
So, to summarize:
start your script with node --debug app.js
configure eclipse as if you were debugging locally
use the node_g script or configure an SSH tunnel
go on vacation now that your code is bug-free
to debug nodejs remotely over SSH session do:
1. install balance on Linux: https://balance.inlab.net/overview/
2. run the command: balance -df 8585 127.0.0.1:5858 > /tmp/balance.out 2>&1 &
3. ssh to your remote Linux box (tunnel will be created 8585 > 5858 > nodejs)
4. run your node script on server: node --debug-brk --nolazy ./myNodeApp.js
5. kick off debug session in WebStorm alt-d to port 8585
now you are remote debugging securely over SSH session