How to Set Up Virtual Host in Ubuntu 14.04
Today I came up with new topic that is How to Set Up Virtual Host in Ubuntu.
About Virtual Host
Virtual host is used to set many hosts on the same IP address. Their is no limit on the number to hosts to be added in Virtual Host. Using this we can display different information to user depends on different Host.
I am taking 'example.com' as Virtual Host name. You can customize it.
You need Apache should be installed on system. Here is the guide to install Apache in Ubuntu.
Steps To Set Up Virtual Host
1. Open Terminal (Shortcut ctrl+alt+t).
2. Create directory ' sudo mkdir /var/www/example.com '.
3. Create index.html file ' sudo nano /var/www/example.com/index.html '.
4. Paste below code into index.html
<html>
<head>
<title>www.example.com</title>
</head>
<body>
<h1>Congrats! You Have Set Up a Virtual Host Successfully.</h1>
</body>
</html>
<head>
<title>www.example.com</title>
</head>
<body>
<h1>Congrats! You Have Set Up a Virtual Host Successfully.</h1>
</body>
</html>
5. Now copy the default configuration file.
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/example.com.conf
6. Now edit this duplicate file 'example.com.conf'
sudo nano /etc/apache2/sites-availble/example.com.conf
7. Set ServerName, ServerAlias, DocumentRoot
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com
Make the changes and save the file.
8. Now enable the new configuration file i.e. example.com
sudo a2ensite example.com
9. Restart Apache
sudo service apache2 restart
10. Now set Up the local host file
sudo nano /etc/hosts
11. Add virtual host
# Host DatabaseNow DIY. Like & share
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
127.0.0.1 example.com
Add host and save the file.
12. Now its done you can check using browser.
Add comment below if you got stuck in any step. We will sort out. Have a good day. Please like and share to appreciate my work.
Hi, thanks for post! But why did you set example.com to 127.0.0.2 not to 127.0.0.1?
ReplyDeleteOh! My mistake it's 127.0.0.1. You can set many host on single IP Address. :)
DeleteFrom your discussion I have understood that which will be better for me and which is easy to use. Really, I have liked your brilliant discussion. I will comThis is great helping material for every one visitor. You have done a great responsible person. i want to say thanks owner of this blog.
ReplyDeleteonline Python training | python training in chennai
Nice tutorial. Thanks for sharing the valuable information. it’s really helpful. Who want to learn this blog most helpful. Keep sharing on updated tutorials…
ReplyDeleteJava training in Chennai | Java training institute in Chennai | Java course in Chennai
Java training in USA
Java training in Bangalore | Java training in Indira nagar
Java training in Bangalore | Java training in Rajaji nagar
I prefer to study this kind of material. Nicely written information in this post, the quality of content is fine and the conclusion is lovely. Things are very open and intensely clear explanation of issues
ReplyDeleteangularjs Training in bangalore
angularjs Training in bangalore
angularjs online Training
angularjs Training in marathahalli
angularjs interview questions and answers
Probably, of all the preferences, this casino is my favorite . superb bonus slot machines I like everything in the casino, the roulette is excellent, I am glad that during the game you can also talk to people who also play at the same table! Muzychka great. With the conclusion there were no difficulties at all. Easily raised from $ 30 to $ 600, withdraw. Played, played, will play
ReplyDeleteI liked your blog.Thanks for your interest in sharing the information.keep updating.
ReplyDeleteaws Training in Bangalore
python Training in Bangalore
hadoop Training in Bangalore
angular js Training in Bangalore
bigdata analytics Training in Bangalore
python Training in Bangalore
aws Training in Bangalore
I am happy for sharing on this blog its awesome blog I really impressed. thanks for sharing.
ReplyDeleteBecome an Expert In SAP BASIS Training! The most trusted and trending Programming Language. Learn from experienced Trainers and get the knowledge to crack a coding interview, @Softgen Infotech Located in BTM Layout.
Really nice post. Thank you for sharing amazing information.
ReplyDeleteaws Training in Bangalore
python Training in Bangalore
hadoop Training in Bangalore
angular js Training in Bangalore
bigdata analytics Training in Bangalore
python Training in Bangalore
aws Training in Bangalore
If you don"t mind proceed with this extraordinary work and I anticipate a greater amount of your magnificent blog entries dich vu tong dai ao
ReplyDeleteI really enjoy reading and also appreciate your work. USA RDP
ReplyDeleteamazing information...I’m using the same blog platform like yours, and I’m having difficulty finding one? Thanks a lot.
ReplyDeleteBEST ANGULAR JS TRAINING IN CHENNAI WITH PLACEMENT
https://www.acte.in/angular-js-training-in-chennai
https://www.acte.in/angular-js-training-in-annanagar
https://www.acte.in/angular-js-training-in-omr
https://www.acte.in/angular-js-training-in-porur
https://www.acte.in/angular-js-training-in-tambaram
https://www.acte.in/angular-js-training-in-velachery
Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep sharing this blogging…
ReplyDeleteandroid training in chennai
android online training in chennai
android training in bangalore
android training in hyderabad
android Training in coimbatore
android training
android online training
Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep sharing this blogging…
ReplyDeletedata science training in chennai
data science training in omr
android training in chennai
android training in omr
devops training in chennai
devops training in omr
artificial intelligence training in chennai
artificial intelligence training in omr
If you use our products,you will definitely benefit from our products,which will be very beneficial for
ReplyDeleteyour health.Toincrease your weight,give us a chance to serve once.If you use Parivartan Ayurveda products,we assure you that you will definitely gain 100% weight and complete Ayurvedic product.
More Info :- https://www.parivartanayurveda.com/how-to-weight-gain.php
https://www.parivartanayurveda.com/
https://www.parivartanayurveda.com/weight_gain.php
Day To Day Update Provide You Latest Health Updates,Your Life Style,Healthy Living,Entertainment News: Bollywood , World News, National News ,TV News, Politics News and Celebrity Gossip Today ..
ReplyDeleteMore Info :- https://daytodayupdate.com/
I read this post two times, I like it so much, please try to keep posting & Let me introduce other material that may be good for our community.
ReplyDeleteAngular js Training in Chennai
Angular js Training in Velachery
Angular js Training in Tambaram
Angular js Training in Porur
Angular js Training in Omr
Angular js Training in Annanagar
This is a smart blog. I mean it. You have so much knowledge about this issue, and so much passion. You also know how to make people rally behind it, obviously from the responses. whrmarketing
ReplyDeleteAwesome article, it was exceptionally helpful! I simply began in this and I'm becoming more acquainted with it better! Cheers, keep doing awesome! nehézgépszállítás Europa-Road Kft.
ReplyDeleteamazing information...I’m using the same blog platform like yours, and I’m having difficulty finding one? Thanks a lot.
ReplyDeleteIELTS Coaching in chennai
German Classes in Chennai
GRE Coaching Classes in Chennai
TOEFL Coaching in Chennai
Spoken english classes in chennai | Communication training
Website admins need to know the ideal opportunity they need to begin turning away from their common host and overhaul their site to VPS facilitating. https://onohosting.com/
ReplyDeleteBest Forex VPS that designate high configuration, low latency, Scalable and Dedicated Forex Trading Virtual Private Server. To operate multiple MT4 or many other trading applications, there's no alternative to exclusive dedicated Forex VPS other than Flexi Fx Servers.
ReplyDeleteBest forex vps
buy youtube views if you have never worked in the video game industry, landing your first video game tester job can seem a bit intimidating. Don't fret - we all have to start somewhere, and if you are determined to start a video game tester career, there is a simple, yet highly successful process that anyone can use to make it happen.
ReplyDeleteSoftware, such as the ThinPoint, doesn't take that much resources to run since it doesn't create virtual machine for every user. best teamviewer alternatives
ReplyDeleteyurtdışı kargo
ReplyDeleteresimli magnet
instagram takipçi satın al
yurtdışı kargo
sms onay
dijital kartvizit
dijital kartvizit
https://nobetci-eczane.org/
F24İ
Hollanda yurtdışı kargo
ReplyDeleteİrlanda yurtdışı kargo
İspanya yurtdışı kargo
İtalya yurtdışı kargo
Letonya yurtdışı kargo
8B7513
Litvanya yurtdışı kargo
ReplyDeleteLüksemburg yurtdışı kargo
Macaristan yurtdışı kargo
Malta yurtdışı kargo
Polonya yurtdışı kargo
TSZPA0
Portekiz yurtdışı kargo
ReplyDeleteRomanya yurtdışı kargo
Slovakya yurtdışı kargo
Slovenya yurtdışı kargo
İngiltere yurtdışı kargo
LO5XZ3
Yunanistan yurtdışı kargo
ReplyDeleteAfganistan yurtdışı kargo
Amerika Birleşik Devletleri yurtdışı kargo
Amerika Samoası yurtdışı kargo
Angola yurtdışı kargo
DCYWG3
As responsibilities and the demands of adult life increase, the concept of play is often relegated to the background https://petrogalant.com/
ReplyDelete