Hi, I have been doing various testing with asterisk and its been going great. However I am a bit feedup of using vi for editing configs, and would rather do it from any machine on my LAN. I am running debian and * via xorcom rapid on a test PC at the minute. Hence phpconfig would be great, however I am having difficulty getting it to work. I have searched the message boards and the wiki, and found nothing of help for this problem :( I have a full working apache/php setup (default install) and have added the phpconfig files to the www dir, and they are accessible over the LAN. So far so good. I Can read the files fine. However I cannot write any files, I get the error: User: admindoes not have access to this feature. Write failed! I tried messing with the CHMOD settings of the files but no joy. My manager.conf looks like: ; ; Asterisk Call Management support ; [general] enabled = yes port = 5038 bindaddr = 0.0.0.0 [admin] secret = secret ;deny=0.0.0.0/0.0.0.0 ;permit=209.16.236.73/255.255.255.0 read = system,call,log,verbose,command,agent,user write = system,call,log,verbose,command,agent,user I can successfully telnet into the manager interface through shell on the local machine and winxp machine on the LAN I have moved asterisk.reload into /bin, and if I run it from the shell I get a successful? Output: pbx01:~# /bin/asterisk.reload Asterisk Call Manager/1.0 Can anyone help? It is the same error the online example gives. Is it something to do with specific admin rights in xorcom, or have I missed something fundamentally wrong out? I have checked the php files and the paths seem to be OK (default * installs) I have a couple of ideas as to the problem: -PHP needs something enabled e.g safemode? -Xorcom has changed something phpconfig needs e.g * not running as root or something? Many Thanks, C
C. Tomlinson wrote:> I have been doing various testing with asterisk and its been going great. > However I am a bit feedup of using vi for editing configs, and would rather > do it from any machine on my LAN.Look at WinSCP: http://www.winscp.org/ which is a lovely program that initially purports to provide easier file transfer, but which has some very useful tricks up its sleeve - including editing remote files in place. It is (almost) worth installing Windows just to be able to use it. :-) If anyone knows of anything similar that runs under Linux please enlighten me! Richard
Richard, I have been using WinSCP to transfer files across easily without messing with FTP accounts. I had not found that feature, many thanks for pointing it out :-D I will definitely use this from now on until I find a better solution. Do you have an easy way to reload asterisk after changing the files? Have putty open to do a reload? Or use the builtin terminal capabilities of WinSCP? This is a great fix as my main machine is currently Windows. However I would still like to get phpconfig working as it would be easier to use that across the internet etc. Thanks Again. -----Original Message----- From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Richard Folwell Sent: 25 February 2005 13:44 To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [Asterisk-Users] FW: Getting PHP Config to work? C. Tomlinson wrote:> I have been doing various testing with asterisk and its been going great. > However I am a bit feedup of using vi for editing configs, and wouldrather> do it from any machine on my LAN.Look at WinSCP: http://www.winscp.org/ which is a lovely program that initially purports to provide easier file transfer, but which has some very useful tricks up its sleeve - including editing remote files in place. It is (almost) worth installing Windows just to be able to use it. :-) If anyone knows of anything similar that runs under Linux please enlighten me! Richard _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
have a look at Quanta. It has a FISH protocol. Basically, open the file as fish://ip.add.re.ss/path/to/file.conf Edit the file and save. This is a very nice editor with highlighting for several languages. -Herman On Fri, 2005-02-25 at 15:44, Richard Folwell wrote:> C. Tomlinson wrote: > > I have been doing various testing with asterisk and its been going great. > > However I am a bit feedup of using vi for editing configs, and would rather > > do it from any machine on my LAN. > > Look at WinSCP: > > http://www.winscp.org/ > > which is a lovely program that initially purports to provide easier file > transfer, but which has some very useful tricks up its sleeve - > including editing remote files in place. > > It is (almost) worth installing Windows just to be able to use it. :-) > If anyone knows of anything similar that runs under Linux please > enlighten me! > > Richard > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
Richard Folwell wrote:> > Look at WinSCP:<snip>> It is (almost) worth installing Windows just to be able to use it. :-) > If anyone knows of anything similar that runs under Linux please > enlighten me!Have a look at the fish io-slave for KDE. Type fish://user@host in your Konqueror URL-bar and see what happens :) -- Eivind Trondsen | IT-infrastruktur LinuxLabs AS | IP-telefoni | Fri programvare
If you are using windows, have a look at Zend Studio that is used for PHP but can do wonders for other editing apps as well. -herman On Fri, 2005-02-25 at 15:52, C. Tomlinson wrote:> Richard, > > I have been using WinSCP to transfer files across easily without messing > with FTP accounts. I had not found that feature, many thanks for pointing it > out :-D > > I will definitely use this from now on until I find a better solution. Do > you have an easy way to reload asterisk after changing the files? Have putty > open to do a reload? Or use the builtin terminal capabilities of WinSCP? > > This is a great fix as my main machine is currently Windows. However I would > still like to get phpconfig working as it would be easier to use that across > the internet etc. > > Thanks Again. > > -----Original Message----- > From: asterisk-users-bounces@lists.digium.com > [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Richard > Folwell > Sent: 25 February 2005 13:44 > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: Re: [Asterisk-Users] FW: Getting PHP Config to work? > > C. Tomlinson wrote: > > I have been doing various testing with asterisk and its been going great. > > However I am a bit feedup of using vi for editing configs, and would > rather > > do it from any machine on my LAN. > > Look at WinSCP: > > http://www.winscp.org/ > > which is a lovely program that initially purports to provide easier file > transfer, but which has some very useful tricks up its sleeve - > including editing remote files in place. > > It is (almost) worth installing Windows just to be able to use it. :-) > If anyone knows of anything similar that runs under Linux please > enlighten me! > > Richard > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
> I have been doing various testing with asterisk and its been going great. > However I am a bit feedup of using vi for editing configs, and would rather > do it from any machine on my LAN. I am running debian and * via xorcom rapid > on a test PC at the minute.I had the same problem. So I did a simple PHP page that let me do this. You can grab it here : http://www.marccharbonneau.com/asterisk/asweadto_0_1_1.tar That was before I discovered phpconfig. That doesn't say I won't continue working on mine :)> However I cannot write any files, I get the error: > > User: admindoes not have access to this feature. > Write failed!I found some errors in phpconfig. Open the file cls_phpconfig.php In the function OC_readConfFile around line 131 change : $this->_OC_the_file[] = fgetc($file); to : $this->_OC_the_file[] = fgets($file); In the function OC_checkAccess around line 438 change : $accessFile[] = fgetc($file); to : $accessFile[] = fgets($file); fgetc read one character at a time. fgets read one line at a time.>I have moved asterisk.reload into /bin, and if I run it from the shell I getYou don't have to move it to /bin. You can just do this simple modification to have it run from the same place as the pages Open the file phpconfig.php Look for : $reset_cmd = "asterisk.reload" and change to $reset_cmd = "./asterisk.reload" You should be running fine with this. If not, let me know, I may have forgot something
> ; > [general] > enabled = yes > port = 5038 > bindaddr = 0.0.0.0 > > [admin] > secret = secret > ;deny=0.0.0.0/0.0.0.0 > ;permit=209.16.236.73/255.255.255.0Do this in manger.conf, where xxx.xxx.xxx.0 represents your network: [admin] secret = secret permit=xxx.xxx.xxx.0/255.255.255.0 read = system,call,log,verbose,command,agent,user write = system,call,log,verbose,command,agent,user To get the reload script running, you must allow apache (or the account apache runs under) to execute scripts. Therefore use visudo (in Fedora) to add the following line in /etc/sudoers apache ALL=(ALL) NOPASSWD: ALL To write the config files in /etc/asterisk with phpconfig.php you need to give apache the rights to do so. A simple chmod -R a+w /etc/asterisk should do the job. I know, there are more secure methods to do this, but it works for us. Guido Hecken
> I found some errors in phpconfig. Open the file cls_phpconfig.php > > In the function OC_readConfFile around line 131 > change : $this->_OC_the_file[] = fgetc($file); > to : $this->_OC_the_file[] = fgets($file); > > In the function OC_checkAccess around line 438 > change : $accessFile[] = fgetc($file); > to : $accessFile[] = fgets($file); > > fgetc read one character at a time. fgets read one line at a time. > > >I have moved asterisk.reload into /bin, and if I run it from the shell Iget> You don't have to move it to /bin. You can just do this simple > modification to have it run from the same place as the pages > Open the file phpconfig.php > Look for : $reset_cmd = "asterisk.reload" > and change to $reset_cmd = "./asterisk.reload"Some time ago, I had the same probs with phpconfig and had to search and google quite a long time to get it running. Since our systems are now running fine with phpconfig, I simply forgot the above fgetc/fgets issue. Therefore... A wonderful place for all this would be the wiki ;-) Guido Hecken
> Some time ago, I had the same probs with phpconfig and had to search and > google quite a long time to get it running. Since our systems are now > running fine with phpconfig, I simply forgot the above fgetc/fgets issue. > Therefore... > A wonderful place for all this would be the wiki ;-)Better yet, update the CVS with the correction. How would I go about that ?
Thanks to all your help I have now got it working great. I have written a quick howto which I plan to add to the wiki if people approve? Take a look at: http://www.burntwires.com/asterisk/Install%20PHP%20Config.htm (Please excuse the bloated html....) Please leave any feedback and then I will add to the wiki. C -----Original Message----- From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of C. Tomlinson Sent: 25 February 2005 13:32 To: asterisk-users@lists.digium.com Subject: [Asterisk-Users] FW: Getting PHP Config to work? Hi, I have been doing various testing with asterisk and its been going great. However I am a bit feedup of using vi for editing configs, and would rather do it from any machine on my LAN. I am running debian and * via xorcom rapid on a test PC at the minute. Hence phpconfig would be great, however I am having difficulty getting it to work. I have searched the message boards and the wiki, and found nothing of help for this problem :( I have a full working apache/php setup (default install) and have added the phpconfig files to the www dir, and they are accessible over the LAN. So far so good. I Can read the files fine. However I cannot write any files, I get the error: User: admindoes not have access to this feature. Write failed! I tried messing with the CHMOD settings of the files but no joy. My manager.conf looks like: ; ; Asterisk Call Management support ; [general] enabled = yes port = 5038 bindaddr = 0.0.0.0 [admin] secret = secret ;deny=0.0.0.0/0.0.0.0 ;permit=209.16.236.73/255.255.255.0 read = system,call,log,verbose,command,agent,user write = system,call,log,verbose,command,agent,user I can successfully telnet into the manager interface through shell on the local machine and winxp machine on the LAN I have moved asterisk.reload into /bin, and if I run it from the shell I get a successful? Output: pbx01:~# /bin/asterisk.reload Asterisk Call Manager/1.0 Can anyone help? It is the same error the online example gives. Is it something to do with specific admin rights in xorcom, or have I missed something fundamentally wrong out? I have checked the php files and the paths seem to be OK (default * installs) I have a couple of ideas as to the problem: -PHP needs something enabled e.g safemode? -Xorcom has changed something phpconfig needs e.g * not running as root or something? Many Thanks, C _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
I had a look but $100 seems a bit steep to me at the minute! C -----Original Message----- From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Herman Cremer Sent: 25 February 2005 14:07 To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: RE: [Asterisk-Users] FW: Getting PHP Config to work? If you are using windows, have a look at Zend Studio that is used for PHP but can do wonders for other editing apps as well. -herman On Fri, 2005-02-25 at 15:52, C. Tomlinson wrote:> Richard, > > I have been using WinSCP to transfer files across easily without messing > with FTP accounts. I had not found that feature, many thanks for pointingit> out :-D > > I will definitely use this from now on until I find a better solution. Do > you have an easy way to reload asterisk after changing the files? Haveputty> open to do a reload? Or use the builtin terminal capabilities of WinSCP? > > This is a great fix as my main machine is currently Windows. However Iwould> still like to get phpconfig working as it would be easier to use thatacross> the internet etc. > > Thanks Again. > > -----Original Message----- > From: asterisk-users-bounces@lists.digium.com > [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Richard > Folwell > Sent: 25 February 2005 13:44 > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: Re: [Asterisk-Users] FW: Getting PHP Config to work? > > C. Tomlinson wrote: > > I have been doing various testing with asterisk and its been goinggreat.> > However I am a bit feedup of using vi for editing configs, and would > rather > > do it from any machine on my LAN. > > Look at WinSCP: > > http://www.winscp.org/ > > which is a lovely program that initially purports to provide easier file > transfer, but which has some very useful tricks up its sleeve - > including editing remote files in place. > > It is (almost) worth installing Windows just to be able to use it. :-) > If anyone knows of anything similar that runs under Linux please > enlighten me! > > Richard > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users_______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
-----Original Message----- From: C. Tomlinson [mailto:asterisk_list@burntwires.com] Sent: 26 February 2005 11:39 To: 'Asterisk Users Mailing List - Non-Commercial Discussion' Subject: RE: [Asterisk-Users] FW: Getting PHP Config to work? Hi Tzafrir, I do accept that there are many security issues with this setup. I am fairly ignorant of the exact problems due to my lack of knowledge. However I agree with the post in the previous thread: "If the asterisk server is reachable from the outside over http or other unsecure protocols, it would be really dangerous. But in a trusty intranet-environment, where firewalls block every attempt to access the asterisk server from the outside, this "solution" should be save enough, even if nothing is really save enough ;-) . Guido Hecken" What exactly do you mean by an sftp based setup? Is this like the builtin editor in WinSCP? Phpconfig allows me to change the config by any pc on my LAN, using windows, mac, pocket pc(have to test this one) etc. This is handy for me for testing. I like the flexibility it gives me. The * box is behind a NAT firewall, the only ports open being those for IAX. If I setup a VPN in the future I will be able to access the phpconfig files securely (?) via that. It may not suite everyone. Maybe the 777 CHMOD could be done better, but this was the way it worked for me. I am fairly new to Linux and *, so my methods will not be the best. Thanks for all the information....if I get to a production box I will probably not use phpconfig! -----Original Message----- From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Tzafrir Cohen Sent: 25 February 2005 18:31 To: asterisk-users@lists.digium.com Subject: Re: [Asterisk-Users] FW: Getting PHP Config to work? On Fri, Feb 25, 2005 at 04:43:50PM -0000, C. Tomlinson wrote:> Hi, > > Thanks for the batchfile type, it's a handy one. > > I'm not editing over the internet, just local LAN for testing ATM.Protected> via firewall. > > Would it not be fairly secure using a combination of the following: > .htaccess file > VPN? > https access? > Limit apache to only allow certain IP's? > And the public keys thing.Secure agains what? What are the threats you consider? VPN and/or limit of IP addresses (in iptables or in apache's config) would serve to allow access only from certain addresses. But is this a relaistic limitation? I thout you wanted to be able to edit the configuration from various hosts. If this is only your setup, then an sftp-based setup is probably more convinient. Using a .htaccess file (or even better: an apache config snippet in /etc/apache/conf.d )you can force authentication to get to this directory. But then-again, you empower the apache user (www-data) to configure and control asterisk, and thus if anybody manages to make your web server execute an arbitrary script (e.g: can write to a .php file under the wwwroot) they can make asterisk execute arbitrary code as well. The chmod command makes Asterisk's configuration world-writable. So anybody with temporary write access to your system can again change asterisk's configuration. This breaks a general sanity assumption that only system users can write to the configuration. As a rule of thumb such a chmod should generally be replaced by adding a certain user to a certain group. You also change the permissions to the asterisk reload script to 777. Why does it need to be world-writable? This gives an attacker yet another place to inject executable code. In short: I still fail to see the atvantages of using phpconfig in your settings. -- Tzafrir Cohen | New signature for new address and | VIM is http://tzafrir.org.il | new homepage | a Mutt's tzafrir@cohens.org.il | | best ICQ# 16849755 | Space reserved for other protocols | friend _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Try using the url http://ip-of-machine/phpconfig/phpconfig.php On Thu, 3 Mar 2005 12:45:03 +0300 (EAT), Julius Kidubuka <juki@one2net.co.ug> wrote:> Hi, > > I have just tried to get phpconfig to work but to no avail. In my browser > I type; http://ip-of-machine/phpconfig/ and this returns the following > output; > > Index of /phpconfig > Name Last modified Size Description > -------------------------------------------------------------------------------- > Parent Directory 03-Mar-2005 12:15 - > asterisk.reload 03-Mar-2005 12:28 1k > cls_phpconfig.php 03-Mar-2005 11:48 14k > cls_phpconfig_html.php 03-Mar-2005 11:55 17k > images/ 24-Feb-2005 09:06 - > phpconfig.php 14-Sep-2003 19:32 6k > phpconfig_init.php 03-Mar-2005 11:44 2k > > -------------------------------------------------------------------------------- > > Apache/1.3.33 Server at ip-of-machine Port 80 > > I have made the necessary changes to all the files in the phpconfig > directory and my DocumentRoot is set to "/usr/local/www/". To add to this, > I have php4-4.3.10_1 and apache+mod_ssl-1.3.33+2.8.22 installed on my > Asterisk box. > > What could I be doing wrong? > > Thanks in advance! > > Rgds, > Julius. > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
DO you have apache2-mod_php installed ? Which distro are you using ?> -----Original Message----- > From: asterisk-users-bounces@lists.digium.com > [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of > Julius Kidubuka > Sent: 03 March 2005 11:45 AM > To: asterisk_list@burntwires.com > Cc: asterisk-users@lists.digium.com > Subject: [Asterisk-Users] Getting phpconfig to work? > > Hi, > > I have just tried to get phpconfig to work but to no avail. > In my browser I type; http://ip-of-machine/phpconfig/ and > this returns the following output; > > Index of /phpconfig > Name Last modified Size Description > -------------------------------------------------------------- > ------------------ > Parent Directory 03-Mar-2005 12:15 - > asterisk.reload 03-Mar-2005 12:28 1k > cls_phpconfig.php 03-Mar-2005 11:48 14k > cls_phpconfig_html.php 03-Mar-2005 11:55 17k > images/ 24-Feb-2005 09:06 - > phpconfig.php 14-Sep-2003 19:32 6k > phpconfig_init.php 03-Mar-2005 11:44 2k > > > -------------------------------------------------------------- > ------------------ > > Apache/1.3.33 Server at ip-of-machine Port 80 > > > I have made the necessary changes to all the files in the > phpconfig directory and my DocumentRoot is set to > "/usr/local/www/". To add to this, I have php4-4.3.10_1 and > apache+mod_ssl-1.3.33+2.8.22 installed on my Asterisk box. > > What could I be doing wrong? > > Thanks in advance! > > Rgds, > Julius. > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users > >
Hi Again, I used my phpconfig setup for a week, and found it a great timesaver for me :-) However I have just gone and broken it, and can't seem to 'fix' it. I was running a xorcom rapid installation, but converted to a semi-standard debian by changing the apt sources; so I could install a couple of extra things. I did apt-setup and choose British FTP sites I did apt-get dist-upgrade which installed a lot of stuff.... However this changed my box rather more than I was expecting.... for example it installed caudium as a web server, when I already have apache. I removed that via apt-get --purge remove caudium And after a couple of tweaks, I now have apache running again fine (as far as I can tell), and all my other web things work fine. However now I cannot even browse a .conf file via phpconfig. When clicking on the file I get the following error: Warning: fopen(/etc/asterisk/iax.conf): failed to open stream: Permission denied in /var/www/phpconfig/cls_phpconfig.php on line 127 I have gone over the wiki page, done chmod again etc, but nothing makes a difference. Does anybody have any ideas? Thanks C