Apache 웹 서버 소스 코드 컴파일은 항상 재미있습니다.
Apache가 새로운 서버에서 처음 실행될 때 컴파일되는 경우는 매우 드뭅니다.
사실은 많은 전제 조건이 필요하며 그 중 하나라도 누락되었거나 버전 호환성이 있는 경우 이를 수정하는 데 많은 시간을 소비해야 할 수 있습니다.
Apache 2.4.6을 설치하기 위해 새로운 서버 Linux 6.4에서 작업 중이었고 다음 오류가 발생했습니다.
exports.c:1929: error: redefinition of 'ap_hack_apr_allocator_create' exports.c:921: note: previous definition of 'ap_hack_apr_allocator_create' was here exports.c:1930: error: redefinition of 'ap_hack_apr_allocator_destroy' exports.c:922: note: previous definition of 'ap_hack_apr_allocator_destroy' was here exports.c:1931: error: redefinition of 'ap_hack_apr_allocator_alloc' exports.c:923: note: previous definition of 'ap_hack_apr_allocator_alloc' was here exports.c:1932: error: redefinition of 'ap_hack_apr_allocator_free' exports.c:924: note: previous definition of 'ap_hack_apr_allocator_free' was here exports.c:1933: error: redefinition of 'ap_hack_apr_allocator_owner_set' exports.c:925: note: previous definition of 'ap_hack_apr_allocator_owner_set' was here exports.c:1934: error: redefinition of 'ap_hack_apr_allocator_owner_get' exports.c:926: note: previous definition of 'ap_hack_apr_allocator_owner_get' was here exports.c:1935: error: redefinition of 'ap_hack_apr_allocator_max_free_set' exports.c:927: note: previous definition of 'ap_hack_apr_allocator_max_free_set' was here exports.c:1937: error: redefinition of 'ap_hack_apr_allocator_mutex_set' exports.c:929: note: previous definition of 'ap_hack_apr_allocator_mutex_set' was here exports.c:1938: error: redefinition of 'ap_hack_apr_allocator_mutex_get' exports.c:930: note: previous definition of 'ap_hack_apr_allocator_mutex_get' was here exports.c:1944: error: redefinition of 'ap_hack_apr_atomic_init' exports.c:936: note: previous definition of 'ap_hack_apr_atomic_init' was here exports.c:1945: error: redefinition of 'ap_hack_apr_atomic_read32' exports.c:937: note: previous definition of 'ap_hack_apr_atomic_read32' was here exports.c:1946: error: redefinition of 'ap_hack_apr_atomic_set32' exports.c:938: note: previous definition of 'ap_hack_apr_atomic_set32' was here exports.c:1947: error: redefinition of 'ap_hack_apr_atomic_add32' exports.c:939: note: previous definition of 'ap_hack_apr_atomic_add32' was here exports.c:1948: error: redefinition of 'ap_hack_apr_atomic_sub32' exports.c:940: note: previous definition of 'ap_hack_apr_atomic_sub32' was here exports.c:1949: error: redefinition of 'ap_hack_apr_atomic_inc32' exports.c:941: note: previous definition of 'ap_hack_apr_atomic_inc32' was here exports.c:1950: error: redefinition of 'ap_hack_apr_atomic_dec32' exports.c:942: note: previous definition of 'ap_hack_apr_atomic_dec32' was here exports.c:1951: error: redefinition of 'ap_hack_apr_atomic_cas32' exports.c:943: note: previous definition of 'ap_hack_apr_atomic_cas32' was here exports.c:1952: error: redefinition of 'ap_hack_apr_atomic_xchg32' exports.c:944: note: previous definition of 'ap_hack_apr_atomic_xchg32' was here exports.c:1953: error: redefinition of 'ap_hack_apr_atomic_casptr' exports.c:945: note: previous definition of 'ap_hack_apr_atomic_casptr' was here exports.c:1954: error: redefinition of 'ap_hack_apr_atomic_xchgptr' exports.c:946: note: previous definition of 'ap_hack_apr_atomic_xchgptr' was here exports.c:1960: error: redefinition of 'ap_hack_apr_dso_load' exports.c:1085: note: previous definition of 'ap_hack_apr_dso_load' was here exports.c:1961: error: redefinition of 'ap_hack_apr_dso_unload' exports.c:1086: note: previous definition of 'ap_hack_apr_dso_unload' was here exports.c:1962: error: redefinition of 'ap_hack_apr_dso_sym' exports.c:1087: note: previous definition of 'ap_hack_apr_dso_sym' was here exports.c:1963: error: redefinition of 'ap_hack_apr_dso_error' exports.c:1088: note: previous definition of 'ap_hack_apr_dso_error' was here exports.c:1969: error: redefinition of 'ap_hack_apr_env_get' exports.c:1094: note: previous definition of 'ap_hack_apr_env_get' was here exports.c:1970: error: redefinition of 'ap_hack_apr_env_set' exports.c:1095: note: previous definition of 'ap_hack_apr_env_set' was here exports.c:1971: error: redefinition of 'ap_hack_apr_env_delete' exports.c:1096: note: previous definition of 'ap_hack_apr_env_delete' was here exports.c:1976: error: redefinition of 'ap_hack_apr_strerror' exports.c:1101: note: previous definition of 'ap_hack_apr_strerror' was here export.c:1981: error: redefinition of 'ap_hack_apr_stat' exports.c:1106: note: previous definition of 'ap_hack_apr_stat' was here exports.c:1982: error: redefinition of 'ap_hack_apr_dir_open' exports.c:1107: note: previous definition of 'ap_hack_apr_dir_open' was here exports.c:1983: error: redefinition of 'ap_hack_apr_dir_close' exports.c:1108: note: previous definition of 'ap_hack_apr_dir_close' was here
비슷한 오류가 발생하면 다음과 같이 해결할 수 있습니다.
해결책
다양한 매개변수를 살펴본 후 apr-util이 1.4.1보다 낮은 버전일 때 이런 일이 발생한다는 것을 알았습니다.
- apr-util 버전을 확인하십시오. 더 낮은 버전을 찾으면 1.4.1 이상을 설치해야 합니다.
- 다음에서 apr-util 소스 코드 다운로드 http://mirror.nus.edu.sg/apache/apr/
- 다운로드한 파일의 압축을 풉니다
다음과 같이 컴파일 및 설치
./configure make make install
기본적으로 /usr/local/apr/bin/apu-1-config에 설치됩니다.
이제 새로 설치된 apr-util로 Apache를 컴파일할 수 있으며 괜찮을 것입니다.
./configure --with-apr-util=/usr/local/apr/bin/apu-1-config
그것은 나를 도왔고 당신도 바랍니다.
기사를 재미있게 읽으셨나요? 세계와 공유하는 것은 어떻습니까?