Solved

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

Posted on 2007-04-10
13
281 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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
 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

776 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