1

So uh, I installed nginx on my home network via yum. Now I'd like to change the configuration. However, upon locate nginx, it yields no results. None. As if nginx isn't here at all. Meanwhile,

[root@localhost ~]# service nginx status
nginx (pid  3235) is running...

I'm confused. Where is my nginx configuration? Or my directory for nginx? Or nginx at all?

CentOS5.7, by the way

EDIT: Well, I've found nginx. /etc/nginx, so why isn't it showing up on my locate? I've ran updatedb...

3 Answers 3

5

Most, if not all standard linux software packages keep their configurations in /etc. So, I'd check /etc/nginx.

1
  • Yeah, I found it there. Finished editing the question right as you posted your answer. :X
    – Rob
    Feb 25, 2012 at 4:39
2

As a direct answer: /etc is the default location for configuration files, so you can just look there, but that's not always obvious.

The better approach to find onfiguration files for a given package would be to follow these steps (goes for any package):

To find the configuration files of any rpm, you can use rpm -qc package

Example:

# rpm -qc yum
/etc/logrotate.d/yum
/etc/yum.conf
/etc/yum/version-groups.conf

Alternatively, you can use man with the name of the executable in question, and look at the related man pages. Any man page with a (5) relates to configuration files. For example, if you man yum, and look at the related man pages, you'll find this:

SEE ALSO
       pkcon (1)
       yum.conf (5)
       yum-updatesd (8)
       package-cleanup (1)
       repoquery (1)
       yum-complete-transaction (1)
       yumdownloader (1)
       yum-utils (1)
       yum-security (8)
       http://yum.baseurl.org/
       http://yum.baseurl.org/wiki/Faq
       yum search yum

Then you can call man yum.conf to call the full documentation on the configuration file options and syntax.

Alternatively, you can also check the /usr/share/doc/$package_name for more documentation.

You can also run makewhatis and then man -k <keyword> to see all man pages relating to a specific keyword.

1
  • 1
    My pleasure! I'd rather teach how to fish than blindly give fish away ;) Feb 28, 2012 at 3:54
1

In the future if you install something w/o verbosity and later want to know what files it installed on an RPM-based distribution, run this:

rpm -ql <package name> | sort | uniq

Should give you a full list of the files the package installed. Were this a .deb-based (apt) distribution, their equivalent is:

dpkg -L <package name>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .