# Migrating existing Apache config

**URL:** <https://www.ruby-forum.com/t/migrating-existing-apache-config/228810>\
**Category:** NGINX\
**Created:** [May 8, 2013, 5:57pm UTC](https://www.ruby-forum.com/t/migrating-existing-apache-config/228810 "2013-05-08T17:57:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kay\_H](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/b19c9b/32.png) [@Kay\_H](https://www.ruby-forum.com/u/Kay_H)\
**Post date:** [May 8, 2013, 5:57pm UTC](https://www.ruby-forum.com/t/migrating-existing-apache-config/228810/1 "2013-05-08T17:57:19Z")

</div>

Hello,

due to low memory on my virtual machine, I was researching migrating  
away from Apache.

What kind of surprises me, and pardon my ignorance, I didn’t lookup  
much beyond the FAQ, and a few Wiki links, and web searches. I was  
hoping to find scripts that migrate my Apache configuration files into  
Nginx configuration files, so I could be up and running kind of  
immediately.

There are a few virtual domains, and a bunch of existing  
configuration, that I would like to migrate, e.g. URL rewrites,  
caching policies, proxies, etc. that I would not want to dive into,  
just now, as it’s not exactly trivial, to do all of that, check it  
all, and to not make a lot of mistakes.

Don’t get me wrong, I don’t think I shouldn’t learn the Nginx  
configuration format, it’s just that I would as a starting point, like  
to use a working one that resembles what I had.

So if it’s possible, I would welcome pointers… thanks in advance!

Yours,  
Kay

---

<div class="post-metadata">

**Author:** ![Kay\_H](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/b19c9b/32.png) [@Kay\_H](https://www.ruby-forum.com/u/Kay_H)\
**Post date:** [May 8, 2013, 6:06pm UTC](https://www.ruby-forum.com/t/migrating-existing-apache-config/228810/2 "2013-05-08T18:06:40Z")

</div>

2013/5/8 Kay H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Hello,  
>   
> I was hoping to find scripts that migrate my Apache configuration files into  
> Nginx configuration files, so I could be up and running kind of immediately.

Some tools were reported on the mailing list earlier, but I haven’t  
checked them.  
Like with all automatically tools you should take a look at it before  
putting the result in production.  
I just picked a .htaccess converter for you: [htaccess to nginx converter](http://winginx.com/htaccess)

But I would really recommend you to spend a weekend (as of tomorrow  
until Sunday? ^^ At least here in Germany we have a bank holiday  
tomorrow …) to write a simple config, test it and expand it to your  
needs. It will help you debugging later, I guess.

Regards, Andre

---

<div class="post-metadata">

**Author:** ![Kay\_H](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/b19c9b/32.png) [@Kay\_H](https://www.ruby-forum.com/u/Kay_H)\
**Post date:** [May 8, 2013, 6:14pm UTC](https://www.ruby-forum.com/t/migrating-existing-apache-config/228810/3 "2013-05-08T18:14:52Z")

</div>

I was just about to suggest the same tool to convert .htaccess… but  
has  
warned in the website it does not convert everything and also it does  
not  
check syntax errors, so It might be even worst.

I would prefer to do it “from scratch”…

You might find some useful help here: [Nginx Forum :: Migration from Other Servers](http://forum.nginx.org/list.php?9)

Good luck!

On Wed, May 8, 2013 at 5:05 PM, Andre J.  
\<removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![Kay\_H](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/b19c9b/32.png) [@Kay\_H](https://www.ruby-forum.com/u/Kay_H)\
**Post date:** [May 8, 2013, 9:57pm UTC](https://www.ruby-forum.com/t/migrating-existing-apache-config/228810/4 "2013-05-08T21:57:33Z")

</div>

Hello,

> I would suggest not to use any ready-to-use-conversion-tools but rather  
> learn the differences and convert the hosts manually one by one. It took me  
> a couple of days to convert all of our sites to nginx and two weeks more to  
> realize the differences of Apache and Nginx handling very specific cases,  
> such as PHP environment in particular scenario where old PHP scripts would  
> rely on SCRIPT\_URI/SCRIPT\_URL that is not available in nginx, or scripts  
> using PATH\_INFO/PATH\_TRANSLATED, and these have to be correctly set.

I am glad to say that I use only static pages with Nikola, and that no  
php is on  
my site at all. I need reverse proxies though, and virtual hosts for  
git, and so  
on.

> If you do not want to spend valuable time for learning and adopting, you may  
> always rely on reliable users with experience 😉

I am not so sure, if it’s really worth it. But I think I am sold on  
trying it out anyway,  
and will learn how to do things then. Lets see, how that works out.

Yours,  
Kay

---

<div class="post-metadata">

**Author:** ![Kay\_H](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/b19c9b/32.png) [@Kay\_H](https://www.ruby-forum.com/u/Kay_H)\
**Post date:** [May 8, 2013, 8:43pm UTC](https://www.ruby-forum.com/t/migrating-existing-apache-config/228810/5 "2013-05-08T20:43:20Z")

</div>

I would suggest not to use any ready-to-use-conversion-tools but rather  
learn the differences and convert the hosts manually one by one. It  
took me  
a couple of days to convert all of our sites to nginx and two weeks more  
to  
realize the differences of Apache and Nginx handling very specific  
cases,  
such as PHP environment in particular scenario where old PHP scripts  
would  
rely on SCRIPT\_URI/SCRIPT\_URL that is not available in nginx, or scripts  
using PATH\_INFO/PATH\_TRANSLATED, and these have to be correctly set.

If you do not want to spend valuable time for learning and adopting, you  
may  
always rely on reliable users with experience 😉

Andrejs  
loco (at) andrews.lv

Posted at Nginx Forum:

> **[Re: Migrating existing Apache config](https://forum.nginx.org/read.php?2,239021,239031)**
>
> Hello, due to low memory on my virtual machine, I was researching migrating away from Apache. What kind of surprises me, and pardon my ignorance, I didn't lookup much beyond the FAQ, and a few Wiki links, and web searches. I was hoping to find...
