Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 21st August 2011, 23:20
Heeter Heeter is offline
HowtoForge Supporter
 
Join Date: Dec 2007
Posts: 238
Thanks: 25
Thanked 4 Times in 4 Posts
Default Is there a how-to on virtual hosting with lamp?

Hi all,

Is there a How-to on setting up virtual hosting on a Ubuntu 11.04 LAMP Server?

Thanks

Heeter
Reply With Quote
Sponsored Links
  #2  
Old 22nd August 2011, 09:44
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,749 Times in 2,579 Posts
Default

Take a look here: http://httpd.apache.org/docs/2.0/vhosts/name-based.html
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following User Says Thank You to falko For This Useful Post:
Heeter (22nd August 2011)
  #3  
Old 22nd August 2011, 17:10
Heeter Heeter is offline
HowtoForge Supporter
 
Join Date: Dec 2007
Posts: 238
Thanks: 25
Thanked 4 Times in 4 Posts
Default

Thanks Falko,

I know how to do it on Windows Servers, but a newbie for Linux. I did read that apache documentation, but still have a few questions.

Do I edit the httpd.conf -or- the apache2.conf file? Do I edit them at all?

Heeter
Reply With Quote
  #4  
Old 22nd August 2011, 18:24
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,651 Times in 4,461 Posts
Default

On Debian based systems like Ubuntu Linux, there is a directory /usr/local/apache2/sites-available/ where you can add the vhost configuration file and then enable the vhost with the command:

a2ensite yourvhostname
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
Heeter (22nd August 2011)
  #5  
Old 22nd August 2011, 18:28
Heeter Heeter is offline
HowtoForge Supporter
 
Join Date: Dec 2007
Posts: 238
Thanks: 25
Thanked 4 Times in 4 Posts
Default

Hi Till,

Do I also add the same vhost file to "/usr/local/apache2/sites-enabled/" too? Or does it get added with that command? If I understand correctly, I don't edit either *.conf files, because of that command?

Thanks


Heeter
Reply With Quote
  #6  
Old 22nd August 2011, 18:37
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 37,015
Thanks: 840
Thanked 5,651 Times in 4,461 Posts
Default

You add the file just in the sites-available directory. The command then creates a symlink in the sites-enabled directory which points to the file in sites-available. Afterwards you have to restart or reload apache so that it picks up the new configuration.

Editing of apache2.conf or httpd.conf is not nescessary, because apache includes the configuration from the sites-enabled directory automatically. The reason for this directory structure instead of editing the .conf files is that you have a saparate config for every vhost and that you can enable them with a2ensite command and disable them with a2dissite command.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
Heeter (22nd August 2011)
  #7  
Old 22nd August 2011, 18:40
Heeter Heeter is offline
HowtoForge Supporter
 
Join Date: Dec 2007
Posts: 238
Thanks: 25
Thanked 4 Times in 4 Posts
Default

Awesome, Till

Thanks for the great explanation on this for me!


Heeter
Reply With Quote
  #8  
Old 23rd August 2011, 11:35
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,749 Times in 2,579 Posts
Default

One small correction: on Debian/Ubuntu, the directories are
/etc/apache2/sites-available/
and
/etc/apache2/sites-enabled/
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #9  
Old 23rd August 2011, 16:36
Heeter Heeter is offline
HowtoForge Supporter
 
Join Date: Dec 2007
Posts: 238
Thanks: 25
Thanked 4 Times in 4 Posts
 
Default

Thanks Falko,

That is where I found them.

The virtual hosting is working perfectly. I am a big fan of subdomains, and vhosting really makes it easy for me.


Thanks guys,

Heeter
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot sent mail after upgrade CentOS to 5.5 & ISPC to 3.0.2.2 Nicram Installation/Configuration 4 18th August 2010 21:28
Virtual Hosting With vsftpd And MySQL On Debian Lenny marmellata HOWTO-Related Questions 1 15th April 2010 16:14
problems receiving mails Amorphous Installation/Configuration 2 15th October 2009 12:04
Virtual Hosting: How do I set this up? VinceDee Installation/Configuration 7 12th December 2006 19:36


All times are GMT +2. The time now is 08:13.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.