<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Blog of st373n &#187; Asterisk</title>
	<atom:link href="http://blog.easelnet.net/category/asterisk/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.easelnet.net</link>
	<description>Asterisk, ReduxEncoder,  FilmRedux, IRC, ATV, iPhone and more...</description>
	<lastBuildDate>Wed, 10 Feb 2010 02:04:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A Fresh Install</title>
		<link>http://blog.easelnet.net/2008/10/06/a-fresh-install/</link>
		<comments>http://blog.easelnet.net/2008/10/06/a-fresh-install/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 22:23:33 +0000</pubDate>
		<dc:creator>st373n</dc:creator>
				<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[FreePBX]]></category>

		<guid isPermaLink="false">http://localhost/blog/?p=3</guid>
		<description><![CDATA[OK Well fresh install of Leopard 10.5 retail dvd on macbook, the goal to build a clean environment with the usual web bits, php, pear, mysql etc and then the asterisk bits before going on to load it up with usual day to day apps and data.
So first up was the wipe of the harddrive and the [...]]]></description>
			<content:encoded><![CDATA[<p>OK Well fresh install of Leopard 10.5 retail dvd on macbook, the goal to build a clean environment with the usual web bits, php, pear, mysql etc and then the asterisk bits before going on to load it up with usual day to day apps and data.</p>
<p>So first up was the wipe of the harddrive and the install from retail dvd of leopard 10.5, and then the developer tools from the same disk. Next a software update from apple to bring the base os up to date.</p>
<p>Then repeated the software update after a reboot to find any more files, to more updates.</p>
<p>Next up i copied a couple of useful tools from my main machine over to the laptop, Symlinker &#8211; a contextual menu plugin for quickly creating symbolic links of files, and a script to toggle hidden files in Leopard on and off.</p>
<p>No next i couldn&#8217;t recall if when i last installed mysql i had built it from source or not, so this time i downloaded the latest community edition from the mysql website (version 5.0.67-osx10.5-x86) and installed it along with the startup script and system preference pane and widget, the widget was copied across from my main machine., i added the mysql path to my bash_profile with</p>
<p>echo &#8216;export PATH=/usr/local/mysql/bin:$PATH&#8217; &gt;&gt; ~/.bash_profile</p>
<p>in the terminal, then executed the mysql_secure_install script setting a root password and removing remote access to the database and deleting the example database.</p>
<p>php is already installed with leopard now so there was no need to install that, but i did need to edit the apache config to tell it to load php there is only one line to edit in /etc/apache2/httpd.conf and that was to remove the hash from the line loading the php5 module.</p>
<p>next up was to install pear, the php extensions by going to curl pear.php.net | get-pear.php in the terminal, following thru the automated process and just editing three variables when promted to</p>
<li>Installation Prefix set to <code>/usr/local</code></li>
<li>Binaries Directory set to <code>$prefix/bin</code></li>
<li>PHP Code Directory set to <code>$prefix/share/pear</code></li>
<p>then a quick edit of /etc/php.ini to include the path to pear of /usr/local/share/pear</p>
<p>Next installed phpMyAdmin to configure the databases and also leech a download manager.</p>
<p>configured PhpMyAdmin with my mysql details and socket path and logged into it.</p>
<p>created a database for  wordpress and a user for it.</p>
<p>downloaded wordpress and installed it into blog folder.</p>
<p>configuring it  now, ok so has a problem with not being able to connect to mysql, need to resolve that by either editing loads of files to point to where it lives in leopard with apache 2 or fix it a simpler way, well last time i symlinked /tmp/mysql.sock to var/mysql/mysql.sock so i will do that as its quick n easy, and yep all works now ( hence this post to remind me in future when i forget or need to do it all again. )</p>
<p>next up will be to install some more apps, first though growl and appzapper are two of my frequently used.</p>
<p>Well thats it for now so the base install is complete. later this week i will compile and install asterisk on the new system with the goal to get it bundled in one place so its easier to manage, the standard install tend to throw files into lots of different places, im thinking somewhere like /usr/asterisk would be nice for the whole install although thats gona require some hacking around with the build paths.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.easelnet.net/2008/10/06/a-fresh-install/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Asterisk native install in Leopard</title>
		<link>http://blog.easelnet.net/2008/05/17/asterisk-native-install-in-leopard/</link>
		<comments>http://blog.easelnet.net/2008/05/17/asterisk-native-install-in-leopard/#comments</comments>
		<pubDate>Sat, 17 May 2008 17:25:26 +0000</pubDate>
		<dc:creator>st373n</dc:creator>
				<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[FreePBX]]></category>

		<guid isPermaLink="false">http://macpro1.local/blog/?p=34</guid>
		<description><![CDATA[
Below are some posts I made a while back over at nerdvittles regarding my install of asterisk. copied here for archival purposes.
ok if you go to the asterisk.org site and download the 1.2.15 version ( I havnt tried it with 1.4 yet), make sure youve got all the apple developer tools installed, if not get [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>Below are some posts I made a while back over at nerdvittles regarding my install of asterisk. copied here for archival purposes.</p>
<p>ok if you go to the asterisk.org site and download the 1.2.15 version ( I havnt tried it with 1.4 yet), make sure youve got all the apple developer tools installed, if not get them of your system dvd. unzip the files you download into /usr/src/asterisk and then fire up terminal.<br />
in terminal do sudo -s<br />
and enter your root password, this will save you entering sudo b4 every command.<br />
now build asterisk with</p>
<p>cd /usr/src/asterisk<br />
make clean;make;<br />
make install;<br />
make samples</p>
<p>if all is well asterisk is now built and installed,<br />
to start it you can use the command line, but i prefer a on/off swith on my desktop and so i use a application called Asterisk Launcher from sunrise.</p>
<p>That should get you a basic virgin asterisks installed and running you will have to edit the config by hand inless you going to install the freepbx gui.</p>
<p>if you want to do that to similar steps are involved but before you start create a new user called asterisk on you system and set apache to run as asterisk not as www in the apache httpd.conf file.<br />
then download freepbx gui copy the files to the websharing folder you want them to be served from, you will need to manually edit the configs of freepbx to point to your folder name and location.<br />
You will need mysql installed so get the package from marc lineage website as its a nice double-click to install what you need in tiger.<br />
if you’ve got this far you should now just follow the instructions that come with freepbx to build and install that part of it.</p>
<p>&#8211;</p>
<p>ok well pear was a pain, but easiest solution i cam up with was in terminal enter this as sudo<br />
curl <a rel="nofollow" href="http://go-pear.org/">http://go-pear.org</a> | php<br />
this will download and start the pear installer, again check the paths when in prompts to and point them to where youve installed php.<br />
Choose yes to install the included pear packages<br />
when installed is completed in terminal enter:<br />
pear install DB<br />
wait for it to download and complete<br />
then do the ./install_amp but to complete freepbx install</p>
<p>&#8211;</p>
<p>ok well have just reinstalled from scratch onto g4 powerbook this time blogged as i went so for those still interested i’ve pasted the entry here until my own blog goes up.</p>
<p>The Powerbook is a G4 1.67 with 1.5GB of Ram, Tiger 10.4.10 is the installed OS, with the following Apache 2.24 compiled from source to replace Apache 1.3 that apple ship, Mysql 5.0.45 again compiled form source and PHP 5.2.3, also installed / updated are PEAR with DB &amp; Bison. The software as i said was all compiled from source so you can guess that also installed is XCode 2.3. The location that i built the software to install into is usr/local/apache2 &amp; usr/local/mysql and usr/local/apache2/php. Some symbolic links were made to replace the apple versions so that tiger works correctly with them in place and apachectl was also linked to the new apache2 so that i can turn it on and off from web sharing in system preferences.</p>
<p>Ok so with the base system out of the way here are the steps I used to get Asterisk installed on Mac OS X with the FreePBX GUI.</p>
<p>These are the versions of the source i got that worked, ive tried older and newer version without success.</p>
<p>Asterisk-1.2.17</p>
<p>Asterisk-addons-1.2.5</p>
<p>Asterisk-sounds-1.2.1</p>
<p>FreePBX 2.2.2</p>
<p>Expanded the asterisk files into three folders asterisk1217, addons125 and sounds121</p>
<p>Moved those three folders into /usr/local/sources/asterisk/</p>
<p>Open up Terminal and sudo -s [Enter Admin Password]</p>
<p>cd /usr/local/sources/asterisk/asterisk1217</p>
<p>make<br />
make install<br />
make samples</p>
<p>ok thats got the base asterisk installed now change folders to the addons, so we can cd.. and cd asterisk-addons-125<br />
folow that with a make<br />
and then a make install</p>
<p>and do the same for the sounds<br />
cd..<br />
cd asterisk-sounds-121<br />
make install</p>
<p>Ok if thats all done then asterisk is fully installed and ready to go, but we want to add the freePBX GUI to it so its easier to configure. Before I do that i will just quickly fire up asterisk to make sure it loads, so asterisk -vvvvcdgi and i get nice output from asterisk in the terminal as it starts, good, now to shut it down with stop now. Excellent all working so far so good.</p>
<p>Next up grab the source for freePBX, i got freePBX 2.2.2 as that was the latest version on the site, [ Note to self try FreePBX 2.3 &amp; check for diffs ].</p>
<p>Now expand the freePBX tar into a /usr/local/sources/freePBX.</p>
<p>Before installing freePBX we need to prepare the MySQL databases it will require, the two files that have the info we want are in the SQL folder in freePBX folder,<br />
they are cdr_mysql_table.sql and newinstall.sql</p>
<p>Ok I have phpmyadmin installed on my setup ( you can do it from the terminal if you want ) and i need to create to mysql databases one called asterisk and one called asteriskcdrdb, so in phpMyAdmin enter asterisk into the create database box and click create, dont worry about making a table yet just return to the index page again and make the next database called asteriskcdrdb</p>
<p>Next import the data from the two .sql files into the corresponding database, i prefer to do this by running a sql query as sometimes importing files can cause phpmyadmin to hang, to im going to just open the newinstall.sql file in textedit then choose select all and copy, switch over to phpmyadmin and choose the asterisk database with that selected click on the sql tab and paste the content of the newinstall.sql file into the query box, hit go and seconds later you should have 17 or so tables in that database. Now do the same for the cdr-mysql-table.sql file.</p>
<p>OK return to the index page of phpmyadmin as we now need to set up the correct permissions for those two databases.<br />
create a user called asterisk with a password of your choice ( the default is AMP109 ) and grant database-specific privileges to databases asterisk and asteriskcdrdb, i also specified only localhost in the hosts allowed to connect, to secure it even further but you may or may not want to do that.</p>
<p>Now restart mysql.</p>
<p>OK so nearly ready to install freepbx, but before lets just make a note of some paths we might need, when freepbx installs it will prompt you for the location to various folders such as your httpd docs folder and the cgi-bin folder, now on tiger these are in different locations to most other systems even if your using the apple defaults, [note were using apache2 and thats in a completely different location]</p>
<p>So my www path is /usr/local/apache2/htdocs/freepbx ( the apple default is /Library/Webserver/Documents )<br />
my cgi-bin is /usr/local/apache2/cgi-bin ( the apple default is /Library/Webserver/CGI-Executables )<br />
and i want FOP at /usr/local/apache2/htdocs/freepbx/panel</p>
<p>If you want your files in a different place or you have installed apache into /opt rather than /usr/local/apache2 you will need to lookup your paths now.</p>
<p>ok so once you know the paths lets cd to the freepbx source and ./install_amp remember you need to be sudo so if your opening a new terminal window do a sudo -s and enter your password before ./install_amp</p>
<p>The first question we get asked is for the USERNAME to connect to the asterisk database, just hit enter unless you have changed if to something other than asterisk</p>
<p>Next enter the password you created if you didnt use the default of AMP109 otherwise just hit enter</p>
<p>Next just hit enter for the hostname as mysql and asterisk are running on the same machine &#8211; obviousaly if this is not the case for you then enter the correct hostname here instead.</p>
<p>Now for the USERNAME for the Asterisk manager interface just hit enter as were using the default &#8211; again if your not change it to what your using.</p>
<p>And do the same for the PASSWORD for the Asterisk manager interface.</p>
<p>Now comes the paths to check carefully before hitting enter,<br />
enter the path for the AMP ( FreePBX ) web-root folder, i choose /usr/local/apache2/htdocs/freepbx as i want a folder called freepbx with all the files in it on my webserver, you can call your folder anything but get the start of the path pointing to the right place or there will be problems.</p>
<p>Next enter the IP address of the machine, mine has a static address of 192.168.25.130 so i could enter that but im going to enter the localhost address of 127.0.0.1 just incase i want to change my actual ip later. you could also just enter localhost or even powerbook.local or whatever you hostname is.</p>
<p>Now enter a flash operator panel password or leave it set to the default of passw0rd by hitting enter, i hit enter</p>
<p>Next hit enter to accept extensions ( this way phones and users are administered from the same page )</p>
<p>Again hit enter to store the exe’s in the /var/lib/asterisk/bin or change it if you want it elsewhere, again im hitting enter to use the default.</p>
<p>Do the same for super-user scripts at /usr/local/sbin just hit enter</p>
<p>FreePBX should now install, there will be a few permission errors at the end of the install but dont panic freepbx is installed and well fix the errors in a moment.</p>
<p>Ok so in the finder do a get info on your freepbx web root mine is /usr/local/apache2/htdocs/freePBX in the Ownership &amp; Permissions section of the Info window set the Owner to your user accound and set read &amp; write as the Access level, set the Group to WWW and the Access to read &amp; write and set Others to read &amp; write.</p>
<p>Ok so thats not very secure, but without changing apache to run as a different user and running into a bunch of other problems ( that i’ve experenced over the last year playing with this stuff ) im happy with that as my machine can only be access locally anyway.</p>
<p>Repeat those permission and owner settings for the following files and folders</p>
<p>/var/lib/asterisk &#8211; and choose Apply to enclosed items at the bottom of the info window</p>
<p>/var/spool/asterisk &#8211; and choose Apply to enclosed items at the bottom of the window</p>
<p>/etc/amportal.conf</p>
<p>/etc/asterisk &#8211; and choose Apply to enclosed items at the bottom of the windownow in the terminal goto /var/lib/asterisk/bin and chmod 777 *.pl this sets all the perl files to executable, and also chmod 777 retrieve_conf , to make that file executable too.</p>
<p>/var/lib/asterisk/agi-bin &#8211; and chmod 777 dialparties.agi and recordingcheck.agi</p>
<p>now execute ./retrieve_conf to make those files that the permission was denied for just a moment ago when we ran the install_amp script.</p>
<p>Now fire it up asterisk -vvvvcgdi</p>
<p>and in safari <a rel="nofollow" href="http://localhost/freePBX">http://localhost/freePBX</a></p>
<p>So there is only one problem remaining in that clicking the red bar does not reload the configuration file &#8211; for some reason retrieve_conf is not being executed so remember to manually run that after making changes in the freePBX interface. when i find a solution to that last problem i will post it here.</p>
<p>But for now<br />
Success ! A working system.</p>
<p>&#8211;</p>
<p>OK, so Leopard has arrived, installed yesterday. so now on with Asterisk &amp; FreePBX.<br />
Here’s the steps needed, these were done with an Erase &amp; Install of Leopard so if youve upgraded from Tiger there may be other probs, but post here and i will try and hep!</p>
<p>Install Developer Tools &amp; a text editor i choose textwrangler</p>
<p>Edit /etc/apache2/httpd.conf and remove the # from the line that says LoadModule php5_module</p>
<p>Install Mysql 5.0.45 from mysql.com ( or compile it if you choose)<br />
Install mysql startup item &#8211; but not the pref pane as its not leopard compatible.</p>
<p>In terminal open new window and do a sudo -s and enter admin password then do:<br />
chown -R mysql /usr/local/mysql/data<br />
echo ‘export PATH=/usr/local/mysql/bin:$PATH’&gt;&gt;~/.bash_profile<br />
(This adds mysql commands to your prompt)<br />
mysqld_safe &amp;<br />
(start up mysql)<br />
mysql_secure_installation<br />
(secure mysql answer the prompts as you desire)</p>
<p>Download and install phpMyAdmin ( i used version 2.8.2.4)<br />
Download and install SymbolicLinker.plugin ( this is a contextual menu item &#8211; i will post links to my site with all the files req later)</p>
<p>Setup SSL ( optional &#8211; see apple <a rel="nofollow" href="http://developer.apple.com/internet/serverside/modssl.html">http://developer.apple.com/internet/serverside/modssl.html</a>*** if you do this note that the apple instructions are for Tiger &#8211; on Leopard copy the certificates to /etc/apache2/sslkey NOT etc/httpd )</p>
<p>install pear &#8211; (**note its no longer go-pear.php)<br />
so in terminal do # curl <a rel="nofollow" href="http://pear.php.net/go-pear">http://pear.php.net/go-pear</a> | php<br />
and then # pear install DB<br />
Now make a copy of your php.ini file in /etc/php.ini.defaults called /etc/php.ini<br />
open this file in textwrangler and change the line include_path to include_path=”.:/usr/local/share/pear”<br />
save the file and restart websharing in system preferences.</p>
<p>Next download Server Admin tools 10.5 from Apple website and install it.<br />
Open up workgroup manager and create a group and user called asterisk.</p>
<p>Download Asterisk 1.2.24, Asterisk addons and asterisk sounds.</p>
<p>cd to your downloaded asterisk folder<br />
do a make<br />
then a make install<br />
then cd to asterisk addons<br />
and do a make<br />
and a make install<br />
then cd to asterisk sounds<br />
and do a make install</p>
<p>Next fix the mysql links that are not quite right, mysql is at /usr/local/mysql/lib but apache is looking for them at /usr/local/mysql/lib/mysql so make a folder called mysql inside /usr/local/mysql/lib and symlink the contents of mysql into it.<br />
be careful to copy the contents and not the folder or you will double nest it.</p>
<p>Also the socket for mysql is wrong in apache to, its looking for it at /var/mysql/mysql.sock when infact its been installed at /etc/tmp/mysql.sock so just make a symlink again to that location.</p>
<p>remove the module res_odbc.so from /usr/lib/asterisk as it causes an error that stops asterisk starting on leopard and were using mysql anyway so we dont need it &#8211; (i may look for a solution to this at some time).</p>
<p>ok so thats got asterisk installed on Leopard,</p>
<p>fire up asterisk with asterisk vvvvdgi.</p>
<p>The latest version 2.3.1 needs a lot of work to get going so im going to install version 2.2.2 as this installs without problems.</p>
<p>download it form sourceforge and cd to that folder<br />
do a ./install_amp in the terminal<br />
be sure to set the amp web root to /Library/WebServer/Document/fpbx<br />
(or replace fpbx with your choice)<br />
chown www -R /Library/Webserver/Documents/fpbx<br />
chgrp www -R /Library/Webserver/Documents/fpbx<br />
chown www /etc/amportal.conf<br />
chgrp www /etc/amportal.conf<br />
and i also added my user account to the file permission in the finder get info box for that file and the fpbx folder.<br />
open up safari and goto localhost/fpbx<br />
start configuring your pbx <img class="wp-smiley" src="http://nerdvittles.com/wp-includes/images/smilies/icon_smile.gif" alt=":)" /></p>
<p>one last thing needed is the perl modules DBI and DBD::mysql</p>
<p>open terminal and type perl -v to make sure perl is installed it should be by default.<br />
Then type cpan<br />
then force install DBI<br />
then force install DBD::mysql<br />
then chmod 777 /var/lib/asterisk/bin/.retreive_conf<br />
then cd /var/lib/asterisk/bin/<br />
then chmod 777 *.pl<br />
now clicking on the red bar in freepbx reload the configs from mysql correctly.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.easelnet.net/2008/05/17/asterisk-native-install-in-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
