
21st August 2011, 22:20
|
|
Senior Member
|
|
Join Date: Dec 2007
Posts: 186
Thanks: 19
Thanked 2 Times in 2 Posts
|
|
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
|

22nd August 2011, 08:44
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,593 Times in 2,444 Posts
|
|
|
|
The Following User Says Thank You to falko For This Useful Post:
|
|

22nd August 2011, 16:10
|
|
Senior Member
|
|
Join Date: Dec 2007
Posts: 186
Thanks: 19
Thanked 2 Times in 2 Posts
|
|
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
|

22nd August 2011, 17:24
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,887
Thanks: 692
Thanked 4,188 Times in 3,205 Posts
|
|
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
|
|
The Following User Says Thank You to till For This Useful Post:
|
|

22nd August 2011, 17:28
|
|
Senior Member
|
|
Join Date: Dec 2007
Posts: 186
Thanks: 19
Thanked 2 Times in 2 Posts
|
|
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
|

22nd August 2011, 17:37
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,887
Thanks: 692
Thanked 4,188 Times in 3,205 Posts
|
|
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.
|
|
The Following User Says Thank You to till For This Useful Post:
|
|

22nd August 2011, 17:40
|
|
Senior Member
|
|
Join Date: Dec 2007
Posts: 186
Thanks: 19
Thanked 2 Times in 2 Posts
|
|
Awesome, Till
Thanks for the great explanation on this for me!
Heeter
|

23rd August 2011, 10:35
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,593 Times in 2,444 Posts
|
|
One small correction: on Debian/Ubuntu, the directories are
/etc/apache2/sites-available/
and
/etc/apache2/sites-enabled/
|

23rd August 2011, 15:36
|
|
Senior Member
|
|
Join Date: Dec 2007
Posts: 186
Thanks: 19
Thanked 2 Times in 2 Posts
|
|
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
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 15:18.
|
Recent comments
12 hours 54 min ago
17 hours 53 min ago
19 hours 19 min ago
20 hours 13 min ago
21 hours 56 min ago
1 day 2 hours ago
1 day 3 hours ago
1 day 5 hours ago
1 day 18 hours ago
1 day 20 hours ago