How to create multiple websites for Apache server using Vhosts
# This one is pretty simple - we’re just using common Unix commands.
# I find this one helpful when I don’t want to generate a rails site skeleton on the server.
# create web application skeletal structures
cd ~/public_html
# domain 1
mkdir -p mydomain1.com/{backup,cgi-bin,log,private,public}
mkdir -p mydomain1.com/{config,releases,shared,tmp}
mkdir -p mydomain1.com/tmp/pids
# create symlinks for a capistrano site here
ln -s /home/super/public_html/mydomain1.com /home/super/public_html/mydomain1.com/current
ln -s /home/super/public_html/mydomain1.com/log /home/super/public_html/mydomain1.com/shared/log# domain 2 (optional)
mkdir -p mydomain2.net/{backup,cgi-bin,log,private,public}
mkdir -p mydomain2.net/{config,releases,shared,tmp}
mkdir -p mydomain2.net/tmp/pids
# create symlink for capistrano site here
ln -s /home/super/public_html/mydomain2.net /home/super/public_html/mydomain2.net/current
ln -s /home/super/public_html/mydomain2.net/log /home/super/public_html/mydomain2.net/shared/log# domain 3 (optional)
mkdir -p mydomain3.ws/{backup,cgi-bin,log,private,public}
mkdir -p mydomain3.ws/{config,releases,shared,tmp}
mkdir -p mydomain3.ws/tmp/pids
# create symlink for capistrano site here
ln -s /home/super/public_html/mydomain3.ws /home/super/public_html/mydomain3.ws/current
ln -s /home/super/public_html/mydomain3.ws/log /home/super/public_html/mydomain3.ws/shared/log
# to see what was created in the above code, use “ls -la” command (optional)
ls -la ~/public_html/
ls -la ~/public_html/mydomain1.com
ls -la ~/public_html/mydomain2.net
ls -la ~/public_html/mydomain3.ws
# enable (turn on) website applications in apache
sudo a2ensite mydomain1.com
sudo a2ensite mydomain2.net
sudo a2ensite mydomain3.ws# disable (turn off) website applications in apache
#sudo a2dissite mydomain1.com
#sudo a2dissite mydomain2.net
#sudo a2dissite mydomain3.ws
# (re)start apache server
sudo /etc/init.d/apache2 start
# or
sudo /etc/init.d/apache2 reload
# visit your sites in a web browser
http://mydomain1.com
http://mydomain2.net
http://mydomain3.ws
# secure versions (self-signed)
https://mydomain1.com
https://mydomain2.net
https://mydomain3.ws
Done!
























Kathy said,
Wrote on August 3, 2008 @ 7:31pm
Hello people! Nice site!
Ron said,
Wrote on August 12, 2008 @ 5:40am
Great site. I will bookmark for my sons to view as well!!!/
jeroen said,
Wrote on August 14, 2008 @ 10:31pm
This website is very nice and colorful too. Its nice to have something to show others where you attend church and to show all the smiling people filled of the goodness of the Lord. You have a wonderful website here. May God rich bless you always.
Dan said,
Wrote on September 2, 2008 @ 5:32pm
Nice post. I\’ll return.a
Willem said,
Wrote on September 2, 2008 @ 6:04pm
I like it and the background and colors make it easy to readh
Willem said,
Wrote on September 3, 2008 @ 11:19pm
Thank for making this valuable information available to the public.t
jammarlibre said,
Wrote on September 10, 2008 @ 1:52am
This is very interesting sites
Rosina said,
Wrote on September 12, 2008 @ 4:25am
This website is very nice and colorful too. Its nice to have something to show others where you attend church and to show all the smiling people filled of the goodness of the Lord. You have a wonderful website here. May God rich bless you always.
Melissa said,
Wrote on September 13, 2008 @ 11:58pm
Very good web site, great work and thank you for your service.
judy said,
Wrote on September 15, 2008 @ 9:38pm
daite na pivoo
john said,
Wrote on September 17, 2008 @ 12:41am
This is very interesting sitee
Rosina said,
Wrote on September 19, 2008 @ 2:45pm
Pretty nice site, wants to see much more on it! :)d
Martin said,
Wrote on September 26, 2008 @ 5:26am
Just serfed in. Great site, guys!
Albert said,
Wrote on September 27, 2008 @ 10:11pm
Hi, all. Nice site…I really like your site ! Good job man.
john said,
Wrote on September 29, 2008 @ 11:13pm
You have an outstanding good and well structured site. I enjoyed browsing through it.
Melissa said,
Wrote on September 30, 2008 @ 1:08pm
Greetings!..:
Kathy said,
Wrote on October 1, 2008 @ 8:08am
Very good site! I like it! Thanks!h
john said,
Wrote on October 4, 2008 @ 1:59am
Just wanted to say hello
Robert said,
Wrote on October 7, 2008 @ 2:52pm
keep up the good work!n
Melissa said,
Wrote on October 19, 2008 @ 3:48am
It\’s a great and valuable site!d
Melissa said,
Wrote on October 22, 2008 @ 9:06pm
Please, do not delete the given message. Money obtained from spam will go to the help hungry to children ugand
Kathy said,
Wrote on October 24, 2008 @ 6:49am
huyak
Albert said,
Wrote on October 28, 2008 @ 11:30am
Nice post. I\’ll return.u
Martin said,
Wrote on October 30, 2008 @ 7:18am
keep up the good work!
Hannes said,
Wrote on October 31, 2008 @ 5:31pm
I\’l be back… :)i
Siber said,
Wrote on November 2, 2008 @ 12:43pm
s prazdnikov vaso
Siber said,
Wrote on November 3, 2008 @ 6:32pm
Please, do not delete the given message. Money obtained from spam will go to the help hungry to children ugand=
judy said,
Wrote on November 3, 2008 @ 6:33pm
Excellent web site I will be visiting often
Rosina said,
Wrote on November 4, 2008 @ 11:25am
This website is useful for individuals who are searching prayers and novenas and all.
jammarlibre said,
Wrote on November 4, 2008 @ 4:09pm
This is very interesting site…
Kathy said,
Wrote on November 5, 2008 @ 4:10am
Da nu Nahn
Martin said,
Wrote on November 6, 2008 @ 5:05am
Oh o ho! very nice site!h
Rosina said,
Wrote on November 6, 2008 @ 8:24am
Hi our little brothers.k
Robert said,
Wrote on November 7, 2008 @ 8:18am
Looking for information and found it at this great site…
Dan said,
Wrote on November 7, 2008 @ 4:07pm
A fantastic site, and brilliant effort. A great piece of work.t
Robert said,
Wrote on November 8, 2008 @ 11:00am
This is very interesting site…
judy said,
Wrote on November 11, 2008 @ 1:37pm
I praise God for answering my prayers. God, you are so wonderful, majestic. Jesus Christ, I adore Your Sacred Heart.
Timmy said,
Wrote on November 11, 2008 @ 10:14pm
This website is very nice and colorful too. Its nice to have something to show others where you attend church and to show all the smiling people filled of the goodness of the Lord. You have a wonderful website here. May God rich bless you always.
Martin said,
Wrote on November 12, 2008 @ 4:24pm
Great site. I will bookmark for my sons to view as well!!!/
Willem said,
Wrote on November 13, 2008 @ 10:28pm
You have built a good websiteg
Hannes said,
Wrote on November 13, 2008 @ 10:32pm
Excellent site, added to favorites!!e
Kathy said,
Wrote on November 15, 2008 @ 12:27am
I enjoy your site very much! THANK YOUn
judy said,
Wrote on November 17, 2008 @ 1:17am
I can find the prayer I want. I thank God for this website.r
jammarlibre said,
Wrote on November 17, 2008 @ 4:13am
These prayers help me to keep God in my life, especially with the many distractions I encounter.