apache vhost setup

I have a ubuntu server running apache2 and I am trying to set up two web sites

My apache2ctl -S shows:

is a NameVirtualHost

default server mtzion.mtzionchinagrove.com (/etc/apache2/sites-enabled/000-default:1)

port 80 namevhost mtzion.mtzionchinagrove.com (/etc/apache2/sites-enabled/000-default:1)

port 80 namevhost mtzionchinagrove.com (/etc/apache2/sites-enabled/mtzion:1)

port 80 namevhost onebody.com (/etc/apache2/sites-enabled/onebody:1)

Syntax OK

my sites enabled directory has in 000-default

ServerAdmin webmaster@localhost

DocumentRoot /var/www/apps/

Options FollowSymLinks

AllowOverride None

Options Indexes FollowSymLinks MultiViews

AllowOverride None

Order allow,deny

allow from all

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

AllowOverride None

Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch

Order allow,deny

Allow from all

ErrorLog /var/log/apache2/error.log

Possible values include: debug, info, notice, warn, error, crit,

in my first vhost called onebody:

ServerName onebody.com

ServerAlias www.onebody.com

DocumentRoot /var/www/apps/onebody/current/public

In my other vhost called mtzion:

ServerName mtzionchinagrove.com

ServerAlias www.mtzionchinagrove.com

DocumentRoot /var/www/mtzion

This was working before I added the second vhost

What Am I doing wrong?

Tom

8 Replies

What's not working? Do you have an error message? Error log output?

Thank You I am new at this

I am trying to set up two rails apps on my Ubuntu 10.04 node. I want to be able to access them as www.mtzionchinagrove.com and www.mtzionchinagrove.com/onebody.

I ma using apache2 both apps are installed in the /var/www/apps/ directory as mtzion and onebody respectively. I had the onebody app working previously so I know it works. Apache starts with no error messages and when I type in the IP I get Index of / and a listing showing the two subdirectories mtzion and onebody.

my hostname is mtzion

I set my etc/hosts

127.0.0.1 localhost.localdomain localhost

66.228.62.247 www.mtzionchinagrove.com mtzion

66.228.62.247 www.onebody.com mtzion

My config ports has

NameVirtualHost *:80

Listen 80

My default virtualhost is

ServerAdmin webmaster@localhost

DocumentRoot /var/www/apps/

Options FollowSymLinks

AllowOverride None

Options Indexes FollowSymLinks MultiViews

AllowOverride None

Order allow,deny

allow from all

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

AllowOverride None

Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch

Order allow,deny

Allow from all

My mtzion virtual host is

ServerName mtzionchinagrove.com

ServerAlias www.mtzionchinagrove.com

DocumentRoot /var/www/apps/mtzion/public

Allow from all

Options -MultiViews

my onebody virtualhost is

ServerName onebody.com

ServerAlias www.onebody.com

DocumentRoot /var/www/apps/onebody/current/public

Allow from all

I do not know what relevant logs I should be checking and I am not sure which way to turn to debug this I feel fairly confident about my rails apps and the onebody app worked fine before I started messing with virtual hosts

This may not be the right forum for this but I thought I would give it a try

Tom

Your site appears to be hosted with hostgator (see the big hostgator logo http://www.mtzionchinagrove.com/onebody) if it's supposed to be hosted on linode then you need to update your DNS records.

I hadn't switched the DNS because I didn't have it working I just switched the DNS - may take a bit to resolve

OK apparently hostgator owned my name - It was nonprofit deal and I had partial dns control now I have mtzionchinagrove.org - with full dns control and I have changed all my virtual host entries to mtzionchinagrove.org and it resolves to linode but still the same problem

Host name business straightened out both mtzionchinagrove.org and .com work -

checked mtzion and onebody logs (for the rails apps not the apache log)

mtzion has nothing

one body

has the following before I made changes

Started GET "/messages/new?topersonid=1" for 71.71.240.244 at Tue Jun 07 22:47:39 -0400 2011

Processing by MessagesController#new as HTML

Parameters: {"topersonid"=>"1"}

Rendered messages/_form.html.erb (3.1ms)

Rendered messages/formwith_preview.erb (5.8ms)

Rendered people/_menus.erb (7.6ms)

Rendered messages/new.html.erb within layouts/default (34.3ms)

Completed 200 OK in 49ms (Views: 40.8ms | ActiveRecord: 1.4ms)

Started GET "/style.css?13072175635ab3c5fa6900003333e4e4e4" for 71.71.240.244 at Tue Jun 07 22:47:39 -0400 2011

Processing by StylesController#show as CSS

Parameters: {"13072175635ab3c5fa6900003333e4e4e4"=>nil}

Read fragment views/style?id=1.css (0.7ms)

Completed 200 OK in 5ms

After changes

Started GET "/admin/phpmyadmin/scripts/setup.php" for 72.167.41.215 at Wed Jun 08 06:21:36 -0400 2011

ActionController::RoutingError (No route matches "/admin/phpmyadmin/scripts/setup.php"):

I'm not sure what this means

On the new .org addresses I see a load of ruby gubbins, have you set up ruby to run with apache? Passenger? Mongrel? Something else?

once you get everything setup i suggest you change your db passwds, possibly linode passwd, etc. your configs are open to the world atm.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct