官术网_书友最值得收藏!

  • NGINX Cookbook
  • Tim Butler
  • 210字
  • 2021-07-03 00:04:18

Debian/Ubuntu

On Ubuntu/Debian, install the required build tools:

apt-get install devscripts

This will install quite a few packages on your system, so if you're trying to keep your production environment lean, then I'd recommend that you use a separate build box to complete this.

We can now install the build prerequisites for NGINX:

apt-get build-dep nginx

Once you have the required build dependencies, we can now get a copy of the source code. Again, rather than the plain TAR file, we're going to get the packaged variant so that we can easily build them. Here's how we do it:

mkdir ~/nginxbuild
cd ~/nginxbuild
apt-get source nginx

You should now have a directory with the original TAR file, the Debian description, and any Debian specific patches. The apt-get source command will automatically extract and apply patches, as required, into a source directory.

To build without any changes, enter the directory and create the packages:

cd nginx-1.9.10/
fakeroot debian/rules binary

Compiling the code may take a while, depending on how many processors your workstation or server has. Once it has compiled, you should see two binaries in the parent (nginxbuild) directory. The resulting files should be:

  • nginx-dbg_1.9.10-1~jessie_amd64.deb
  • nginx_1.9.10-1~jessie_amd64.deb

You can now install NGINX via the newly compiled package:

sudo dpkg -i nginx_1.9.10-1~jessie_amd64.deb
主站蜘蛛池模板: 安宁市| 蒙阴县| 樟树市| 雷州市| 京山县| 乳山市| 宾川县| 海淀区| 秦安县| 资阳市| 墨竹工卡县| 壤塘县| 岚皋县| 库车县| 大城县| 交口县| 隆林| 中山市| 阿克陶县| 百色市| 东海县| 永顺县| 茌平县| 襄垣县| 淮阳县| 星座| 洛阳市| 柘城县| 桃源县| 房山区| 怀仁县| 牟定县| 札达县| 昌黎县| 莲花县| 三门峡市| 荣成市| 唐河县| 承德市| 商河县| 丹阳市|