I have tryed compiling and installing mod_xsendfile on my mappstack5.4.12-0. I have tryed two methods, but I have failed each time:
Method 1: Automatic install using apxs. Problem => When running command "apxs -cia mod\_xsendfile.c", apxs is trying to install mod_xsendfile on my mac instead of installing it on the mappstack and fails because permission is denied when trying to create the .so file in that protected area.
Method 2: Compiling with apxs and manual installation in Apache. Problem => When running command "apxs -c mod_xsendfile.c" in a folder that I fully own, it produces a .slo file instead of a .so file.
How can I transform this .slo file into a .so file? I couldn't find any relevant result for .slo files in google, nor anything usefull about my 2 issues.
With a .so file, I could install mod_xsendfile manually in Apache using the instructions found in the following references:
- https://tn123.org/mod_xsendfile/
- http://www.web-developpeur-php.com/blog/article/mod-xsendfile-forcer-le-telechargement-avec-apache-php
- http://codeutopia.net/blog/2009/03/06/sending-files-better-apache-mod_xsendfile-and-php/
- http://elivz.com/blog/single/mod_xsendfile/
Apache manual for apxs: http://httpd.apache.org/docs/2.2/programs/apxs.html
This is my first time using apxs and I don't know much about compiling c code
Thanks.
PS1: The .slo file is 0kB, no matter how I try to create the .so file. The list of files outputed by apxs is:
- mod_xsendfile.la (4kB)
- mod_xsendfile.lo (4kB)
- mod_xsendfile.o (12kB)
- mod_xsendfile.slo (0kB)
PS2: I have tryed compiling mod\_xsendfile.c with "gcc -shared -o mod\_xsendfile.so -fPIC mod_xsendfile.c", but it doesn't find the included file and I don't yet know how to tell gcc to include the dependencies from directory "mappstack-5.4.12-0/common/include". Reading through gcc manual... This is the first time I use gcc.
Stackoverflow reference: /questions/14884126/build-so-file-from-c-file-using-gcc-command-line/14884166#14884166