Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*.lo
*.la
*.slo
*.gcda
*.so
*.vcproj
*.vcproj.*
Expand Down Expand Up @@ -57,6 +58,7 @@ Release
/.kdev_include_paths
/.cproject
/.project
/dist/

# /built/
/built/
Expand Down Expand Up @@ -368,3 +370,6 @@ test/gen
test/pyhttpd/config.ini
__pycache__

# make check
check
build/config_vars.out
559 changes: 559 additions & 0 deletions CHANGES

Large diffs are not rendered by default.

78 changes: 74 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
#
# Read README.cmake before using this.

PROJECT(HTTPD C)
# CMAKE_MINIMUM_REQUIRED should be the first directive in the file:
# https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html
CMAKE_MINIMUM_REQUIRED(VERSION 3.16...3.29)

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(HTTPD C)

INCLUDE(CheckSymbolExists)
INCLUDE(CheckCSourceCompiles)
Expand Down Expand Up @@ -390,6 +392,7 @@ SET(MODULE_LIST
"modules/proxy/mod_proxy_http+I+Apache proxy HTTP module. Requires and is enabled by --enable-proxy."
"modules/proxy/mod_proxy_hcheck+I+Apache proxy health check module. Requires and is enabled by --enable-proxy."
"modules/proxy/mod_proxy_scgi+I+Apache proxy SCGI module. Requires and is enabled by --enable-proxy."
"modules/proxy/mod_proxy_uwsgi+I+Apache proxy uWSGI module. Requires and is enabled by --enable-proxy."
"modules/proxy/mod_proxy_wstunnel+I+Apache proxy Websocket Tunnel module. Requires and is enabled by --enable-proxy."
"modules/http2/mod_proxy_http2+i+Apache proxy HTTP/2 module. Requires --enable-proxy."
"modules/session/mod_session+I+session module"
Expand All @@ -406,6 +409,66 @@ SET(MODULE_LIST
"modules/test/mod_optional_hook_import+O+example optional hook importer"
)

IF(BUILD_TEST_MODULES)
LIST(APPEND MODULE_LIST
"test/pyhttpd/mod_aptest/mod_aptest+A+Test module. Useful only for developers and testing purposes."
"test/modules/http1/mod_h1test/mod_h1test+A+Http/1 Test module. Useful only for developers and testing purposes."
"test/modules/http2/mod_h2test/mod_h2test+A+Http/2 Test module. Useful only for developers and testing purposes."
"test/pytest_suite/c-modules/authany/mod_authany+A+Test module. Useful only for developers and testing purposes."
"test/pytest_suite/c-modules/client_add_filter/mod_client_add_filter+A+Test module. Useful only for developers and testing purposes."
"test/pytest_suite/c-modules/eat_post/mod_eat_post+A+Test module. Useful only for developers and testing purposes."
"test/pytest_suite/c-modules/echo_post/mod_echo_post+A+Test module. Useful only for developers and testing purposes."
"test/pytest_suite/c-modules/echo_post_chunk/mod_echo_post_chunk+A+Test module. Useful only for developers and testing purposes."
"test/pytest_suite/c-modules/fold/mod_fold+A+Test module. Useful only for developers and testing purposes."
"test/pytest_suite/c-modules/input_body_filter/mod_input_body_filter+A+Test module. Useful only for developers and testing purposes."
"test/pytest_suite/c-modules/list_modules/mod_list_modules+A+Test module. Useful only for developers and testing purposes."
"test/pytest_suite/c-modules/memory_track/mod_memory_track+A+Test module. Useful only for developers and testing purposes."
"test/pytest_suite/c-modules/nntp_like/mod_nntp_like+A+Test module. Useful only for developers and testing purposes."
"test/pytest_suite/c-modules/random_chunk/mod_random_chunk+A+Test module. Useful only for developers and testing purposes."
"test/pytest_suite/c-modules/test_apr_uri/mod_test_apr_uri+A+Test module. Useful only for developers and testing purposes."
"test/pytest_suite/c-modules/test_pass_brigade/mod_test_pass_brigade+A+Test module. Useful only for developers and testing purposes."
"test/pytest_suite/c-modules/test_rwrite/mod_test_rwrite+A+Test module. Useful only for developers and testing purposes."
"test/pytest_suite/c-modules/test_session/mod_test_session+A+Test module. Useful only for developers and testing purposes."
"test/pytest_suite/c-modules/test_utilities/mod_test_utilities+A+Test module. Useful only for developers and testing purposes."
)
ENDIF()
IF(BUILD_TEST_MODULES AND OPENSSL_FOUND)
LIST(APPEND MODULE_LIST
"test/pytest_suite/c-modules/test_ssl/mod_test_ssl+A+Test module. Useful only for developers and testing purposes."
)
ENDIF()

IF(BUILD_TEST_MODULES)
SET(PYTEST_CMODULES_DIR "${CMAKE_SOURCE_DIR}/test/pytest_suite/c-modules")
IF(WIN32)
file(GLOB _python_hints "$ENV{LOCALAPPDATA}/Programs/Python/Python3*"
"$ENV{PROGRAMFILES}/Python3*")
find_program(PYTHON_EXE NAMES py python3 python
HINTS ${_python_hints}
)
IF(NOT PYTHON_EXE)
MESSAGE(FATAL_ERROR "Python interpreter not found, required for BUILD_TEST_MODULES")
ENDIF()
execute_process(
COMMAND "${PYTHON_EXE}" "${CMAKE_SOURCE_DIR}/test/pytest_suite/gen_test_header.py" "${PYTEST_CMODULES_DIR}/apache_httpd_test.h"
RESULT_VARIABLE _gen_header_rc
)
IF(NOT _gen_header_rc EQUAL 0)
MESSAGE(FATAL_ERROR "Failed to generate apache_httpd_test.h (exit ${_gen_header_rc})")
ENDIF()
ENDIF()
SET(PYTEST_CMODULE_DEFINES APACHE2 APACHE2_4)
FOREACH(pytest_mod
mod_authany mod_client_add_filter mod_eat_post mod_echo_post
mod_echo_post_chunk mod_fold mod_input_body_filter mod_list_modules
mod_memory_track mod_nntp_like mod_random_chunk mod_test_apr_uri
mod_test_pass_brigade mod_test_rwrite mod_test_session
mod_test_utilities mod_test_ssl)
SET(${pytest_mod}_extra_defines ${PYTEST_CMODULE_DEFINES})
ENDFOREACH()
SET(mod_test_session_extra_libs mod_session)
ENDIF()

# Track which modules actually built have APIs to link against.
SET(installed_mod_libs_exps)

Expand Down Expand Up @@ -526,6 +589,7 @@ IF(LIBXML2_FOUND)
SET(mod_proxy_html_extra_libs "${LIBXML2_LIBRARIES};${LIBXML2_ICONV_LIBRARIES}")
ENDIF()
SET(mod_proxy_scgi_extra_libs mod_proxy)
SET(mod_proxy_uwsgi_extra_libs mod_proxy)
SET(mod_proxy_wstunnel_extra_libs mod_proxy)
SET(mod_proxy_http2_requires NGHTTP2_FOUND)
SET(mod_proxy_http2_extra_defines ssize_t=long)
Expand Down Expand Up @@ -720,6 +784,12 @@ SET(HTTPD_INCLUDE_DIRECTORIES
${PCRE_INCLUDE_DIR}
)

IF(BUILD_TEST_MODULES)
LIST(APPEND HTTPD_INCLUDE_DIRECTORIES
${CMAKE_CURRENT_SOURCE_DIR}/test/pytest_suite/c-modules
)
ENDIF()

# The .h files we install from outside the main include directory
# largely parallel the include directories above.
SET(other_installed_h
Expand Down Expand Up @@ -840,8 +910,8 @@ FOREACH (mod ${MODULE_PATHS})

# Extra defines?
SET(mod_extra_defines "${mod_name}_extra_defines")
IF(NOT ${${mod_extra_defines}} STREQUAL "")
SET_TARGET_PROPERTIES(${mod_name} PROPERTIES COMPILE_DEFINITIONS ${${mod_extra_defines}})
IF(NOT "${${mod_extra_defines}}" STREQUAL "")
TARGET_COMPILE_DEFINITIONS(${mod_name} PRIVATE ${${mod_extra_defines}})
ENDIF()

# Extra includes?
Expand Down
185 changes: 180 additions & 5 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ INSTALL_TARGETS = install-conf install-htdocs install-error install-icons \
install-other install-cgi install-include install-suexec install-build \
install-man

CLEAN_TARGETS = check/bin/* check/build/config_vars.mk \
check/conf/$(PROGRAM_NAME).conf check/conf/magic check/conf/mime.types \
check/conf/extra/* check/include/*
DISTCLEAN_TARGETS = include/ap_config_auto.h include/ap_config_layout.h \
include/apache_probes.h \
modules.c config.cache config.log config.status build/config_vars.mk \
build/rules.mk docs/conf/httpd.conf docs/conf/extra/*.conf shlibtool \
build/pkg/pkginfo build/config_vars.sh
EXTRACLEAN_TARGETS = configure include/ap_config_auto.h.in generated_lists \
httpd.spec
PHONY_TARGETS := check-conf check-dirs check-include check-all-pytest

include $(top_builddir)/build/rules.mk
include $(top_srcdir)/build/program.mk
Expand Down Expand Up @@ -156,23 +160,23 @@ docs:
fi

update-changes:
@find changes-entries -type f | while read -r i ; do \
@find changes-entries -type f ! -name template.txt | while read -r i ; do \
cp CHANGES CHANGES.tmp ; \
awk -v fname="$$i" 'BEGIN{done = 0; active = 0} \
done == 0 && active == 0 && /^Changes with Apache /{ active = 1; print; next}; \
/^( *\*|Changes with Apache )/ && active == 1 && done == 0{rec=$$0; while((getline<fname) > 0){if (! ($$0 ~ /^ *$$/)){print}}printf "\n";print rec; active = 0; done = 1; next} //;' \
CHANGES.tmp > CHANGES ; \
rm CHANGES.tmp ; \
if [ -n "$(SVN)" ] ; then \
if ! $(SVN) rm "$$i" 2>/dev/null ; then \
if [ -n "$(GIT)" ] ; then \
if ! $(GIT) rm "$$i" 2>/dev/null ; then \
$(RM) "$$i" ; \
fi ; \
else \
$(RM) "$$i" ; \
fi ; \
done ; \
if [ -n "$(SVN)" ] ; then \
$(SVN) diff CHANGES ; \
if [ -n "$(GIT)" ] ; then \
$(GIT) diff -- CHANGES ; \
fi

validate-xml:
Expand Down Expand Up @@ -316,3 +320,174 @@ x-local-distclean:

# XXX: This looks awfully platform-specific [read: bad form and style]
include $(top_srcdir)/os/os2/core.mk

#
# In-tree Testing
#

# Installs the include/ header files into the ./check/ directory so we can use
# them during `make check`.
check-include: override includedir:=$(top_builddir)/check/include
check-include: install-include

# This is basically the same as install-conf, but we only care about the files
# necessary to run the test suite, and the LoadModule lines point back to the
# build tree. Configuration files will be installed to ./check/conf and pointed
# to by ./check/apxs.
check-conf:
@mkdir -p check/conf/extra; \
cd $(top_srcdir)/docs/conf; \
for i in mime.types magic; do \
$(INSTALL_DATA) $$i $(top_builddir)/check/conf; \
done; \
for j in $(top_srcdir)/docs/conf $(top_builddir)/docs/conf ; do \
cd $$j ; \
for i in httpd.conf extra/*.conf; do \
if [ -f $$i ] ; then \
( \
n_lm=`awk 'BEGIN {n=0} /@@LoadModule@@/ {n+=1} END {print n}' < $$i`; \
if test $$n_lm -eq 0 -o "x$(MPM_MODULES)$(DSO_MODULES)" = "x"; then \
sed -e 's#@@ServerRoot@@#$(top_builddir)/check#g' \
-e 's#@@Port@@#$(PORT)#g' \
-e 's#@@SSLPort@@#$(SSLPORT)#g' \
-e 's#$(prefix)#$(top_builddir)/check#g' \
-e 's/^#ServerName /ServerName /' \
-e '/@@LoadModule@@/d' \
< $$i; \
else \
sed -n -e '/@@LoadModule@@/q' \
-e 's#@@ServerRoot@@#$(top_builddir)/check#g' \
-e 's#@@Port@@#$(PORT)#g' \
-e 's#@@SSLPort@@#$(SSLPORT)#g' \
-e 's#$(prefix)#$(top_builddir)/check#g' \
-e 's/^#ServerName /ServerName /' \
-e 'p' \
< $$i; \
if echo " $(DSO_MODULES) "|$(EGREP) " cgi " > /dev/null ; then \
have_cgi="1"; \
else \
have_cgi="0"; \
fi; \
if echo " $(DSO_MODULES) "|$(EGREP) " cgid " > /dev/null ; then \
have_cgid="1"; \
else \
have_cgid="0"; \
fi; \
for j in $(MPM_MODULES) "^EOL^"; do \
path=$$(find "$(top_builddir)/server" -name "mod_$$j.so"); \
if test $$j != "^EOL^"; then \
if echo ",$(ENABLED_MPM_MODULE),"|$(EGREP) ",$$j," > /dev/null ; then \
loading_disabled=""; \
else \
loading_disabled="#"; \
fi; \
echo "$${loading_disabled}LoadModule $${j}_module $${path}"; \
fi; \
done; \
for j in $(DSO_MODULES) "^EOL^"; do \
path=$$(find "$(top_builddir)/modules" -name "mod_$$j.so"); \
if test $$j != "^EOL^"; then \
if test $$j = "cgid" -a "$$have_cgi" = "1"; then \
echo "<IfModule !mpm_prefork_module>"; \
echo " LoadModule $${j}_module $${path}"; \
echo "</IfModule>"; \
elif test $$j = "cgi" -a "$$have_cgid" = "1"; then \
echo "<IfModule mpm_prefork_module>"; \
echo " LoadModule $${j}_module $${path}"; \
echo "</IfModule>"; \
else \
echo "LoadModule $${j}_module $${path}"; \
fi; \
fi; \
done; \
sed -e '1,/@@LoadModule@@/d' \
-e '/@@LoadModule@@/d' \
-e 's#@@ServerRoot@@#$(top_builddir)/check#g' \
-e 's#@@Port@@#$(PORT)#g' \
-e 's#@@SSLPort@@#$(SSLPORT)#g' \
-e 's#$(prefix)#$(top_builddir)/check#g' \
-e 's/^#ServerName /ServerName /' \
< $$i; \
fi \
) > $(top_builddir)/check/conf/$$i; \
chmod 0644 $(top_builddir)/check/conf/$$i; \
if [ "$$i" = "httpd.conf" ]; then \
mv "$(top_builddir)/check/conf/$$i" "$(top_builddir)/check/conf/$(PROGRAM_NAME).conf"; \
fi; \
fi; \
done ; \
done ;

# Sometimes (e.g. when MPM DSOs are enabled) the test suite runs a full
# configuration check on our in-tree build. To pass, we have to have all of the
# correct directories, even though they won't be used.
check-dirs:
@mkdir -p check/htdocs check/logs check/bin

# EXTRA_CHECK_BINARIES is set by configure for optional support programs
# (e.g. check/bin/a2md when a2md is enabled).
check-binaries: check/bin/apxs check/bin/httpd check/bin/ab \
check/bin/htcacheclean check/bin/httxt2dbm check/bin/htpasswd \
check/bin/htdigest check/bin/htdbm check/bin/logresolve \
$(EXTRA_CHECK_BINARIES)

check/bin/httpd:
ln -s $(top_builddir)/$(PROGRAM_NAME) check/bin/httpd

check/bin/ab:
ln -s $(top_builddir)/support/ab check/bin/ab

check/bin/htpasswd:
ln -s $(top_builddir)/support/htpasswd check/bin/htpasswd

check/bin/htdigest:
ln -s $(top_builddir)/support/htdigest check/bin/htdigest

check/bin/htdbm:
ln -s $(top_builddir)/support/htdbm check/bin/htdbm

check/bin/logresolve:
ln -s $(top_builddir)/support/logresolve check/bin/logresolve

check/bin/htcacheclean:
ln -s $(top_builddir)/support/htcacheclean check/bin/htcacheclean

check/bin/httxt2dbm:
ln -s $(top_builddir)/support/httxt2dbm check/bin/httxt2dbm

# A version of apxs with the PREFIX overridden to point inside the install root
check/bin/apxs:
mkdir -p check
sed -e 's#$(prefix)#$(top_builddir)/check#g' support/apxs > $@
chmod +x $@

# A version of apachectl with the PREFIX overridden to point inside the install root
check/bin/apachectl:
mkdir -p check
sed -e 's#$(prefix)#$(top_builddir)/check#g' support/apachectl > $@
chmod +x $@

# A version of config_vars.mk with PREFIX and SBINDIR and BINDIR overridden.
check/build/config_vars.mk: build/config_vars.out
mkdir -p check/build
cp $< $@
echo "prefix = $(top_builddir)/check" >> $@
echo "sbindir = $(top_builddir)/check/bin" >> $@
echo "bindir = $(top_builddir)/check/bin" >> $@

check-tree: check-include check-dirs check-conf check/build/config_vars.mk \
check-binaries

# Generate config.ini suitable for running against the check/ install prefix
check/config.ini: test/pyhttpd/config.ini
sed -e 's#$(prefix)#$(top_builddir)/check#g' test/pyhttpd/config.ini > $@

check/modules/stamp: build/config_vars.mk
mkdir -p check/modules
rm -f check/modules/*.so
find modules -name \*.so -exec ln -s $(top_builddir)/{} check/modules/ \;
find server/mpm -name \*.so -exec ln -s $(top_builddir)/{} check/modules/ \;
date > $@

check-all-pytest: check-tree check/bin/apachectl check/config.ini check/modules/stamp
PYHTTPD_CONFIG=$(top_builddir)/check/config.ini $(SHELL) $(top_srcdir)/test/runtests.sh --apxs="$(top_builddir)/check/bin/apxs" $(PYTEST_ARGS)
16 changes: 8 additions & 8 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
What is it?
-----------

The Apache HTTP Server is a powerful and flexible HTTP/1.1 compliant
web server. Originally designed as a replacement for the NCSA HTTP
Server, it has grown to be the most popular web server on the
Internet. As a project of the Apache Software Foundation, the
developers aim to collaboratively develop and maintain a robust,
commercial-grade, standards-based server with freely available
source code.
The Apache HTTP Server is a powerful, flexible, HTTP/1.1 and HTTP/2
compliant, and widely deployed web server. Originally designed as a
replacement for the NCSA HTTP Server, it has been in continuous
development since 1995 and remains one of the foundational projects
of the Apache Software Foundation. The developers aim to
collaboratively develop and maintain a robust, commercial-grade,
standards-based server with freely available source code.

The Latest Version
------------------
Expand Down Expand Up @@ -95,7 +95,7 @@

o If you want to be informed about new code releases, bug fixes,
security fixes, general news and information about the Apache server
subscribe to the apache-announce mailing list as described under
subscribe to the announce@httpd.apache.org mailing list as described under
<https://httpd.apache.org/lists.html#http-announce>

o If you want freely available support for running Apache please see the
Expand Down
Loading
Loading