Welcome! Log In Create A New Profile

Advanced

From nginx to apache2.

Posted by joseph 
From nginx to apache2.
October 05, 2010 02:30PM
Here's a curve ball. It seems there are a million results on how to migrate from apache2 to nginx but I can't seem to find anything to help me migrate from nginx to apache2. Like most people I started with apache2 then migrated to nginx. At the time I only had one website though and I have set up virtual hosts in nginx but now I don't know how to setup virtual hosts in apache2. Here's my /etc/nginx/sites-available/default file:

[code]
server {
listen 80;
server_name website1.com;

access_log /var/log/nginx/localhost.access.log;

location / {
root /home/joseph/public_html;
index index.php index.html index.htm;
}

location /doc {
root /home/joseph/public_html;
autoindex on;
allow 127.0.0.1;
deny all;
}

location /images {
root /home/joseph/public_html;
autoindex on;
}

error_page 403 /403.html;
location = /403.html {
root /home/joseph/public_html;
autoindex on;
}

error_page 404 /404.html;
location = /404.html {
root /home/joseph/public_html;
autoindex on;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /home/joseph/public_html;
}

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/joseph/public_html$fastcgi_script_name;
include fastcgi_params;
}

location ~ /\.ht {
deny all;
}
location /etc/squid {
auth_basic "Restricted";
auth_basic_user_file /etc/squid/htpasswd;
}
}
server {
listen 80;
server_name website2.com;

access_log /var/log/nginx/localhost.access.log;

location / {
root /home/joseph/public_html/website2.com;
index index.php index.html index.htm;
}

location /doc {
root /home/joseph/public_html/website2.com;
autoindex on;
allow 127.0.0.1;
deny all;
}

location /images {
root /home/joseph/public_html/website2.com;
autoindex on;
}

error_page 403 /403.html;
location = /403.html {
root /home/joseph/public_html/website2.com;
autoindex on;
}

error_page 404 /404.html;
location = /404.html {
root /home/joseph/public_html/website2.com;
autoindex on;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /home/joseph/public_html/website2.com;
}

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/joseph/public_html/website2.com$fastcgi_script_name;
include fastcgi_params;
}

location ~ /\.ht {
deny all;
}
}
server {
listen 80;
server_name website3.com;

access_log /var/log/nginx/localhost.access.log;

location / {
root /home/joseph/public_html/website3.com;
index index.php index.html index.htm;
}

location /doc {
root /home/joseph/public_html/website3.com;
autoindex on;
allow 127.0.0.1;
deny all;
}

location /images {
root /home/joseph/public_html/website3.com;
autoindex on;
}

error_page 403 /403.html;
location = /403.html {
root /home/joseph/public_html/website3.com;
autoindex on;
}

error_page 404 /404.html;
location = /404.html {
root /home/joseph/public_html/website3.com;
autoindex on;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /home/joseph/public_html/website3.com;
}

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/joseph/public_html/website3.com$fastcgi_script_name;
include fastcgi_params;
}

location ~ /\.ht {
deny all;
}
}
[/code]
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 102
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready