What's the difference in ".c" and ".so" _mod file extensions?

Discussion in 'Apache' started by adhdcelt, Jan 13, 2011.

  1. #1
    I'm setting up security using an htaccess file for a site I'm building in wordpress running on a WAMP localhost server setup.

    I'm seeing references to such htaccess entries as <ifmodule mod_deflate.c> and
    <ifmodule mod_security.c> when searching the Net for security solutions.

    Well, the Apache httpd file in my WAMP installation---the latest---has ".so" file extensions, not the ".c" extensions I keep seeing in the code examples I'm finding on the Net.

    Is there a difference in these two extensions?
    Does it have to do with WAMP as apposed to a live server?
    Are these two extensions interchangeable---can I just use the .so extensions in my htaccess file when I go live with the site, or do my extensions have to be the .c that I see in code examples?

    Can anyone help me with this?
    Thanks.
     
    adhdcelt, Jan 13, 2011 IP
  2. Rudolf Bodocsi

    Rudolf Bodocsi Peon

    Messages:
    69
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi,

    ".c" is a C or C++ programing language written source code of program.
    ".so" is a compiled Unix or Linux program shared library. Like Windows ".dll" files.

    You suppose compile first your ".c" file to ".so" and after that you can start use.

    Rudolf
     
    Last edited: Jan 14, 2011
    Rudolf Bodocsi, Jan 14, 2011 IP
  3. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #3
    The difference is "so" is a compiled module for use on a Linux server, and "c" is the source code before it gets compiled. On a windows server you're going to have "dll" instead of "so", but you will still reference "module_name.c" in your <ifModule> sections. http://httpd.apache.org/docs/2.0/mod/core.html#ifmodule

    There are actually two forms you can use when referring to modules in directives such as <IfModule>, the form you've seen already which is the pre-compiled file name mentioned in that link. Then there's also a proper name, or "module identifier" for each module. With the bundled modules, for instance mod_cache you can lookup both the name of the source file you would use, as well as the module identifier. In the case of mod_cache that would be either <IfModule mod_cache.c> or <IfModule cache_module>.
     
    joebert, Jan 28, 2011 IP