Recent

Author Topic: Apache 2.4 Modules  (Read 5666 times)

ahiggins

  • Jr. Member
  • **
  • Posts: 92
Apache 2.4 Modules
« on: February 18, 2018, 11:06:50 pm »
Just looking for general advice/guidance around creating Apache 2.4 modules, i have not been able to get any of the examples I've found on-line to work.

I'm using Debian 9, Apache 2.4, FPC 3.0.4 and Lazarus 1.8.0

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1216
    • Burdjia
Re: Apache 2.4 Modules
« Reply #1 on: February 19, 2018, 11:17:12 am »
Did you read the "FPC and Apache Modules" wiki  page?
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

ahiggins

  • Jr. Member
  • **
  • Posts: 92
Re: Apache 2.4 Modules
« Reply #2 on: February 19, 2018, 11:46:12 am »
yep I've read Apache Modules page but was unable to get the example working, I did use httpd24 etc.

I also found the following
32bit
http://leonardorame.blogspot.ae/2009/07/apache-22x-modules-with-freepascal_29.html
64bit
http://leonardorame.blogspot.com/2009/12/apache-22-modules-fpc-64bits-ubuntu-910.html

still no joy, I have a feeling I'm not loading the module correctly under Apache 2.4

I'll just keep plodding, many thanks for you reply.
 

Thaddy

  • Hero Member
  • *****
  • Posts: 18712
  • To Europe: simply sell USA bonds: dollar collapses
Re: Apache 2.4 Modules
« Reply #3 on: February 19, 2018, 12:13:01 pm »
I would first check if your module has executable rights when deployed: this is not automatically the case.
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...

ahiggins

  • Jr. Member
  • **
  • Posts: 92
Re: Apache 2.4 Modules
« Reply #4 on: February 19, 2018, 04:34:13 pm »
@Thaddy I checked the execute permissions and it was set, the error i get when i try to restart Apache is

/usr/sbin$ sudo apache2ctl restart
apache2: Syntax error on line 231 of /etc/apache2/apache2.conf: Cannot load /usr/lib/apache2/modules/mod_hello.so into server: /usr/lib/apache2/modules/mod_hello.so: undefined symbol: ap_rputs
Action 'restart' failed.
The Apache error log may have more information.

i am out of my depth, but all part of the learning process

ahiggins

  • Jr. Member
  • **
  • Posts: 92
Re: Apache 2.4 Modules
« Reply #5 on: February 19, 2018, 06:13:39 pm »
Right, getting nowhere fast with this one, so went back to the start and double checked everything still no joy. So I removed Apache 2.4 and built 2.2.34 from source and recompiled the example so/dll I've been working with, only changes I made was to use httpd22 rather than httpd24 packages, it worked first time, did this to prove to myself I was following the instructions correctly. I shall do some more digging around Apache 24.4 and the httpd24 packages I sure its going to be something really simple

toby

  • Sr. Member
  • ****
  • Posts: 275
Re: Apache 2.4 Modules
« Reply #6 on: August 03, 2019, 03:23:29 am »
I would first check if your module has executable rights when deployed: this is not automatically the case.

the rights on the module make no difference - you can chmod 000 mod_hello.so and aoache2 will still load it fine

zamronypj

  • Full Member
  • ***
  • Posts: 140
    • Fano Framework, Free Pascal web application framework
Re: Apache 2.4 Modules
« Reply #7 on: August 05, 2019, 01:36:45 pm »
If you take a look at

https://github.com/graemeg/freepascal/blob/master/packages/httpd24/src/http_protocol.inc

ap_rputs() is commented out. I believe ap_rwrite() or ap_rvputs() is function that you need to write something. Example also use ap_rwrite()

https://github.com/graemeg/freepascal/blob/master/packages/httpd24/examples/mod_hello.pp
Fano Framework, Free Pascal web application framework https://fanoframework.github.io
Apache module executes Pascal program like scripting language https://zamronypj.github.io/mod_pascal/
Github https://github.com/zamronypj

 

TinyPortal © 2005-2018