0
Beantwoord

I want to work on other port, such as 80, and assign ajenti a sub-domain

涂伟忠 6 jaar geleden bijgewerkt door Eugene Pankov (Project coordinator) 6 jaar geleden 13
I want to work on other port, such as 80, and assign ajenti a sub-domain. How should I do?

Antwoord

Antwoord
Beantwoord
Set up your webserver (e.g.: NGINX http://support.ajenti.org/topic/349870-ajenti-behind-nginx/) to forward requests on a subdomain/subpath to Ajenti.
Antwoord
Beantwoord
Set up your webserver (e.g.: NGINX http://support.ajenti.org/topic/349870-ajenti-behind-nginx/) to forward requests on a subdomain/subpath to Ajenti.
It doesn't work when redirect to /ajenti:auth    ,can't login into the site
The manual has been recently updated, double-check that you're using correct location ~ /ajenti.*
Thanks, but It seems I don't understand what you mean(location ~ /ajenti.* ). I use apache2 and copied the code from here: http://support.ajenti.org/topic/349870-ajenti-behind-nginx/, not right?

Oh, I thought that you used NGINX. The Apache code was contributed by a user, and I don't really have the Apache experience to tackle with it. Do you get to the login page when being redirected to /ajenti:auth? If the form doesn't work there, check whether the POST requests to /ajenti:auth actually reach Ajenti through Apache. 
The login page is right, but when I submit, I stopped at /ajenti:auth
It doesn't work,  ajenti:socket is not severed
Unfortunately, it looks like this is not quite possible: http://serverfault.com/questions/290121/configurin...

However you might try adding similar proxypass statement for /ajenti:socket and Ajenti should fallback to XHR polling instead of websockets.
This may be the answer, but I get the error. WebSocket connection to 'ws://www.example.com/ajenti:socket/1/websocket/720613736357' failed: Error during WebSocket handshake: Unexpected response code: 403
That's good news. Now you need to set Origin header properly:

RequestHeader set Origin "http://yourdomain.com"
Thanks very much, I worked it out with your help. I've tried many times and got the method
Apache 2.4, due to /ajenti:socket/1/websocket/ use ws://, just add a specical, this works well for me, share with others. Thanks again.

sudo a2enmod proxy proxy_ajp proxy_balancer proxy_connect proxy_ftp proxy_http
sudo a2enmod proxy_wstunnel
sudo a2enmod headers


visit http://localhost:8000 to close ajenti's SSL may be more easier to reliaze this.

#########################################
RequestHeader
set Origin "http://localhost:8000"
ProxyPass /ajenti http://localhost:8000
ProxyPass /ajenti:socket/1/websocket/ ws://localhost:8000/ajenti:socket/1/websocket/
ProxyPassMatch ^/(ajenti.*)$ http://localhost:8000
#########################################