[asterisk-gui] Re: pari: branch aadk r513 - in /branches/aadk:
./ config/
Brandon Kruse
bkruse at digium.com
Wed Mar 28 13:15:18 MST 2007
Ya,
Everyone knows you can run everything from lighthttpd also.
Good luck fitting a whole nothing web server onto a small
embedded platform. Not to mention porting it for that matter.
If your running a solo, high flow REAL computer, not a small
platform embedded envirnment, i agree with you.
Asterisk has a webserver, its not ment to scale/compete like/with apache
whatsoever. That is not what is was made for.
-Brandon
----- Original Message -----
From: "Tzafrir Cohen" <tzafrir.cohen at xorcom.com>
To: asterisk-gui at lists.digium.com
Sent: Wednesday, March 28, 2007 3:06:28 PM (GMT-0600) America/Chicago
Subject: Re: [asterisk-gui] Re: pari: branch aadk r513 - in /branches/aadk: ./ config/
On Thu, Mar 29, 2007 at 12:13:36AM +0700, Dome Charoenyost wrote:
> root is ok because it's embeded.
No. Root is not OK. Why should Asterisk be serving static files anyway?
It does a bad job at this. You don't even have decent access and error
logs.
So the next set would be to set 'enablestatic=no'
Let's use the bad-old apache to handle everything. Apache has a
well-known mod_proxy. It has su_exec, it has directory listing (when you
enable it) and decent logging facilities. So we'll let it server static
content and proxy the manager content.
System:
boomtime, a.k.a. tzafrir_laptop's laptop. Debian Etch with some
experimental asterisk packages (1.4.2, and asterisk-gui).
1. apt-get install lighttpd
2. configure the manager access properly:
;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;; /etc/asterisk/manager.conf:
;;;;;;;;;;;;;;;;;;;;;;;;
[general]
enabled = yes
webenabled = yes
port = 5038
;bindaddr = 127.0.0.1
[tzafrir]
secret = xxxxxxxxxxxxxxxxxxxxxxxxx
;deny=0.0.0.0/0.0.0.0
;permit=209.16.236.73/255.255.255.0
; Authorization for various classes
read = system,call,log,verbose,command,agent,user,config
write = system,call,log,verbose,command,agent,user,config
;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;; /etc/asterisk/http.conf:
;;;;;;;;;;;;;;;;;;;;;;;;
[general]
enabled=yes
enablestatic=no
; Are those necessary?
bindaddr=127.0.0.1
bindport=8088
3. Restart asterisk Check
Sanity check:
http://localhost:8088/asterisk/rawman?action=login
and you should get:
Response: Error
Message: Authentication failed
This means that the manager is listening on port 8088 .
On to configure apache.
In Debian the data dir is /usr/share/asterisk, and is separate from the
varlibdir . The datadir contains files that should be read-only. If
you're into building a small system, keeping this separation may be a
good idea, as it allows you to keep the bulk of the Asterisk files on a
read-only media or at least know that it should not be changed.
The static-http files sit under /usr/share/asterisk/static-http .
4. Install apache:
# Install the package:
apt-get install apache2
# enable some module (debian-specific script)
a2enmod proxy_http rewrite
/etc/init.d/apache2 force-reload
Check that apache2 is installed:
http://localhost/
should redirect you to:
http://localhost/apache2-default/
which says just:
It works!
5. Now let's redirect /asterisk/manager* from port 8088
######################
###################### /etc/apache2/conf.d/asterisk
###################### (take 1)
######################
ProxyPass /asterisk/rawman http://localhost:8088/asterisk/rawman
ProxyPassReverse /asterisk/rawman http://localhost:8088/asterisk/rawman
<LocationMatch /asterisk/rawman*>
Allow from all
</LocationMatch>
Now let's try again to "login" to the manager. This time, through apache:
http://localhost/asterisk/rawman?action=login
6. Let's add in the static files:
######################
###################### /etc/apache2/conf.d/asterisk
###################### (full version)
######################
ProxyPass /asterisk/rawman http://localhost:8088/asterisk/rawman
ProxyPassReverse /asterisk/rawman http://localhost:8088/asterisk/rawman
<LocationMatch /asterisk/rawman*>
Allow from all
</LocationMatch>
Alias /asterisk/static /usr/share/asterisk/static-http
<Directory /usr/share/asterisk/static-http>
Options indexes
</Directory>
--
Tzafrir Cohen
icq#16849755 jabber:tzafrir at jabber.org
+972-50-7952406 mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --
asterisk-gui mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-gui
More information about the asterisk-gui
mailing list