Hi, I have a streamlit app that runs OK on my linux server (Red Hat 4.8.5),but I have problem deploying it with apache.
System information: Linux version 3.10.0-1062.9.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) ) #1 SMP Fri Dec 6 15:49:49 UTC 2019
Apache version: Server version: Apache/2.4.6 (CentOS) Server built: Apr 2 2020 13:13:23
Iβve set the default sever port to 8080, and after refering https://discuss.streamlit.io/t/configuring-apache-2-4-for-proxy/1866, I tried to add a file called default-site.conf
in the folder /etc/httpd/conf.d (no folders like sites-enabled were found), and edited it as below:
<VirtualHost *:80>
Alias /static/ /data/secondstrpred
<Directory /data/secondstrpred>
Require all granted
</Directory>
RewriteEngine on
RewriteCond %{HTTP:Upgrade} =websocket
RewriteRule /(.*) ws://192.168.1.10:8080/$1 [P]
RewriteCond %{HTTP:Upgrade} !=websocket
RewriteRule /(.*) http://192.168.1.10:8080/$1 [P]
ProxyPassReverse / http://192.168.1.10:8080
</VirtualHost>
then I ran service httpd restart
and run my app from corresponding directory:
streamlit run prediction.py
, and it showed the URL I expected,but can only be accessed locally through Xmanager. When I enter the link in the browser of my PC it said βthis site cannot be accessed.β
I have to admit that I do not know much of web app deployment, so I would be quite grateful if someone could solve my problem.Thanks in advance.