[GUI] 404 errors when attempting to access

Ok, a warning: I am an Asterisk n00b. Please be gentle.

Have installed Asterisk via apt-get this evening, and attempted to install asterisk-gui. Asterisk is running successfully, but the GUI keeps returning 404 errors:

[quote]Not Found

The requested URL was not found on this server.
Asterisk Server[/quote]

Asterisk is confirmed as running, and I am able to call and control it from CLI.

Pages are being accessed from a web browser on the machine which Asterisk was installed.

I cannot for the life of me why this keeps occurring, and would appreciate any assistance to find where I have gone wrong to prevent the config pages from loading.

Details of configuration

[li]Install path: /var/lib/asterisk[/li]
[li]Configuration file path: /etc/asterisk/[/li][/ul]

GUI install instructions used: http://www.asteriskguru.com/tutorials/asterisk_gui.html

Machine is running Apache2, but as the 404 error returns Asterisk server in foot I don’t believe it is getting in the way of things.

make checkconfig advises that everything is configured successfully:

[quote]root@grill:~/asterisk-guiap# make checkconfig
— Checking Asterisk configuration to see if it will support the GUI —

  • Checking for http.conf: OK

  • Checking for manager.conf: OK

  • Checking if HTTP is enabled: OK

  • Checking if HTTP static support is enabled: OK

  • Checking if manager is enabled: OK

  • Checking if manager over HTTP is enabled: OK
    — Everything looks good —

  • GUI should be available at grill:8088/asterisk/static/config/index.html

  • Note: If you have bindaddr= in /etc/asterisk/http.conf
    you will only be able to visit it from the local machine.

    Example: localhost:8088/asterisk/static/config/index.html

  • The login and password should be an entry from /etc/asterisk/manager.conf
    which has ‘config’ permission in read and write. For example:

    secret = mysecret26568
    read = system,call,log,verbose,command,agent,config
    write = system,call,log,verbose,command,agent,config

— Good luck! —

http.conf (trimmed to show enabled lines only):

; Whether HTTP/HTTPS interface is enabled or not. Default is no.
; This also affects manager/rawman/mxml access (see manager.conf)
; Address to bind to, both for HTTP and HTTPS. Default is
; Port to bind to for HTTP sessions (default is 8088)


; Asterisk Call Management support

; By default asterisk will listen on localhost only.
displaysystemname = yes
enabled = yes
port = 5038
bindaddr =
enabled = yes
webenabled = yes

; No access is allowed by default.
; To set a password, create a file in /etc/asterisk/manager.d
; use creative permission games to allow other serivces to create their own
; files
;#include “/etc/asterisk/manager.d/manager.conf”


Unfortunately, I can’t offer a solution, but I can confirm that you’re not the only one with the problem as I have the same issue with a setup that’s virtually identical to yours. The only extra information I can offer is that I am definitely talking to the httpd in asterisk and that, based on what strace spits out, it doesn’t appear to even look at the file system (despite enablestatic=yes being set in the http.conf):[pid 22775] read(24, "\r", 1) = 1 [pid 22775] read(24, "\n", 1) = 1 [pid 22775] read(24, "\r", 1) = 1 [pid 22775] read(24, "\n", 1) = 1 [pid 22775] stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=3661, ...}) = 0 [pid 22775] write(24, "HTTP/1.1 404 Not Found\r\nServer: "..., 150) = 150 [pid 22775] write(24, "Content-type: text/html\r\n\r\n<!DOC"..., 274) = 274 [pid 22775] close(24) = 0Once it finishes reading the request, it doesn’t stat or open anything relevant before returning the 404.

Asterisk itself seems happy that http is running:[code]CLI> http show status
HTTP Server Status:
Server Enabled and Bound to

Enabled URI’s:
/httpstatus => Asterisk HTTP General Status
/phoneprov/… => Asterisk HTTP Phone Provisioning Tool
/manager => HTML Manager Event Interface
/rawman => Raw HTTP Manager Event Interface
/static/… => Asterisk HTTP Static Delivery
/mxml => XML Manager Event Interface

Enabled Redirects:
None.[/code]The httpstatus, manager, mxml etc. URLs work fine, accessing /static/ throws up a 403, everything else a 404. I double checked directory and file permissions and am reasonably confident that they’re readable by Asterisk:drwxr-xr-x 6 asterisk asterisk 4096 2011-06-30 15:10 /var/lib/asterisk/static-http/config drwxr-xr-x 3 asterisk asterisk 4096 2011-06-30 15:10 /var/lib/asterisk/static-http drwxrwxr-x 9 asterisk asterisk 4096 2011-06-30 14:53 /var/lib/asterisk drwxr-xr-x 46 root root 4096 2011-06-30 16:29 /var/lib drwxr-xr-x 15 root root 4096 2011-06-29 11:49 /var

After some more tracing and grepping I found the problem (as did many others a posthumous google search revealed). I’m unsure why it didn’t show up in the first trace, but:[pid 4649] stat("/usr/share/asterisk/static-http/index.html", 0x7f394ce43710) = -1 ENOENT (No such file or directory) showed up after some more poking. A simple solution is to move the web data to the right place.