| Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате |
| Форум программистов > Администрирование Web серверов и Web служб > как скомпилировать модуль для Apache |
| Автор: 7910 21.12.2006, 11:14 |
| Заранее сильно извиняюсь за ламерский вопрос. В Интернете есть много дополнительных модулей к Apache, которые можно скачать в виде *.tar.gz. Внутри бывают *.c файлы, которые для второго апача можно установить используя, например, программу apxs с ключами. Как скомпилить такие файлы в *.dll или *.so, для апача, установленного под винду, чтобы было возможно подключить его командой LoadModule? |
| Автор: soon 1.1.2007, 17:18 |
| Из официальной доки по апачу: To create a module DLL, a small change is necessary to the module's source file: The module record must be exported from the DLL (which will be created later; see below). To do this, add the MODULE_VAR_EXPORT (defined in the Apache header files) to your module's module record definition. For example, if your module has: module foo_module; Replace the above with: module MODULE_VAR_EXPORT foo_module; Note that this will only be activated on Windows, so the module can continue to be used, unchanged, with Unix if needed. Also, if you are familiar with .DEF files, you can export the module record with that method instead. Now, create a DLL containing your module. You will need to link this against the ApacheCore.lib export library that is created when the ApacheCore.dll shared library is compiled. You may also have to change the compiler settings to ensure that the Apache header files are correctly located. This should create a DLL version of your module. Now simply place it in the modules directory of your server root, and use the LoadModule directive to load it. |