logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Help with Vhosts
Author
rendo86



Joined: 21 May 2009
Posts: 6

PostPosted: Thu 21 May '09 20:22    Post subject: Help with Vhosts Reply with quote

Hi guys, i am a new comer to Apache and was just looking for a few tips. I have set it up and can access it just typing in my IP address (on another pc). So i know its working.

My problems start with Domain names. I have two websites, currently, but will be getting more. I own the Domain name for one through a previous site with Freeparking and dont own the other one but know it is available. Do i need to buy all the domain names a wish to use? And also are basically the only two files i need to edit the main conf file and the vhosts file, i have also edited the local Hosts files on my C: drive, dont know if this makes any difference.

Cheers for any help.

Blair


Last edited by rendo86 on Fri 22 May '09 8:30; edited 1 time in total
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Thu 21 May '09 21:02    Post subject: Re: Apache Newbie Reply with quote

rendo86 wrote:
Do i need to buy all the domain names a wish to use?

Yes

Quote:
... are basically the only two files i need to edit the main conf file and the vhosts file

For the time being sure

Quote:
i have also edited the local Hosts files on my C: drive, dont know if this makes any difference.

This depends on why and what your goal is you wish to accomplish. It's only useful on that computer.
Back to top
rendo86



Joined: 21 May 2009
Posts: 6

PostPosted: Thu 21 May '09 21:18    Post subject: Reply with quote

Ok, cheers. So do i need to do anything with my domain name from freeparking as it is currently set up to forward to another url, as my father gets free web hosting with his ISP (demon).

So as i already own one of the Domain names i can use that one right away.

does this look about right for the Vhosts file

NameVirtualHost 90.202.19.11:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost 90.202.19.11:80>
ServerAdmin blairrennie@hotmail.com
DocumentRoot "C:/Servertest/Halt"
ServerName taybridgehalt.co.uk
ServerAlias www.taybridgehalt.com
ErrorLog "logs/halt.log"
CustomLog "logs/halt.log" common
</VirtualHost>

<VirtualHost 90.202.19.11:80>
ServerAdmin blairrennie@hotmail.com
DocumentRoot "C:/Servertest/BMR"
ServerName bmrcomputingsolutions.co.uk
ServerAlias www.bmrcomputingsolutions.co.uk
ErrorLog "logs/bmr.log"
CustomLog "logs/bmr.log" common
</VirtualHost>


When i first stopped the redirection from freeparking and just left it as a domain name with no additional instructions to them, i still couldn't navigate to my URL.

Cheers for the help
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Fri 22 May '09 2:30    Post subject: Reply with quote

Domain names need to point to IP addresses, that is what DNS is about. People can memorize domain names, computers only understand IP addresses, so DNS is the bridge between our and the computer world. So if you have no control over that parked domain, need to have them point it to your IP address.

mydomain.com -> xxx.xxx.xxx.xxx
www.mydomain.com -> xxx.xxx.xxx.xxx

First vhost must be a minimal copy of the main server host.
per http://httpd.apache.org/docs/2.2/vhosts/name-based.html
Quote:
f you are adding virtual hosts to an existing web server, you must also create a <VirtualHost> block for the existing host. The ServerName and DocumentRoot included in this virtual host should be the same as the global ServerName and DocumentRoot. List this virtual host first in the configuration file so that it will act as the default host.


What I do see there looks fine, just remember the above caveat. You also may need some <Directory> containers for /Halt and /BMR ... depends on how you allowed C:/Servertest if you did at all. 403 errors wil plague you if you haven't addressed this.

... and Steffen would like you to change the subject. Maybe "Need help getting started with Virtual Hosts" or just something meaningful. I think you need to edit your first post to do that.
Back to top


Reply to topic   Topic: Help with Vhosts View previous topic :: View next topic
Post new topic   Forum Index -> Apache