LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-24-2011, 03:26 PM   #1
fritserasmus
LQ Newbie
 
Registered: Aug 2011
Location: Midrand, South Africa
Distribution: UBUNTU 11.04
Posts: 3

Rep: Reputation: Disabled
Hosting more than one websites on UBUNTU Apache2


I would like to host more than one website each one starting with the usual index.html file.

Let's say the websites are
photography
woodwork
consulting
I deliberately did not add any .com/.info so it is simpler.
At first I will only call the website from my LAN.

There is a lot of documentation ou there, but the more I read the more it confuses me.

So if someone has a simple "How to do it" please share it
 
Old 08-24-2011, 03:39 PM   #2
netnix99
Member
 
Registered: Jun 2011
Distribution: redhat, CentOS, OpenBSD
Posts: 298

Rep: Reputation: 98
fritserasmus,

Look into using the /usr/local/apache2/conf/extra/httpd-vhosts.conf file. You can list as many VIRTUAL websites as you like. I filled in some of the info to give you an idea... this is just part of the file...

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "/usr/local/apache2/htdocs/woodwork"
ServerName woodwork
ServerAlias woodwork
ErrorLog "logs/dummy-host2.example.com-error_log"
CustomLog "logs/dummy-host2.example.com-access_log" common
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "/usr/local/apache2/htdocs/photography"
ServerName photography
ServerAlias photography
ErrorLog "logs/dummy-host2.example.com-error_log"
CustomLog "logs/dummy-host2.example.com-access_log" common
</VirtualHost>

Last edited by netnix99; 08-24-2011 at 03:40 PM.
 
1 members found this post helpful.
Old 08-24-2011, 03:40 PM   #3
fritserasmus
LQ Newbie
 
Registered: Aug 2011
Location: Midrand, South Africa
Distribution: UBUNTU 11.04
Posts: 3

Original Poster
Rep: Reputation: Disabled
All the answers are right here:

http://www.linuxquestions.org/questi...e-host-211788/
http://www.linuxquestions.org/questi...apache-527625/
http://www.linuxquestions.org/questi...omains-290613/
http://www.linuxquestions.org/questi...apache-243104/
 
1 members found this post helpful.
Old 08-24-2011, 03:44 PM   #4
fritserasmus
LQ Newbie
 
Registered: Aug 2011
Location: Midrand, South Africa
Distribution: UBUNTU 11.04
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by netnix99 View Post
fritserasmus,

Look into using the /usr/local/apache2/conf/extra/httpd-vhosts.conf file. You can list as many VIRTUAL websites as you like. I filled in some of the info to give you an idea... this is just part of the file...

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "/usr/local/apache2/htdocs/woodwork"
ServerName woodwork
ServerAlias woodwork
ErrorLog "logs/dummy-host2.example.com-error_log"
CustomLog "logs/dummy-host2.example.com-access_log" common
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "/usr/local/apache2/htdocs/photography"
ServerName photography
ServerAlias photography
ErrorLog "logs/dummy-host2.example.com-error_log"
CustomLog "logs/dummy-host2.example.com-access_log" common
</VirtualHost>
Thanks netnix99,

I am going to set it up like this and report back.
Glad that you added the CustomLog and ErrorLog as I want to be able to record usage/url clicks, but I will post another thread.
 
Old 08-24-2011, 05:19 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,388

Rep: Reputation: 2199Reputation: 2199Reputation: 2199Reputation: 2199Reputation: 2199Reputation: 2199Reputation: 2199Reputation: 2199Reputation: 2199Reputation: 2199Reputation: 2199
Don't forget host headers.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache 2 webserver, hosting multiple websites atomiccomp Linux - Newbie 1 12-08-2008 01:53 AM
What to use, to check all the websites I'm hosting's bandwidth usage? Heinz09 Linux - Server 2 08-26-2008 10:33 AM
Websites that require email confirmation (that you are hosting) Virtuality Linux - Server 1 05-29-2007 05:22 PM
Hosting websites - security and code auditing hagen00 Linux - Security 2 08-22-2006 12:26 PM
VirtualHost and hosting 2 websites n00bDanimal Linux - General 1 09-25-2005 09:13 PM


All times are GMT -5. The time now is 07:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration