Deploy on production using Apache
I tried launch on production, but I got error:
http://www.my-domain/www/css/www-bundle-bf7fd723c9.css net::ERR_ABORTED 404 (Not Found)
Maybe, it is due to relative paths?
@Juzepe, no path is absolute, it should work, if you look at build/www/index.htmlfile you should see link to /www/css/www-bundle-bf7fd723c9.css there is something in your webserver config.
Can you load js files with direct link like http://www.my-domain/www/js/index-bundle-16773faef7.js ?
No, same error.
but you can load and see www/index.html when you hit your http://www.my-domain/ right ?
Yes.
As I see www is unnecessary?
<link rel="stylesheet" href="/www/css/www-bundle.css" />
Yes, I need that for localhost. Do you use nginx ?
I use Apache.
oh, ok. I did not use Apache for a long time. Try this
copy your console server build folder to your /home/www/console/build
Root of webserver should be in
DocumentRoot /home/www/console/build
but index.html should have path
DirectoryIndex /www/index.html that should be inside DocumentRoot
with Nginx, this is a pretty easy to do
root /home/www/console/build;
location / {
index /www/index.html;
try_files $uri $uri/ /app/consoleapp.html;
}
I moved index.html file from build/www folder to build folder and it works now. :)
But when I go to http://www.my-domain/my-project it goes to error: 404 (Not Found). As I guess because of Apache.
But when I go to http://www.my-domain/my-project it goes to error: 404 (Not Found)
This is because in Apache you need to have rewrite rule for any /url-path (but static files) to load a html file from /app/consoleapp.html
This is how it works on Nginx
try_files $uri $uri/ /app/consoleapp.html;
@Juzepe do you have any progress with setting up Apache and console remote server on production ?
I'm out of town and I will find out soon. Thanks.
On Tue, Mar 30, 2021 at 5:40 PM Sergey @.***> wrote:
@Juzepe https://github.com/Juzepe do you have any progress with setting up Apache and console remote server on production ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kurdin/console-remote-server/issues/2#issuecomment-810255679, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKSBSOKT3UWDEYGLIE3TSLTGHIEPANCNFSM4Z3LT6MA .
I tried many things without success. Can you give us rights on https://console.re/ to connect from servers also?
As I remember, we had such right.
I tried rewrite rules, but http://www.my-domain/my-project looks like exactly http://www.my-domain.
I tried many things without success.
can you install a docker on your server ? I can create a console remote server docker with nginx.
Can you give us rights on https://console.re/ to connect from servers also?
Unfortunately I can't, because it quickly gets abused by many many request from different production servers and clients and my server could not keep up with that load.
I tried rewrite rules, but http://www.my-domain/my-project looks like exactly http://www.my-domain.
that means rewrite rule does not work correctly, it should take any uri like /my-project and load static file from /app/consoleapp.html and not index.html
@Juzepe btw, try to rename consoleapp.html to index.html and replace your current index with new file. This should work as quick fix.
I found solution. Inside Directory must be:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . app/consoleapp.html [L]```
But I have another problem: `consoleRe [warning] seems like you trying to use console remote on public, production server. Console.Re is for light, local development only, for production you can install and use self hosted solution`. Same as on https://console.re/
But I have another problem: consoleRe [warning] seems like you trying to use console remote on public, production server. Console.Re is for light, local development only, for production you can install and use self hosted solution. Same as on https://console.re/
let me check that
@Juzepe did you change connection option server: 'https://your-remote-console-server-name.com' ?
did you try connect to your console server from localhost ?
Now I'm struggling to CORS policy :)
@Juzepe you need to look for Apache CORS solution. Sorry can't help with this.