0

I installed the CouchDB using aptitude install couchdb. The service is running. I did not changed anything else. But when I try http://127.0.0.1:5984 it gives a refused connection. Can anyone help me with my case? Thanks.

plntu
Ligações de Internet Activas (só servidores)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      PID/Program name
tcp        0      0 0.0.0.0:445             0.0.0.0:*               ESCUTA      3011/smbd       
tcp        0      0 0.0.0.0:3050            0.0.0.0:*               ESCUTA      1037/fbserver   
tcp        0      0 0.0.0.0:139             0.0.0.0:*               ESCUTA      3011/smbd       
tcp        0      0 127.0.0.1:11211         0.0.0.0:*               ESCUTA      951/memcached   
tcp        0      0 192.168.179.11:53       0.0.0.0:*               ESCUTA      1009/named      
tcp        0      0 127.0.1.1:53            0.0.0.0:*               ESCUTA      2509/dnsmasq    
tcp        0      0 127.0.0.1:53            0.0.0.0:*               ESCUTA      1009/named      
tcp        0      0 127.0.0.1:631           0.0.0.0:*               ESCUTA      855/cupsd       
tcp        0      0 127.0.0.1:953           0.0.0.0:*               ESCUTA      1009/named      
tcp6       0      0 :::444                  :::*                    ESCUTA      2962/apache2    
tcp6       0      0 :::445                  :::*                    ESCUTA      3011/smbd       
tcp6       0      0 :::3689                 :::*                    ESCUTA      7146/rhythmbox  
tcp6       0      0 :::139                  :::*                    ESCUTA      3011/smbd       
tcp6       0      0 :::80                   :::*                    ESCUTA      2962/apache2    
tcp6       0      0 :::53                   :::*                    ESCUTA      1009/named      
tcp6       0      0 ::1:631                 :::*                    ESCUTA      855/cupsd       
tcp6       0      0 ::1:953                 :::*                    ESCUTA      1009/named      
tcp6       0      0 :::443                  :::*                    ESCUTA      2962/apache2    
udp        0      0 192.168.179.255:137     0.0.0.0:*                           2992/nmbd       
udp        0      0 192.168.179.11:137      0.0.0.0:*                           2992/nmbd       
udp        0      0 0.0.0.0:137             0.0.0.0:*                           2992/nmbd       
udp        0      0 192.168.179.255:138     0.0.0.0:*                           2992/nmbd       
udp        0      0 192.168.179.11:138      0.0.0.0:*                           2992/nmbd       
udp        0      0 0.0.0.0:138             0.0.0.0:*                           2992/nmbd       
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           9583/libpepflashpla
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           835/avahi-daemon: r
udp        0      0 0.0.0.0:39682           0.0.0.0:*                           835/avahi-daemon: r
udp        0      0 127.0.0.1:11211         0.0.0.0:*                           951/memcached   
udp        0      0 192.168.179.11:53       0.0.0.0:*                           1009/named      
udp        0      0 127.0.1.1:53            0.0.0.0:*                           2509/dnsmasq    
udp        0      0 127.0.0.1:53            0.0.0.0:*                           1009/named      
udp        0      0 0.0.0.0:631             0.0.0.0:*                           979/cups-browsed
udp        0      0 192.168.179.11:123      0.0.0.0:*                           3067/ntpd       
udp        0      0 127.0.0.1:123           0.0.0.0:*                           3067/ntpd       
udp        0      0 0.0.0.0:123             0.0.0.0:*                           3067/ntpd       
udp6       0      0 :::42115                :::*                                835/avahi-daemon: r
udp6       0      0 :::5353                 :::*                                835/avahi-daemon: r
udp6       0      0 :::53                   :::*                                1009/named      
udp6       0      0 fe80::21c:c0ff:fe8d:123 :::*                                3067/ntpd       
udp6       0      0 ::1:123                 :::*                                3067/ntpd       
udp6       0      0 :::123                  :::*                                3067/ntpd    

If i execute couchdb it works:

   Apache CouchDB 1.6.0 (LogLevel=info) is starting.
    Apache CouchDB has started. Time to relax.
    [info] [<0.32.0>] Apache CouchDB has started on        http://127.0.0.1:5984/

And can see the /var/log/couchdb/couchdb.log

But this:

/etc/init.d/couchdb status
● couchdb.service - LSB: Apache CouchDB init script
  Loaded: loaded (/etc/init.d/couchdb)
   Active: active (exited) since Dom 2015-07-12 15:41:20 WEST; 11min ago
     Docs: man:systemd-sysv-generator(8)

Jul 12 15:41:20 hiro systemd[1]: Starting LSB: Apache CouchDB init script...
Jul 12 15:41:20 hiro couchdb[12366]: * Starting database server couchdb
Jul 12 15:41:20 hiro couchdb[12366]: ...done.
Jul 12 15:41:20 hiro systemd[1]: Started LSB: Apache CouchDB init script.

Appears not working well. And appears a log which i cannot find it's location.

Additionally, the /etc/init.d/couchdb script has this:

DESCRIPTION="database server"
NAME=couchdb
SCRIPT_NAME=`basename $0`
COUCHDB=/usr/bin/couchdb
CONFIGURATION_FILE=/etc/default/couchdb
RUN_DIR=/var/run/couchdb
LSB_LIBRARY=/lib/lsb/init-functions

The CONFIGURATION_FILE points to a no existent file. I tried to change it to /etc/couchdb/default.ini (which is used when i execute couchdb in the terminal) but does not solve the problem.

If i run the couchdb in terminal and open a second terminal and i run netstat -plintu it appears:

tcp        0      0 127.0.0.1:5984          0.0.0.0:*               ESCUTA      21784/beam.smp
  • Are you running the server on your local machine or is it a remote server? – levlaz Jul 11 '15 at 19:21
  • I tried with with ubuntu server 15.04 and ubuntu desktop 15.10. Same results. – kaf Jul 12 '15 at 13:34
  • Can you paste the output of netstat -plntu – levlaz Jul 12 '15 at 14:25
0

I installed in a new web server and this time, the problems disappeared. I do not know what was the problem.

0

to fix this problem ,I edit currently using configuration file suche as default.ini or local.ini by adding the following lines:

[httpd] 
enable_cors=true;  
[cors]
origins=*

you shoud figure out the specific domain by avoding using of * for the sake of security.for examle:

origins= http://yourdomain:port/

For more information,please ref:couchdb configuration reference
wish this is helpful:)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.