|
Home > Archive > Web Servers on Unix and Linux > March 2007 > First Time setup of Virtual Hosts
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
First Time setup of Virtual Hosts
|
|
|
| Im a site developer and Im trying to increase my overall knowledge.
I was looking at Joomla and Drupal but I quickly found that to really
get into those I need to understand Virtual Hosts.
My desktop computer is my development computer.
I run Ubuntu 6.06 LTS and the default Apache2 install.
Im only about a year into being on a linux setup so take that in mind
when responding please.
My doc directory is /var/www/
My work is set up as /var/www/client
After reading the apache documentation on virutal hosts I was left
with way too many questions. I found two articles about how to set
this up. They both made too many assumptions and also left out several
apparently important details.
This is my little cheat sheet for setting up virtual hosts as I have
gathered from these two tutorials and from the documentation:
1) cd /etc/apache2/sites-available
2) sudo gedit name.com.conf
Paste into that file
<VirtualHost dev.example.com>
ServerAdmin webmaster@localhost
example.com or dev.example.com
ServerAlias www.dev.example.com
DocumentRoot /var/www/public_html/example.com
ScriptAlias /awstats/ /usr/lib/cgi-bin/
CustomLog /var/log/apache2/example.com-access.log combined
</VirtualHost>
3) cd /etc/apache2/sites-enabled/
4) sudo ln -s /etc/apache2/sites-available/name.com.conf
name.com.conf
5) sudo gedit /etc/hosts
add:
127.0.0.1 localhost.localdomain localhost dev.name.com www.dev.name.com
6) sudo /etc/init.d/apache2 reload
7) Enable New Site:
sudo a2ensite sitename-site
OR
Disable Site:
sudo a2dissite sitename-site
------------------------------------
I think that its supposed to read <VirtualHost *> instead of the name,
correct?
As I read the doc's, Im supposed to have a ServerName directive.
Question: is the server name just localhost?
Im just trying to get clear on this. Thanks.
wade
| |
|
| On 28 Mar 2007 17:48:52 -0700, "Wade" <wadesmart@gmail.com> wrote:
>
>I think that its supposed to read <VirtualHost *> instead of the name,
>correct?
Yup.
Minimal item:
<VirtualHost *>
ServerName mire.mine.nu
ServerAlias *.mire.mine.nu
DocumentRoot /var/www/web/mire
</VirtualHost>
Grant.
--
http://bugsplatter.mine.nu/
|
|
|
|
|