LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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, 03: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, 04:12 AM   #2
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 291Reputation: 291Reputation: 291
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 04:15 AM.
 
Old 08-09-2012, 05: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, 05:41 AM   #4
devUnix
Member
 
Registered: Oct 2010
Location: Bengaluru, India
Distribution: RHEL 5.1 on My PC, & SunOS / Sun Solaris, RHEL, SuSe, Debian, FreeBSD and other Linux flavors @ Work
Posts: 576

Rep: Reputation: 48
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, 07: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, 02:51 AM   #6
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 291Reputation: 291Reputation: 291
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, 04: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 04:33 AM.
 
Old 08-10-2012, 05:35 AM   #8
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

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

Last edited by Wim Sturkenboom; 08-10-2012 at 05:36 AM.
 
Old 08-12-2012, 05: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, 11:12 AM   #10
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
So what is the output of
Code:
ls -l /etc/httpd/conf.d/postfixadmin.conf
 
Old 08-13-2012, 01: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, 02:09 AM   #12
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 09:59 AM
Can't open grub.conf/lilo.conf with kate being root cola Slackware 6 09-28-2009 08:26 AM
Conf file: how to open and edit henrnorl Linux - Newbie 1 10-05-2006 03:26 PM
How to open and Editin httpd.conf file kakagak Linux - General 3 08-24-2004 01:35 PM
my apache server try to open the conf file from previous path m_a Linux - Networking 4 08-05-2003 06:30 AM


All times are GMT -5. The time now is 04:12 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration