Welcome! Log In Create A New Profile

Advanced

convert virtual hosts from apache

Posted by petermk 
convert virtual hosts from apache
March 06, 2010 03:30PM
Hi everyone,

I am new to nginx and trying to set it up on my local development machine running CentOS 5.3. I have two development sites: www.test1.loc and www.test2.loc that work perfectly fine with apache but I am struggling to make them work with nginx.

Here's the hosts file:

127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
127.0.0.3 www.test1.loc
127.0.0.4 www.test2.loc

The "listen" part of httpd.conf file:

Listen 127.0.0.3:80
Listen 127.0.0.4:80

The "virtual hosts" part of httpd.conf:

<VirtualHost 127.0.0.3>
ServerName www.test1.loc
ServerAlias www*.test1.loc
ServerPath /
DocumentRoot "/var/www/test1/"
<Directory /var/www/test1>
AllowOverride All
</Directory>
</VirtualHost>

<VirtualHost 127.0.0.4>
ServerName www.test2.loc
ServerAlias www*.test2.loc
ServerPath /
DocumentRoot "/var/www/test2/"
<Directory /var/www/test2>
AllowOverride All
</Directory>
</VirtualHost>

Any help would be appreciated. Thanks in advance!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 124
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready