Solved

How do I make a .so module from a .c file?

Posted on 2007-04-10
13
261 Views
Last Modified: 2010-03-04
I'm trying to set up my apache (on solaris) to use reverse proxy.
This is a production server, so I want to have minimum downtime. (I.e not re-compile apache).

I've downloaded the appropriate .c files. I'll need to convert them to .so to make them work, correct?

I've tried copying files from another apache installation (on windows) but apache then says "unknown file type".

apxs that I've seen here and there, is not available on my machine.

Please, this is extremely urgent.

Best regards,
David
0
Comment
Question by:larsan
  • 5
  • 4
  • 4
13 Comments
 
LVL 57

Accepted Solution

by:
giltjr earned 250 total points
ID: 18882671
You need to copy the files from another Solaris box running the same family of hardware. ".so" files are binary compiled for a unique OS and hardware platform.  So you can't copy a ".so" file from Solaris running on Intel to Solaris running on  a Sparc.

Doc from the Apache site on how to create a ".so" file:

     http://httpd.apache.org/docs/2.0/dso.html

But you should be able to find and download the needed files from the Internet.  
0
 

Author Comment

by:larsan
ID: 18884270
Thanks.

I found apxs, but it seems to need gcc?
0
 
LVL 57

Expert Comment

by:giltjr
ID: 18885346
gcc is the GNU C/C++ compiler.  you need to be able to compile the source code into a executable program.
0
 
LVL 27

Expert Comment

by:Nopius
ID: 18887136
larsan, if you have no precompiled mod_proxy.so files for the same OS/architecture (as giltjr said), yes, you need to recompile and you should to have 'gcc' instaled.

Please tell me what apache version do you have 'httpd -V' and what on what Solaris/platform does it run 'uname -a'.
0
 

Author Comment

by:larsan
ID: 18887732
The apache is version 2.0.55

Uname -a generated:
SunOS marcy1 5.9 Generic_118558-02 sun4u sparc SUNW,UltraAX-i2
0
 
LVL 27

Expert Comment

by:Nopius
ID: 18887752
Could you post entire 'httpd -l' and 'httpd -V' output?
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:larsan
ID: 18888009
Ah, stupid paths...

Here it is.

httpd -V:
Server version: Apache/2.0.55
Server built:   Nov 16 2005 15:53:45
Server's Module Magic Number: 20020903:11
Architecture:   32-bit
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_FCNTL_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D HTTPD_ROOT="/www/app/apache_2.0.55"
 -D SUEXEC_BIN="/www/app/apache_2.0.55/bin/suexec"
 -D DEFAULT_PIDLOG="logs/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

httpd -l:
Compiled in modules:
  core.c
  mod_access.c
  mod_auth.c
  mod_include.c
  mod_log_config.c
  mod_env.c
  mod_setenvif.c
  prefork.c
  http_core.c
  mod_mime.c
  mod_status.c
  mod_autoindex.c
  mod_asis.c
  mod_cgi.c
  mod_negotiation.c
  mod_dir.c
  mod_imap.c
  mod_actions.c
  mod_userdir.c
  mod_alias.c
  mod_so.c

0
 
LVL 57

Expert Comment

by:giltjr
ID: 18889069
Where did you get Apache from?  As it seems you did not compile it, I am assuming you got pre-compiled copy from some place.  Have you tried getting a copy of the ".so" file from where ever you got Apache from?
0
 

Author Comment

by:larsan
ID: 18889150
giltjr: I can't answer that, as we're generally never involved in the installation of server apps.
0
 
LVL 27

Expert Comment

by:Nopius
ID: 18889342
larsan, if you wait, I'll compile that mod_proxy.so tomorrow for your architecture/apache version.
0
 
LVL 57

Expert Comment

by:giltjr
ID: 18890194
Then I would suggest that you get the group that is involved and have them do this for you.  Even if you get the module from Nopius, I would think that whomever is responsible for the server installation would not really want you installing other modules.
0
 
LVL 27

Assisted Solution

by:Nopius
Nopius earned 250 total points
ID: 18895092
larsan, giltjr is right, EE is not the best authority for getting binaries even from experts.
Moreover, yor server version 2.0.55 is obsolete and has 2 security fixes, that can affect your server (one in mod_imap and one im mod_rewrite). Look for complete ChangesLog: http://www.apache.org/dist/httpd/CHANGES_2.0
I'd recommend you to get 2.0.59 version and build apache yourself with all required modules.

Anyway I compiled modules and you may get binaries and build instructions here:
http://nop-nop.com/larsan/proxy_larsan.tar.gz
Readme is here: http://nop-nop.com/larsan/README
0
 

Author Comment

by:larsan
ID: 18907627
Thanks guy's. I can mod the apache, or remove it if I wish. I should have said, WERE never involved.
Typo =)

I'll split the points, as you both contributed.

Thanks a million!

Regards,
David
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now