Yate Community Forum

OpenLTE => YateBTS => Topic started by: nurwalid on March 12, 2015, 08:51:57 PM

Title: [SOLVED] Error !! Could not open for writing on NIB (Regexp)
Post by: nurwalid on March 12, 2015, 08:51:57 PM
I am using Ubuntu 14.04 LTS and USRP2 N210 with UHD.

(http://i1237.photobucket.com/albums/ff477/Nurwalid_Ina/PA/Screenshot%20from%202015-03-13%20094024.png) (http://s1237.photobucket.com/user/Nurwalid_Ina/media/PA/Screenshot%20from%202015-03-13%20094024.png.html)

(http://i1237.photobucket.com/albums/ff477/Nurwalid_Ina/PA/Screenshot%20from%202015-03-13%20095427.png) (http://s1237.photobucket.com/user/Nurwalid_Ina/media/PA/Screenshot%20from%202015-03-13%20095427.png.html)
I want to save regexp, but failed.

"Error !! Could not open file for writing"

what should i do for this error?

-thx-



Title: Re: Error !! Could not open for writing on NIB (Regexp)
Post by: Monica Tepelus on March 13, 2015, 03:02:26 AM
Hi,

Please make sure that the apache user has read/write rights in /usr/local/etc/yate where subscribers.conf is located.

You can run as root:
chmod a+rw /usr/local/etc/yate/

Also, make sure you don't have selinux or something similar that prevents apache to access other parts of the file system.
Title: Re: Error !! Could not open for writing on NIB (Regexp)
Post by: nurwalid on March 13, 2015, 03:24:25 AM
Hi Monica

i've done and sure with the permission.

and how do I know, i don't have selinux or something similar that prevents apache to access other parts of the file system?
Title: Re: Error !! Could not open for writing on NIB (Regexp)
Post by: Monica Tepelus on March 16, 2015, 02:41:59 AM
Hi,

You should enable the displaying of errors in php.ini:

display_errors = On
error_reporting = E_ALL | E_STRICT

Check on google if your distro has selinux or something similar.

Title: Re: Error !! Could not open for writing on NIB (Regexp)
Post by: nurwalid on March 16, 2015, 03:16:34 AM
Hi monica.. Thanks for your answer.. My problem has been finished ..

Web browser must be on root mode for this problem..
Title: Re: Error !! Could not open for writing on NIB (Regexp)
Post by: asymetrixs on March 22, 2015, 04:24:42 AM

You can run as root:
chmod a+rw /usr/local/etc/yate/


No, don't do that. If you need the yate-user and the apache-user to access this file, create a new group e.g. apacheyate, put both users in that group and give that group permission to change the file. if you use a+rw then everybody can modify the file and you don't want that e.g. if you have several users who can access the server or your server gets hacked.


Should work like this:
Code: [Select]
// add group
addgroup  apacheyate

// add existing users for apache and yate to that group
useradd -G apacheyate apache
useradd -G apacheyate yate

// give group access to the file
chgrp apacheyate /usr/local/etc/yate where subscribers.conf

// give group permission on the file
chmod g+rw /usr/local/etc/yate where subscribers.conf

// remove write for all other users that are not owner of or in same group as file
chmod a-wx /usr/local/etc/yate where subscribers.conf

Title: Re: Error !! Could not open for writing on NIB (Regexp)
Post by: nurwalid on March 22, 2015, 04:59:14 AM
Hi asymetrix..

Okay.. I will try it.. Thanks before..