Author Topic: [SOLVED] Error !! Could not open for writing on NIB (Regexp)  (Read 15436 times)

nurwalid

  • Newbie
  • *
  • Posts: 30
    • View Profile
[SOLVED] Error !! Could not open for writing on NIB (Regexp)
« on: March 12, 2015, 08:51:57 PM »
I am using Ubuntu 14.04 LTS and USRP2 N210 with UHD.




I want to save regexp, but failed.

"Error !! Could not open file for writing"

what should i do for this error?

-thx-



« Last Edit: April 17, 2015, 05:25:00 PM by nurwalid »

Monica Tepelus

  • Administrator
  • Full Member
  • *****
  • Posts: 198
    • View Profile
Re: Error !! Could not open for writing on NIB (Regexp)
« Reply #1 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.

nurwalid

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Error !! Could not open for writing on NIB (Regexp)
« Reply #2 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?

Monica Tepelus

  • Administrator
  • Full Member
  • *****
  • Posts: 198
    • View Profile
Re: Error !! Could not open for writing on NIB (Regexp)
« Reply #3 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.


nurwalid

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Error !! Could not open for writing on NIB (Regexp)
« Reply #4 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..

asymetrixs

  • Administrator
  • Newbie
  • *****
  • Posts: 47
    • View Profile
Re: Error !! Could not open for writing on NIB (Regexp)
« Reply #5 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


nurwalid

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: Error !! Could not open for writing on NIB (Regexp)
« Reply #6 on: March 22, 2015, 04:59:14 AM »
Hi asymetrix..

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