Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: apache vhost setup
PostPosted: Thu Jun 23, 2011 11:55 am 
Offline
Senior Newbie

Joined: Thu Jun 23, 2011 11:00 am
Posts: 5
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

<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www/apps/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog /var/log/apache2/error.log

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

in my first vhost called onebody:

<VirtualHost *:80>
ServerName onebody.com
ServerAlias www.onebody.com
DocumentRoot /var/www/apps/onebody/current/public
</VirtualHost>

In my other vhost called mtzion:
<VirtualHost *:80>
ServerName mtzionchinagrove.com
ServerAlias www.mtzionchinagrove.com
DocumentRoot /var/www/mtzion
</VirtualHost>

This was working before I added the second vhost

What Am I doing wrong?

Tom


Top
   
 Post subject:
PostPosted: Thu Jun 23, 2011 12:09 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
What's not working? Do you have an error message? Error log output?

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject: Vhost revisited
PostPosted: Thu Jun 23, 2011 9:53 pm 
Offline
Senior Newbie

Joined: Thu Jun 23, 2011 11:00 am
Posts: 5
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

<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /var/www/apps/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>


My mtzion virtual host is

<VirtualHost *:80>
ServerName mtzionchinagrove.com
ServerAlias www.mtzionchinagrove.com
DocumentRoot /var/www/apps/mtzion/public
<Directory /var/www/apps/mtzion/public>
Allow from all
Options -MultiViews
</directory>
</VirtualHost>


my onebody virtualhost is

<VirtualHost *:80>
ServerName onebody.com
ServerAlias www.onebody.com
DocumentRoot /var/www/apps/onebody/current/public
<Directory /var/www/apps/onebody/public>
Allow from all
</Directory>
</VirtualHost>

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


Top
   
 Post subject:
PostPosted: Thu Jun 23, 2011 10:29 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
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.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject: Sorry
PostPosted: Thu Jun 23, 2011 10:40 pm 
Offline
Senior Newbie

Joined: Thu Jun 23, 2011 11:00 am
Posts: 5
I hadn't switched the DNS because I didn't have it working I just switched the DNS - may take a bit to resolve


Top
   
 Post subject: More DNS
PostPosted: Thu Jun 23, 2011 11:16 pm 
Offline
Senior Newbie

Joined: Thu Jun 23, 2011 11:00 am
Posts: 5
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


Top
   
 Post subject: more investigation
PostPosted: Fri Jun 24, 2011 8:51 am 
Offline
Senior Newbie

Joined: Thu Jun 23, 2011 11:00 am
Posts: 5
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?to_person_id=1" for 71.71.240.244 at Tue Jun 07 22:47:39 -0400 2011
Processing by MessagesController#new as HTML
Parameters: {"to_person_id"=>"1"}
Rendered messages/_form.html.erb (3.1ms)
Rendered messages/_form_with_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


Top
   
 Post subject:
PostPosted: Fri Jun 24, 2011 9:58 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
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?

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Fri Jun 24, 2011 12:58 pm 
Offline
Senior Newbie

Joined: Thu Nov 18, 2010 8:56 am
Posts: 18
once you get everything setup i suggest you change your db passwds, possibly linode passwd, etc. your configs are open to the world atm.

_________________
linode 512, ubu 10, apache2, php, mysql


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group