• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
The Electric Toolbox Blog

The Electric Toolbox Blog

Linux, Apache, Nginx, MySQL, Javascript and PHP articles

  • Applications
  • FCKEditor
  • Apache
  • Windows
  • Contact Us
Home / Get the arguments used to configure Nginx source

Get the arguments used to configure Nginx source

I’m currently managing an images server for a customer that uses Nginx on an old Debian 5 install. At some point they installed a version of Nginx from source, and I wanted to be able to install an updated version from source using the same command line arguments for the configure command. This post shows how to do this.

Show the version and configure options

The nice thing with Nginx is the arguments for the configure command are compiled into the binary and accessible from the command line, so you can ensure your new install is configured in exactly the same way. Simply use the -V flag like so (note it’s an UPPERCASE V):

nginx -V

Here’s some example output from the above command:

nginx version: nginx/1.2.2
built by gcc 4.3.2 (Debian 4.3.2-1.1)
TLS SNI support enabled
configure arguments: --sbin-path=/usr/sbin --pid-path=/var/run/nginx.pid --conf-path=/etc/nginx/nginx.conf --with-http_ssl_module --without-http_rewrite_module

You can then run configure using the “configure arguments” from the output. Using the above example, do this:

./configure --sbin-path=/usr/sbin --pid-path=/var/run/nginx.pid --conf-path=/etc/nginx/nginx.conf --with-http_ssl_module --without-http_rewrite_module

Some other useful command line switches/flags/arguments

See which version is running (without all the other stuff):

nginx -v

Test the current config:

nginx -t

Check Out These Related posts:

  1. Check if a PHP script is already running
  2. Process Forking with PHP
  3. Show only one process with top on Linux
  4. Install APC for PHP on Linux

Filed Under: Nginx Web Server

Primary Sidebar

Categories

  • Apache
  • Applications
  • Article
  • Case Studies
  • Email Servers
  • FCKEditor
  • HTML And CSS
  • Javascript
  • Linux/Unix/BSD
  • Microsoft SQL Server
  • Miscellaneous Postings
  • MySql
  • Networking
  • Nginx Web Server
  • Offsite Articles
  • OSX
  • PHP
  • Quick Tips
  • RFC – Request for Comments
  • SilverStripe
  • VMWare
  • VPN
  • Windows
  • WordPress

Recent Posts

  • Vim Show Line Numbers
  • Add User To Group Linux
  • Chmod 777 Tutorial
  • How to Copy Directory Linux
  • Linux create user

Copyright © 2021. ElectricToolBox. All Rights Reserved.

  • Contact Us
  • Copyright Info
  • Privacy Policy
  • Sitemap