Lines 259-265
Link Here
|
259 |
fi |
259 |
fi |
260 |
|
260 |
|
261 |
if use ssl ; then |
261 |
if use ssl ; then |
262 |
MY_CONF+=" --with-ssl=/usr --enable-ssl=${mod_type}" |
262 |
MY_CONF+=" --with-ssl="${EPREFIX}"/usr --enable-ssl=${mod_type}" |
263 |
MY_MODS+=" ssl" |
263 |
MY_MODS+=" ssl" |
264 |
else |
264 |
else |
265 |
MY_CONF+=" --without-ssl --disable-ssl" |
265 |
MY_CONF+=" --without-ssl --disable-ssl" |
Lines 269-290
Link Here
|
269 |
elog "You can manipulate several configure options of suexec" |
269 |
elog "You can manipulate several configure options of suexec" |
270 |
elog "through the following environment variables:" |
270 |
elog "through the following environment variables:" |
271 |
elog |
271 |
elog |
272 |
elog " SUEXEC_SAFEPATH: Default PATH for suexec (default: /usr/local/bin:/usr/bin:/bin)" |
272 |
elog " SUEXEC_SAFEPATH: Default PATH for suexec (default: "${EPREFIX}"/usr/local/bin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/bin)" |
273 |
elog " SUEXEC_LOGFILE: Path to the suexec logfile (default: /var/log/apache2/suexec_log)" |
273 |
elog " SUEXEC_LOGFILE: Path to the suexec logfile (default: "${EPREFIX}"/var/log/apache2/suexec_log)" |
274 |
elog " SUEXEC_CALLER: Name of the user Apache is running as (default: apache)" |
274 |
elog " SUEXEC_CALLER: Name of the user Apache is running as (default: apache)" |
275 |
elog " SUEXEC_DOCROOT: Directory in which suexec will run scripts (default: /var/www)" |
275 |
elog " SUEXEC_DOCROOT: Directory in which suexec will run scripts (default: "${EPREFIX}"/var/www)" |
276 |
elog " SUEXEC_MINUID: Minimum UID, which is allowed to run scripts via suexec (default: 1000)" |
276 |
elog " SUEXEC_MINUID: Minimum UID, which is allowed to run scripts via suexec (default: 1000)" |
277 |
elog " SUEXEC_MINGID: Minimum GID, which is allowed to run scripts via suexec (default: 100)" |
277 |
elog " SUEXEC_MINGID: Minimum GID, which is allowed to run scripts via suexec (default: 100)" |
278 |
elog " SUEXEC_USERDIR: User subdirectories (like /home/user/html) (default: public_html)" |
278 |
elog " SUEXEC_USERDIR: User subdirectories (like /home/user/html) (default: public_html)" |
279 |
elog " SUEXEC_UMASK: Umask for the suexec process (default: 077)" |
279 |
elog " SUEXEC_UMASK: Umask for the suexec process (default: 077)" |
280 |
elog |
280 |
elog |
281 |
|
281 |
|
282 |
MY_CONF+=" --with-suexec-safepath=${SUEXEC_SAFEPATH:-/usr/local/bin:/usr/bin:/bin}" |
282 |
MY_CONF+=" --with-suexec-safepath=${SUEXEC_SAFEPATH:-"${EPREFIX}"/usr/local/bin:"${EPREFIX}"/usr/bin:"${EPREFIX}"/bin}" |
283 |
MY_CONF+=" --with-suexec-logfile=${SUEXEC_LOGFILE:-/var/log/apache2/suexec_log}" |
283 |
MY_CONF+=" --with-suexec-logfile=${SUEXEC_LOGFILE:-"${EPREFIX}"/var/log/apache2/suexec_log}" |
284 |
MY_CONF+=" --with-suexec-bin=/usr/sbin/suexec" |
284 |
MY_CONF+=" --with-suexec-bin="${EPREFIX}"/usr/sbin/suexec" |
285 |
MY_CONF+=" --with-suexec-userdir=${SUEXEC_USERDIR:-public_html}" |
285 |
MY_CONF+=" --with-suexec-userdir=${SUEXEC_USERDIR:-public_html}" |
286 |
MY_CONF+=" --with-suexec-caller=${SUEXEC_CALLER:-apache}" |
286 |
MY_CONF+=" --with-suexec-caller=${SUEXEC_CALLER:-apache}" |
287 |
MY_CONF+=" --with-suexec-docroot=${SUEXEC_DOCROOT:-/var/www}" |
287 |
MY_CONF+=" --with-suexec-docroot=${SUEXEC_DOCROOT:-"${EPREFIX}"/var/www}" |
288 |
MY_CONF+=" --with-suexec-uidmin=${SUEXEC_MINUID:-1000}" |
288 |
MY_CONF+=" --with-suexec-uidmin=${SUEXEC_MINUID:-1000}" |
289 |
MY_CONF+=" --with-suexec-gidmin=${SUEXEC_MINGID:-100}" |
289 |
MY_CONF+=" --with-suexec-gidmin=${SUEXEC_MINGID:-100}" |
290 |
MY_CONF+=" --with-suexec-umask=${SUEXEC_UMASK:-077}" |
290 |
MY_CONF+=" --with-suexec-umask=${SUEXEC_UMASK:-077}" |
Lines 321-327
Link Here
|
321 |
# This internal function generates the LoadModule lines for httpd.conf based on |
321 |
# This internal function generates the LoadModule lines for httpd.conf based on |
322 |
# the current module selection and MODULE_DEFINES |
322 |
# the current module selection and MODULE_DEFINES |
323 |
generate_load_module() { |
323 |
generate_load_module() { |
324 |
local endit=0 mod_lines= mod_dir="${D}/usr/$(get_libdir)/apache2/modules" |
324 |
local endit=0 mod_lines= mod_dir="${ED}/usr/$(get_libdir)/apache2/modules" |
325 |
|
325 |
|
326 |
if use static; then |
326 |
if use static; then |
327 |
sed -i -e "/%%LOAD_MODULE%%/d" \ |
327 |
sed -i -e "/%%LOAD_MODULE%%/d" \ |
Lines 358-366
Link Here
|
358 |
# to convert this file to the new APACHE2_MODULES USE_EXPAND variable and remove |
358 |
# to convert this file to the new APACHE2_MODULES USE_EXPAND variable and remove |
359 |
# it afterwards. |
359 |
# it afterwards. |
360 |
check_upgrade() { |
360 |
check_upgrade() { |
361 |
if [[ -e "${ROOT}"etc/apache2/apache2-builtin-mods ]]; then |
361 |
if [[ -e "${EROOT}"etc/apache2/apache2-builtin-mods ]]; then |
362 |
eerror "The previous configuration file for built-in modules" |
362 |
eerror "The previous configuration file for built-in modules" |
363 |
eerror "(${ROOT}etc/apache2/apache2-builtin-mods) exists on your" |
363 |
eerror "(${EROOT}etc/apache2/apache2-builtin-mods) exists on your" |
364 |
eerror "system." |
364 |
eerror "system." |
365 |
eerror |
365 |
eerror |
366 |
eerror "Please read http://www.gentoo.org/doc/en/apache-upgrading.xml" |
366 |
eerror "Please read http://www.gentoo.org/doc/en/apache-upgrading.xml" |
Lines 410-415
Link Here
|
410 |
# This function applies patches, configures a custom file-system layout and |
410 |
# This function applies patches, configures a custom file-system layout and |
411 |
# rebuilds the configure scripts. |
411 |
# rebuilds the configure scripts. |
412 |
apache-2_src_prepare() { |
412 |
apache-2_src_prepare() { |
|
|
413 |
#fix prefix in conf files etc (bug #433736) |
414 |
use !prefix || sed -e "s@/\(usr\|var\|etc\|run\)/@${EPREFIX}&@g" \ |
415 |
-i "${GENTOO_PATCHDIR}"/conf/httpd.conf "${GENTOO_PATCHDIR}"/scripts/* \ |
416 |
"${GENTOO_PATCHDIR}"/docs/*.example "${GENTOO_PATCHDIR}"/patches/*.layout \ |
417 |
"${GENTOO_PATCHDIR}"/init/* "${GENTOO_PATCHDIR}"/conf/vhosts.d/* \ |
418 |
"${GENTOO_PATCHDIR}"/conf/modules.d/* || die |
419 |
|
413 |
# 03_all_gentoo-apache-tools.patch injects -Wl,-z,now, which is not a good |
420 |
# 03_all_gentoo-apache-tools.patch injects -Wl,-z,now, which is not a good |
414 |
# idea for everyone |
421 |
# idea for everyone |
415 |
case ${CHOST} in |
422 |
case ${CHOST} in |
Lines 484-499
Link Here
|
484 |
# our myconf line too |
491 |
# our myconf line too |
485 |
ac_cv_path_PKGCONFIG=${PKG_CONFIG} \ |
492 |
ac_cv_path_PKGCONFIG=${PKG_CONFIG} \ |
486 |
econf \ |
493 |
econf \ |
487 |
--includedir=/usr/include/apache2 \ |
494 |
--includedir="${EPREFIX}"/usr/include/apache2 \ |
488 |
--libexecdir=/usr/$(get_libdir)/apache2/modules \ |
495 |
--libexecdir="${EPREFIX}"/usr/$(get_libdir)/apache2/modules \ |
489 |
--datadir=/var/www/localhost \ |
496 |
--datadir="${EPREFIX}"/var/www/localhost \ |
490 |
--sysconfdir=/etc/apache2 \ |
497 |
--sysconfdir="${EPREFIX}"/etc/apache2 \ |
491 |
--localstatedir=/var \ |
498 |
--localstatedir="${EPREFIX}"/var \ |
492 |
--with-mpm=${MY_MPM} \ |
499 |
--with-mpm=${MY_MPM} \ |
493 |
--with-apr="${SYSROOT}"/usr \ |
500 |
--with-apr="${SYSROOT}${EPREFIX}"/usr \ |
494 |
--with-apr-util="${SYSROOT}"/usr \ |
501 |
--with-apr-util="${SYSROOT}${EPREFIX}"/usr \ |
495 |
--with-pcre="${T}"/pcre-config \ |
502 |
--with-pcre="${T}"/pcre-config \ |
496 |
--with-z=/usr \ |
503 |
--with-z="${EPREFIX}"/usr \ |
497 |
--with-port=80 \ |
504 |
--with-port=80 \ |
498 |
--with-program-name=apache2 \ |
505 |
--with-program-name=apache2 \ |
499 |
--enable-layout=Gentoo \ |
506 |
--enable-layout=Gentoo \ |
Lines 553-571
Link Here
|
553 |
|
560 |
|
554 |
# drop in a convenient link to the manual |
561 |
# drop in a convenient link to the manual |
555 |
if use doc ; then |
562 |
if use doc ; then |
556 |
sed -i -e "s:VERSION:${PVR}:" "${D}/etc/apache2/modules.d/00_apache_manual.conf" |
563 |
sed -i -e "s:VERSION:${PVR}:" "${ED}/etc/apache2/modules.d/00_apache_manual.conf" |
557 |
docompress -x /usr/share/doc/${PF}/manual # 503640 |
564 |
docompress -x /usr/share/doc/${PF}/manual # 503640 |
558 |
else |
565 |
else |
559 |
rm -f "${D}/etc/apache2/modules.d/00_apache_manual.conf" |
566 |
rm -f "${ED}/etc/apache2/modules.d/00_apache_manual.conf" |
560 |
rm -Rf "${D}/usr/share/doc/${PF}/manual" |
567 |
rm -Rf "${ED}/usr/share/doc/${PF}/manual" |
561 |
fi |
568 |
fi |
562 |
|
569 |
|
563 |
# the default icons and error pages get stored in |
570 |
# the default icons and error pages get stored in |
564 |
# /usr/share/apache2/{error,icons} |
571 |
# /usr/share/apache2/{error,icons} |
565 |
dodir /usr/share/apache2 |
572 |
dodir /usr/share/apache2 |
566 |
mv -f "${D}/var/www/localhost/error" "${D}/usr/share/apache2/error" |
573 |
mv -f "${ED}/var/www/localhost/error" "${ED}/usr/share/apache2/error" |
567 |
mv -f "${D}/var/www/localhost/icons" "${D}/usr/share/apache2/icons" |
574 |
mv -f "${ED}/var/www/localhost/icons" "${ED}/usr/share/apache2/icons" |
568 |
rm -rf "${D}/var/www/localhost/" |
575 |
rm -rf "${ED}/var/www/localhost/" |
569 |
eend $? |
576 |
eend $? |
570 |
|
577 |
|
571 |
# set some sane permissions for suexec |
578 |
# set some sane permissions for suexec |
Lines 591-597
Link Here
|
591 |
# because the default webroot is a copy of the files that exist elsewhere and we |
598 |
# because the default webroot is a copy of the files that exist elsewhere and we |
592 |
# don't want them to be managed/removed by portage when apache is upgraded. |
599 |
# don't want them to be managed/removed by portage when apache is upgraded. |
593 |
apache-2_pkg_postinst() { |
600 |
apache-2_pkg_postinst() { |
594 |
if use ssl && [[ ! -e "${ROOT}/etc/ssl/apache2/server.pem" ]]; then |
601 |
if use ssl && [[ ! -e "${EROOT}/etc/ssl/apache2/server.pem" ]]; then |
595 |
SSL_ORGANIZATION="${SSL_ORGANIZATION:-Apache HTTP Server}" |
602 |
SSL_ORGANIZATION="${SSL_ORGANIZATION:-Apache HTTP Server}" |
596 |
install_cert /etc/ssl/apache2/server |
603 |
install_cert /etc/ssl/apache2/server |
597 |
ewarn |
604 |
ewarn |
Lines 603-611
Link Here
|
603 |
ewarn |
610 |
ewarn |
604 |
fi |
611 |
fi |
605 |
|
612 |
|
606 |
if [[ ! -e "${ROOT}/var/www/localhost" ]] ; then |
613 |
if [[ ! -e "${EROOT}/var/www/localhost" ]] ; then |
607 |
mkdir -p "${ROOT}/var/www/localhost/htdocs" |
614 |
mkdir -p "${EROOT}/var/www/localhost/htdocs" |
608 |
echo "<html><body><h1>It works!</h1></body></html>" > "${ROOT}/var/www/localhost/htdocs/index.html" |
615 |
echo "<html><body><h1>It works!</h1></body></html>" > "${EROOT}/var/www/localhost/htdocs/index.html" |
609 |
fi |
616 |
fi |
610 |
|
617 |
|
611 |
echo |
618 |
echo |