Streamlit Hosting [closed] - hosting

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 months ago.
Improve this question
I have made "streamlit dashboard app" and I need to deploy it on the pvt linux server of my team. I understand running "streamlit run app.py" - gives me the url and everyone within the startup-company with access to server is able to access it with that url and port 8501.
I used "nohup" cmd and make sure the process isnt killed but I am not sure if this is the right way?
I need to host this just like any other webapp port-number 8501 not visible on the url-bar.
I gave extensive searches but most of the contents are just about hosting it on heroku and streamlit hosting.
Sorry If am being naive about web dev and hosting but thats the reason I opted stremalit even if I get direction I can find my way.

Hosting instructions are available at https://discuss.streamlit.io/t/streamlit-deployment-guide-wiki/5099
There's more than a couple of links in there.
The one that seems most relevant to your need
is Standalone executable --> nginx -->
https://discuss.streamlit.io/t/streamlit-docker-nginx-ssl-https/2195/5
That will let nginx worry about unruly internet clients,
password authentication, IP whitelists,
https certificates and the like,
proxying requests along to your port 8501.
Alternatively, note that $ streamlit run --help
comments on --server.port INTEGER.
You can also adjust this by setting
the environment variable STREAMLIT_SERVER_PORT.

If you are trying to modify the URL to localhost, it can be done by changing the streamlit configuration. Streamlit provides four different ways to set configuration options. Please refer: https://docs.streamlit.io/library/advanced-features/configuration
Below are two of the four methods which you can use to configure your streamlit app.
Method 1:
Using config.toml file. Place this file in a folder named .streamlit, which should in the same folder as the .py file you are trying to run.
Folder structure:
ParentFolder
|__ main.py (# your python script )
|__ .streamlit
|__ config.toml
Config File
[server]
port = 7777
baseUrlPath = "/url_path/"
[browser]
serverAddress = "0.0.0.0"
Method 2: Adding the config parameters in the command line.
streamlit run main.py --server.port 7777 --server.baseUrlPath /url_path/ --server.serverAddress = '0.0.0.0'
The above config will run your app on the URL: http://localhost:7777/url_path/

I am a bit late but this issue bothered me for a while as well. My best shot so far is to use redir to redirect incoming traffic from port 80 to port 8105 :
sudo apt-get install redir
sudo redir --laddr=0.0.0.0 --lport=80 --caddr=0.0.0.0 --cport=8501
Then open port 80 and voila...

Related

Can't access webservers on my oracle cloud instance, although I can SSH on 22 and ping the server IP [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 11 months ago.
Improve this question
I'm having a hard time viewing Wildfly welcome page on port 8080 + tried apache on port 80 too, and they timeout. I can ssh to the server and using (curl localhost:8080) and (curl localhost:80) show Wildfly and apache welcome pages respectively. I have checked the Security List and Security groups and even opened ALL traffic just to see if they are causing this problem, but unfortunately the problem still there.
I'm using ubuntu 20.04 image and the UFW (firewall) is inactive so the problem isn't from there.
By default every oracle instances come with 2 firewall.
Hardware Firewall (Known as VCN)
Software Firewall (They use a very hard iptables rules and regular ufw doesn't work with that.)
The 2nd option is very annoying and also took me about 3 days to solve my problem. You can follow my following instructions and hopefully it will also fix your problem.
1st you have to open the port on the Hardware Firewall (VCN) and when you believe you have opened the port then by login to the server using ssh use this command to clear the default oracle iptables rule.
sudo iptables -F
But remember whenever you will reboot the server you will need to again run the flash command. So if you don't want to run this command every time after server reboot. Then after running the flash command run this command to save your flashed iptables rules.
sudo netfilter-persistent save
So, you will not need to run the iptables falsh command every time on the startup of the server.

Minikube: host-agnostic way to set / retrieve External IP [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I recently did an implementation of our local environment on the basis of Minikube. In my automation scripts for env provision I relied on the fact that minikube tunnel exposes services with LB type at 127.0.0.1 local IP - this is what happens on my macOS.
However, a developer with Ubuntu (running under VirtualBox) complained that for him External IP is never a loopback one, it's always something from the 10.0.0.0/8 subnet.
At this point I am trying to figure out what is the best course of action:
Try to force somehow External IPs on all platforms to be 127.0.0.1. IDK if possible, couldn't find anything on that.
Or fall back to some other way to reliably find the external IP for any given service. I assume I can use kubectl output to grep the External IP, but that will add overhead and latency in scripts I was hoping to avoid.
What is the cheap and reliable host-agnostic way to find External IP for any given service within the cluster?
Well I don't think 1. is possible. Similar to you, I could not find any information.
I think option 2 is good, but you don't have to use grep. You can use kubectl built in JSONPath Support and set IP address as variable (example in bash):
IP_ADDRESS=$(kubectl get service {your-service} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
You may also use NodePort and do not use minikube tunnel at all:
IP_ADDRESS=$(minikube ip && kubectl get service {your-service} -o jsonpath="{.spec.ports[0].nodePort}")
IP_ADDRESS=$(echo $IP_ADDRESS | sed 's/ /:/g')
Or get it using minikube service --url <service-name> command, but the output starts with http://:
user#shell:~$ minikube service --url my-service
http://{ip-of-the-node}:{node-port}
Another option is to run in the background kubectl port-forward command at the beginning of the script and use localhost address everywhere, but I think previous solutions are better and more reliable.

How to assign domain name to my Golang server? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
This might be a very basic question but I've been stucked for 2 days
I've bought the domain name AAA.xyz on Namecheap and I have my Golang web server running on my port :8095 (I've redirected my ports on my router so my server is accessible from everywhere with my public IP http://93.6.XXX.YYY:8095/)
How do I make my Namecheap domain name point to my IP adress with the right port so when I enter AAA.xyz on my browser I get response from my API ?
You have to edit your namecheap DNS settings to add an A Record, which will point to your server IP. That's enough to divert all traffic to your domain, to your server.
Although, unless it's not a production setup, it'd be better to let a reverse proxy server like nginx handle the incoming http traffic. Then you won't have to expose your port to the outside world either. (Unless you want to).
Install nginx. Add a proxy pass to your nginx config file which will route all requests coming to port 8095 to your application at 127.0.0.1:8095.
This will also help you when you have multiple go apps running on your server on different ports. You can use different URLs to point to different apps.
e.g. https://yourdomain.com/app1 will go to 127.0.0.1:8095
and https://yourdomain.com/app2 will go to 127.0.0.1:8096
Bonus: You can use Letsencrypt to provide your nginx server with an HTTPS certificate for free and then all communication with your applications will be happening through port 443 on HTTPS, without configuring every app to handle the certificate.
Also, open ports 80 and 443 in your firewall.
If you need any help with a specific step. I'll expand on that.

Does SFTP ask for a prompt input when first connecting to an SFTP server? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I have a script that connects to a SFTP server and downloads some files. On my local machine, it runs perfectly fine.
However, I need to run this on AWS' infrastructure and have tried running the commands in a shell script executed by an EC2 instance. The EC2 instance is not persistent; it is spun up every time I run a data pipeline.
So my question is this: since a new machine runs the shell script every single time, does it get prompted by SFTP (or is it Bash?) for authentication and verifying that I want to use the key? When I was testing the script on my local machine, there were a few times when my Cygwin shell prompted me with something along the lines of "Do you want to use this key?".
If there's a prompt for that, how do I avoid it, or make sure the key is stable and usable for the SFTP connection?
The error I'm getting on the AWS EC2 instance is:
Host key verification failed.
Couldn't read packet: Connection reset by peer
If the host key isn't present in your known_hosts file, or the key doesn't match what's there, SSH-based applications will normally prompt you to accept it. You can disable this by putting
StrictHostKeyChecking no
in your ~/.ssh/config file.
The first time you connect to a host, the host key won't be present in ~/.ssh/known_hosts so ssh will prompt you to accept it or reject it. You should configure the machine to start with this value already present in the file.
I've had this problem before
And this is how i solved it.
Create a new instance
Create a new volume
mount the volume
Copy these files to the new volume
/etc/ssh/ssh_host_dsa_key
/etc/ssh/ssh_host_ecdsa_key
/etc/ssh/ssh_host_rsa_key
/etc/ssh/ssh_host_dsa_key.pub
/etc/ssh/ssh_host_ecdsa_key.pub
/etc/ssh/ssh_host_rsa_key.pub
Now you need to configure that your new instance will mount the new volume and copy the files back
you need to put the the commands in you user data
so everytime you start the instance, it will
update the repository (sudo apt-get update)
install aws cli
mount the volume that contains your keys
copy the keys ( i use cat, to preserve permissions and ownership)
umount the new volume
restart sshd
So even if you have a new instance, the keys will be the same and you will not get prompted.
I assume that you use elastic IP to get the same IP everytime, this to can be put in the user data section.

Forwarding only on a single port 8080 to localhost (windows) possible? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I know how to set up a local webserver using xampp on windows... I enter my alias and target on the hosts file (c:\windows\system32\drivers\etc\hosts) and then add a respective entry on my apache vhosts config file. This way, assuming that my webserver is listening to port 80, I can for example map example.com to my local webserver.
I've always entered the whole domain name (that is e.g. example.com) in my hosts file and any requests on that name would be directed to localhost.
Now I was wondering if there's a way to only forward example.com on a certain port (for example only example.com:8080) to the local webserver, and leave example.com (on the default port 80) alone, so that it would still go to my live production website.
As far as I understand this might not be possible using only the hosts file (I tried adding the port :8080 to my domain names - didn't seem work ;-) )...
I really don't know much on this topic so any ideas, insights, links, reading material, tools are welcome.
Edit:
Arnout's reply answers the question I've asked above but doesn't solve my actual problem. Rerouting example.com:8080 to localhost:80 does work and if I access example.com it loads up the frontpage of my local version, but all links on that page of course don't know about the port number and therefore point to the production version... The actual solution to my problem seems to be to bite into the sour apple and fix my application (following Rob's suggestion) and remove all hardcoded urls, so that it works on any domain...
Internet Junkbuster (a proxy server) can do this using its forwarding functionality.
Just add a line like
example.com:8080 localhost:80 . .
to sforward.ini, and uncomment the forwardfile line in junkbstr.ini. Now configure your browser to use a proxyserver running at port 8000 of localhost, and you're set.
I'm sure other proxy servers have a similar feature — I just like Junkbuster since it's a simple standalone executable.
You are playing in the area of domain name services (DNS). Technically, with an advanced DNS configuration (which can include remapping ports), what you propose is possible and it is done routinely on the Internet. However, it is unlikely that you would want to go to that much trouble and expense locally.
On the other hand, I suspect that your real issue can be addressed more easily. Why would you want to have "example.com" resolve to your local web server? You can already reference your local web server as "localhost", as "127.0.0.1", and via its assigned machine name "workstation-x".
The only reason that I can think of, and that I have seen, for wanting to reference your local web server with the same host name as your production web server is due to hard-coding the server host name into your links within your application's web pages. If that is the case here, the answer is simple: don't! You should ALWAYS implement your web applications so that they reference everything (other pages, CSS, JS, images, etc.) relative to the deployed server. If you deploy across multiple servers, then your references must be absolute based on configurable server host names. This is easy to do, and there is no reason not to do it.
If this is not the case, then please explain what you are trying to achieve and what motivates you to try.
EDIT: Since you have confirmed my guess that the problem is hard-coded references to the production host name in the web pages, let me simply add that I have ALWAYS, WITHOUT EXCEPTION, found that it is cheaper to fix the real problem than to accumulate workarounds (such as your attempt to remap ports). I have never encountered an author who has argued the opposite.
Fixing the pages should be little harder than a global search & replace, especially with a decent text editor. Even writing a simple script to change the source files would be vastly cheaper and easier than your attempts at a workaround.
Regardless, best wishes to you, and let us know how it turned out.
Can you confirm if 8080 port is listening on webserver? use the command "netstat -na" to see if the port 8080 is listening.
Did you add 8080 port on apache config file as the same as the default 80 port?
Once you add port 8080 on apache config file to make it listen and double check if 8080 port is listening on webserver, then you will be able to access the page using port 8080. like http://mytestwebserver:8080/index.html or something like this....

Resources