Compiling Apache web server with dynamic module support

后端 未结 4 1032
夕颜
夕颜 2021-01-22 11:20

I have just compiled Apache 2.2.17 on a fresh install of Ubuntu 10.04.2. It\'s a learning exercise to discover what actually goes on when you compile something rather than just

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-22 12:00

    You should not run everything as root. ./configure and make will work fine without root permissions, make install requires root permissions for writing to directories like /etc and /usr/bin.

    /etc is not suitable for executables, let alone a full Apache installation. If you want to put your configuration files in /etc/apache, use the --sysconfdir=/etc/apache. The correct place to install a custom-build Apache is /usr/local.

    To enable shared modules, you have to pass the --enable-so option, the modules which should be compiled as shared should be added to --enable-mods-shared.

    The correct configure line for Apache + mod_ssl (shared module) + mod_rewrite (shared module) is, installed in /usr/local/apache with configuration files in /etc/apache:

    ./configure --prefix=/usr/local/apache --sysconfdir=/etc/apache --enable-so \
      --enable-rewrite --enable-ssl --enable-mods-shared='rewrite ssl'
    

    After successful configuring Apache HTTPd, run make followed by sudo make install.

    More information about the configure options can be found at the Apache HTTPd documentation.

提交回复
热议问题