Try the fastest and simplest way to install ONLYOFFICE

Error when changing port

Questions/problems on Docker

Error when changing port

Postby gestonline » Mon Jul 18, 2016 11:33 am

Hi,

When i change port (like 8080), homepage not include new port number on redirection to welcome or example page.

Same error to edit file with url like 2016-06-24-11-21/web-apps/apps/spreadsheeteditor/main/index.html?_dc=2016-06-24-11-21&lang=en&customer=ONLYOFFICE

Can you help me ?
gestonline
 
Posts: 3
Joined: Mon Jul 04, 2016 2:24 pm

Re: Error when changing port

Postby Dean » Thu Jul 21, 2016 12:52 pm

Hello,

Could you please specify the version and the way of changing the port number?
Dean
 
Posts: 700
Joined: Tue Sep 30, 2014 11:04 am

Re: Error when changing port

Postby vin » Tue Aug 02, 2016 2:56 pm

Hi,

I have the same issue. I use the Document server 4.0 docker version with the basic command : docker run -dit -p 8080:80 --name "OO" onlyoffice/documentserver.

I use http://127.0.0.1:8080/web-apps/apps/api ... nts/api.js and I get the api.js file. But the api make a request and I get a 404 Not Found The requested URL /2016-07-12-16-21/web-apps/apps/documenteditor/main/index.html was not found on this server.

Also when I go at http://127.0.0.1:8080, the page go to http://127.0.0.1/welcome

Thank for your help.
vin
 
Posts: 3
Joined: Thu Jan 21, 2016 1:43 pm

Re: Error when changing port

Postby doro » Wed Aug 03, 2016 8:58 am

This (http://paste.ubuntu.com/22006258/) is my docker-compose.yml. You may find version and run it simply by `docker-compose up -d`

As gestonline described, I get 404 if editing doc.

I trace the code and find this is caused by rewrite rule of nginx config problem in Document Server.
For example, if editing a doc, the error lines are first few lines in `/etc/nginx/includes/onlyoffice-documentserver-docservice.conf`

I fix it myself, but I meet other problem in `cache/files/Editor.bin....`
Here is the screenshot by Developer Tool http://dl.dropbox.com/u/23905041/Selection_252.png

Can anyone help on this?
doro
 
Posts: 1
Joined: Wed Aug 03, 2016 8:47 am

Re: Error when changing port

Postby jstark » Mon Aug 08, 2016 10:13 am

I am facing the exact same problem and would be interested in a solution.

As already explained by doro, we could resolve some of the redirection issues by modifying the file /etc/nginx/includes/onlyoffice-documentserver-docservice.conf in the document server. Assuming we want to use port 9876:

Code: Select all
if ($http_x_forwarded_proto){
  set $redirect_host $host:9876;

  #support old version
  rewrite ^\/OfficeWeb(\/apps\/.*)$ $http_x_forwarded_proto://$redirect_host/2016-08-03-13-33/web-apps$1 redirect;

  #script caching protection
  rewrite ^(\/web-apps\/(?!api\/).*)$ $http_x_forwarded_proto://$redirect_host/2016-08-03-13-33$1 redirect;
}


After adding ":9876" to the second line here, some redirection issues could be resolved (as could be seen in the browser console) and it started actually loading the document interface, but ended up with another error ("Unknown"). The problem was, that the redirection for the cache-directory (which contains Editor.bin) was still trying to use port 80. Experimenting with a new redirection/rewrite rule so far yielded no success.

Any ideas?


EDIT: I'm using the latest docker image versions of documentserver and communityserver. Port redirection is done via the "-p" switch of docker run.
jstark
 
Posts: 4
Joined: Wed Jun 22, 2016 10:22 am

Re: Error when changing port

Postby Eugenie » Mon Aug 08, 2016 3:24 pm

Unfortunately transferring editors to different port is impossible. We will do our best to add this feature to the next versions, but custom ports forwarding will not work at the moment.

Sorry for the inconvenience.
Eugenie
 
Posts: 134
Joined: Mon Aug 25, 2014 10:11 am

Re: Error when changing port

Postby jstark » Tue Aug 09, 2016 9:20 am

I understand. Thanks for confirming this.
Could you please post another answer to this thread once the feature has been added?
jstark
 
Posts: 4
Joined: Wed Jun 22, 2016 10:22 am

Re: Error when changing port

Postby pciavald » Wed Sep 21, 2016 5:30 pm

Hi,
I'm also needing this feature and went down these solutions :

- starting the community container with port mapping :
sudo docker run -i -t -d -p 8080:80 onlyoffice4enterprise/communityserver-ee

- changing line 849 of enterprise-install.sh and running the script :
COMMUNITY_PORT=8080

- echoing the final command built by the script and running it standalone :
sudo docker run --net onlyoffice --name onlyoffice-community-server -i -t -d --restart=always -p 8080:80 -p 443:443 -p 5222:5222 -e ONLYOFFICE_MONOSERVE_COUNT=2 -e DOCUMENT_SERVER_PORT_80_TCP_ADDR=onlyoffice-document-server -e CONTROL_PANEL_PORT_80_TCP=80 -e CONTROL_PANEL_PORT_80_TCP_ADDR=onlyoffice-control-panel -v /app/onlyoffice/CommunityServer/data:/var/www/onlyoffice/Data -v /app/onlyoffice/CommunityServer/mysql:/var/lib/mysql -v /app/onlyoffice/CommunityServer/logs:/var/log/onlyoffice -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/DocumentServer Data onlyoffice4enterprise/communityserver-ee:8.9.1.191

- also tried with -e CONTROL_PANEL_PORT_80_TCP=8080

All of these solutions result in failing to access the Document Server.

Today i went down a different road with somewhat better results.
vanilla enterprise-install.sh, then

Code: Select all
sudo iptables -t nat -A DOCKER -p tcp --dport 8080 -j DNAT --to-destination 172.18.0.4:80

this maps my external 8080 port to my docker network's 80.
i can access community server from 8080, and i can open the document editor but it fails to fetch the file.
Basically the document editor is loaded but the document itself doesn't open and I get a popup "download failed, go back to document list".
now i have this log : /app/onlyoffice/DocumentServer/logs/documentserver/converter/out.log

Code: Select all
[2016-09-21 16:59:44.126] [ERROR] nodeJS - error downloadFile:url=http://xxx.xxx.xxx.xxx:8080/products/files/httphandlers/filehandler.ashx?action=stream&fileid=1&version=5&stream_auth=212173180352.ST0XWTPVOIGK1TBVUR7MFW5CO6UVQMMSRHTYNLDW;attempt=3;code:ECONNREFUSED;connect:undefined;(id=YOuud7nSuRh5k0Is_LY_)
Error: connect ECONNREFUSED xxx.xxx.xxx.xxx:8080
    at Object.exports._errnoException (util.js:907:11)
    at exports._exceptionWithHostPort (util.js:930:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1077:14)

the document server tries to fetch the file from [obfuscated ip]:8080 and gets a connection refused.

I know this is not a supported feature yet, but I can't use onlyoffice on 80, obviously i have a website running on here and i need to use a subdomain for onlyoffice.
I don't care putting my hands into the wires as I already did.
what would be the next thing to try to fix this error ?
thank you
pciavald
 
Posts: 16
Joined: Wed Sep 21, 2016 5:07 pm

Re: Error when changing port

Postby Alex » Tue Sep 27, 2016 3:20 pm

Hello
I know this is not a supported feature yet, but I can't use onlyoffice on 80, obviously i have a website running on here and i need to use a subdomain for onlyoffice.

I regret to inform you that there is no other way to use it than by using 80 port.
Regards
Alex
 
Posts: 52
Joined: Sat Nov 07, 2015 3:19 pm

Re: Error when changing port

Postby pciavald » Sun Oct 09, 2016 4:34 pm

Just to mention you are advertising that ONLYOFFICE can run on port 8080 in this page :
http://www.onlyoffice.com/blog/2015/02/ ... r-service/

Configuring ONLYOFFICE
If you wish to run ONLYOFFICE on a different port, change the value of the -p command. For example, to run your office on 8080 port, use the following command:
sudo docker run -i -t -d -p 8080:80 onlyoffice/communityserver
pciavald
 
Posts: 16
Joined: Wed Sep 21, 2016 5:07 pm

Next

Return to Docker Version

Who is online

Users browsing this forum: No registered users and 3 guests