# Relocatable installations

**URL:** <https://www.ruby-forum.com/t/relocatable-installations/224263>\
**Category:** NGINX\
**Created:** [November 5, 2012, 10:24pm UTC](https://www.ruby-forum.com/t/relocatable-installations/224263 "2012-11-05T22:24:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [November 5, 2012, 10:24pm UTC](https://www.ruby-forum.com/t/relocatable-installations/224263/1 "2012-11-05T22:24:50Z")

</div>

Hello,

Is it possible to compile nginx such that installations can be moved?  
For instance, say we install nginx to /tmp/original/nginx:

```
./configure --prefix=/tmp/original/nginx
make
make install

```

And we then move the installation directory to /tmp/relocated/nginx:

```
mv /tmp/original/nginx /tmp/relocated/nginx

```

Is there a way to run nginx in its new directory as though it had been  
installed there directly, using either compile- or run-time options?

Thanks

Mike

---

<div class="post-metadata">

**Author:** ![Michael\_Williamson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a4c791/32.png) [@Michael\_Williamson](https://www.ruby-forum.com/u/Michael_Williamson)\
**Post date:** [November 5, 2012, 10:43pm UTC](https://www.ruby-forum.com/t/relocatable-installations/224263/2 "2012-11-05T22:43:33Z")

</div>

> Is there a way to run nginx in its new directory as though it had been  
> installed there directly, using either compile- or run-time options?

You can use the -p switch after ‘nginx’ binary to change the default  
install  
time prefix (and/or -c for different path for config file).

./nginx -p /tmp/relocated/nginx

> **[GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki...](https://github.com/nginxinc/nginx-wiki)**
>
> ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com

rr

---

<div class="post-metadata">

**Author:** ![Michael\_Williamson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a4c791/32.png) [@Michael\_Williamson](https://www.ruby-forum.com/u/Michael_Williamson)\
**Post date:** [November 5, 2012, 10:52pm UTC](https://www.ruby-forum.com/t/relocatable-installations/224263/3 "2012-11-05T22:52:54Z")

</div>

> > Is there a way to run nginx in its new directory as though it had been  
> > installed there directly, using either compile- or run-time options?
> 
> You can use the -p switch after ‘nginx’ binary to change the default  
> install time prefix (and/or -c for different path for config file).

Aha! That seems to be what I’m looking for. Not sure how I missed that  
– I think I must have been expecting it to be a compile-time option  
rather than a run-time option.

Thanks for pointing it out.

Mike
