View previous topic :: View next topic |
Author |
Message |
jtp755 l33t


Joined: 01 Sep 2003 Posts: 691 Location: USA
|
Posted: Thu Feb 19, 2004 2:28 pm Post subject: Apache2 hosting 2 domians |
|
|
I have looked a little for the answer to my problem but everything i read didnt seem to work. Heres my problem: I have bought 2 domains (mydomain1.com and mydomain2.net) and i want to host seperate pages on each. I have recently finished setting up vhosts for mydomain1.com but that was before i bought mydomain2.net. I have also moved the DocRoot of mydomain2.com out of the main DocRoot. Here is my vhosts.conf file currently:
Code: |
NameVirtualHost *:80
<VirtualHost *:80>
ServerName mydomain1.com
ServerAlias www.mydomain1.com
DocumentRoot /var/www/mydomain1
Redirect permanent /gallery http://gallery.mydomain1.com
</VirtualHost>
<VirtualHost *:80>
ServerName gallery.mydomain1.com
DocumentRoot /var/www/mydomain1/gallery
</VirtualHost>
<VirtualHost *:80>
ServerName mydomain2.net
ServerAlias www.mydomain2.net
DocumentRoot /var/www/mydomain2
Redirect permanent /gallery http://gallery.mydomain2.net
Redirect permanent /phpBB2 http://forums.mydomain2.net
</VirtualHost>
<VirtualHost *:80>
ServerName gallery.mydomain2.net
DocumentRoot /var/www/mydomain2/gallery
</VirtualHost>
<VirtualHost *:80>
ServerName forums.mydomain2.net
DocumentRoot /var/www/mydomain2/phpBB2
</VirtualHost>
|
Ok. so now with that like that when i try to goto www.mydomain2.net i get:
Code: |
Forbidden
You don't have permission to access / on this server.
|
How do i fix this?when i had everything running under mydomain1.com it was fine. I know its probably somethign small but i would appreciate any help. TIA _________________ www.EternalFireProof.com
Registered Linux User #334610 |
|
Back to top |
|
 |
ckdake l33t


Joined: 10 Apr 2003 Posts: 889 Location: Atlanta, GA
|
Posted: Thu Feb 19, 2004 3:55 pm Post subject: |
|
|
Hey, you need to give permissions for apache to show stuff out of that directory (as well as make sure the file permissions themselves are ok). So your config files should have something like this somewhere: Code: | <Directory "/var/www">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory> |
This is a bit lax as it allows apache access to the whole /var/www folder, but thats what I do and it works for me. _________________ http://ckdake.com/ |
|
Back to top |
|
 |
jtp755 l33t


Joined: 01 Sep 2003 Posts: 691 Location: USA
|
Posted: Thu Feb 19, 2004 5:28 pm Post subject: |
|
|
thanks man. that helped alot...and fixed the probelm....i knew i had to put something in a <Directory> but i wasnt sure what or where. Thanks alot....i have learned so much about apache these last few days
check out my how-to... Here _________________ www.EternalFireProof.com
Registered Linux User #334610 |
|
Back to top |
|
 |
ckdake l33t


Joined: 10 Apr 2003 Posts: 889 Location: Atlanta, GA
|
Posted: Thu Feb 19, 2004 5:51 pm Post subject: |
|
|
I remember when I was trying to set up apache the first time.. it wasn't pretty.
How about checking out the Documentation, Tips, and Tricks section on here and posting your HOWTOs there for everyone to see? It would probably be a great help for someone sometime. _________________ http://ckdake.com/ |
|
Back to top |
|
 |
jtp755 l33t


Joined: 01 Sep 2003 Posts: 691 Location: USA
|
|
Back to top |
|
 |
|