LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-09-2012, 02:37 AM   #1
zahid
Member
 
Registered: Jun 2012
Location: Dhaka, Banglades
Distribution: CentOS 6.2
Posts: 32

Rep: Reputation: Disabled
cant open conf file


I am unable to open a file extension .conf . Created with the command 'vim' postfixadmin.conf and save the content.
 
Old 08-09-2012, 03:12 AM   #2
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 293Reputation: 293Reputation: 293
Did you create this file as root?
What are the permissions on this file?
Post the output of:
Code:
ls -l /path/to/postfixadmin.conf
where /path/to/ is the path to where the file is stored on your system.

It may be that the file is only readable by the root user. Can you open the file from a root terminal? Become root and run vim postfixadmin.conf in the directory where postfixadmin.conf resides, or use nano postfixadmin.conf as root and see if you can open it.

Are you able to open any other files with the extension .conf, either as root or as a regular user?

Last edited by tommcd; 08-09-2012 at 03:15 AM.
 
Old 08-09-2012, 04:34 AM   #3
kauuttt
Member
 
Registered: Dec 2008
Location: Atlanta, GA, USA
Distribution: Ubuntu
Posts: 135

Rep: Reputation: 26
I think permission problem. Please post the output of:

ls -l <file_name>
ls -l <directory_where_the_file_resides>
whoami
 
Old 08-09-2012, 04:41 AM   #4
devUnix
Member
 
Registered: Oct 2010
Posts: 606

Rep: Reputation: 59
Post the location of your file and also the output of these commands:

Code:
ls -l yourFile.conf

whoami
as pointed out by the two guys above.


Remember that you need to be the owner of a file that you want to open or you must be a member of the group that the file belongs to. Otherwise, the third group called "others" should be given at least read permission to see the contents of the file.

Code:
chmod 666 fileName
would give read/write permissions to everybody. You can become the root by issuing the following command:

Code:
su -
or


Code:
su - root
and then provide the password.
 
Old 08-09-2012, 06:29 AM   #5
zahid
Member
 
Registered: Jun 2012
Location: Dhaka, Banglades
Distribution: CentOS 6.2
Posts: 32

Original Poster
Rep: Reputation: Disabled
.conf dont open

Got the message :

While opening with gedit command, it says "Could not open the file "/home/zahid/Desktop/postfixadmin.conf."

gedit has not been able to detect the character coding.
Please check that you are not trying to open a binary file.
Select a character coding from the menu and try again.

Showing option for character coding, retry and cancel button.
 
Old 08-10-2012, 01:51 AM   #6
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 293Reputation: 293Reputation: 293
As everyone who has replied to your thread has said, we need to see the permissions for your problematic file.
Can you please post the output of:
Code:
ls -l yourFile.conf
and:
Code:
whoami
 
Old 08-10-2012, 03:13 AM   #7
zahid
Member
 
Registered: Jun 2012
Location: Dhaka, Banglades
Distribution: CentOS 6.2
Posts: 32

Original Poster
Rep: Reputation: Disabled
Applying command ls l

[root@localhost Desktop]# ls l /home/zahid/Desktop/postfixadmin.conf
ls: cannot access l: No such file or directory
/home/zahid/Desktop/postfixadmin.conf

infact no .conf file is opening with gedit also.

Last edited by zahid; 08-10-2012 at 03:33 AM.
 
Old 08-10-2012, 04:35 AM   #8
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
You forgot the minus

Last edited by Wim Sturkenboom; 08-10-2012 at 04:36 AM.
 
Old 08-12-2012, 04:54 AM   #9
zahid
Member
 
Registered: Jun 2012
Location: Dhaka, Banglades
Distribution: CentOS 6.2
Posts: 32

Original Poster
Rep: Reputation: Disabled
Permission denied

I am configuring httpd for postfixadmin as SU.

Here is the reply from command

[root@localhost Desktop]# service httpd restart
Stopping httpd: [FAILED]
Starting httpd: httpd: Syntax error on line 221 of /etc/httpd/conf/httpd.conf: Could not open configuration file /etc/httpd/conf.d/postfixadmin.conf: Permission denied
[FAILED]
[root@localhost Desktop]#
 
Old 08-12-2012, 10:12 AM   #10
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
So what is the output of
Code:
ls -l /etc/httpd/conf.d/postfixadmin.conf
 
Old 08-13-2012, 12:22 AM   #11
zahid
Member
 
Registered: Jun 2012
Location: Dhaka, Banglades
Distribution: CentOS 6.2
Posts: 32

Original Poster
Rep: Reputation: Disabled
Here is the output of the command ls -l

[root@localhost Desktop]# ls -l /etc/httpd/conf.d/postfixadmin.conf
-rw-r--r--. 1 root users 271 Aug 12 14:42 /etc/httpd/conf.d/postfixadmin.conf
[root@localhost Desktop]#
 
Old 08-13-2012, 01:09 AM   #12
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Apache should be able to read it. Can you compare it to another file in /etc/httpd/conf.d/ and set the permissions the same as that 'other' file (if necessary).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
proftpd - Unable to open config file: /etc/security/pam_env.conf micxz Linux - Server 3 01-07-2010 08:59 AM
Can't open grub.conf/lilo.conf with kate being root cola Slackware 6 09-28-2009 07:26 AM
Conf file: how to open and edit henrnorl Linux - Newbie 1 10-05-2006 02:26 PM
How to open and Editin httpd.conf file kakagak Linux - General 3 08-24-2004 12:35 PM
my apache server try to open the conf file from previous path m_a Linux - Networking 4 08-05-2003 05:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration