Apache Virtual Host Tutorials – Setup Apache Virtual Hosts with Ubuntu

Apache Virtual Host Tutorials – Setup Apache Virtual Hosts with Ubuntu

In this Post We Will Explain About is Apache Virtual Host Tutorials – Setup Apache Virtual Hosts with Ubuntu With Example and Demo.

Welcome on live24u.com – Examples ,The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to How to Set Up Apache Virtual Hosts on Ubuntu 14.04

In this post we will show you Best way to implement Set up Apache virtual hosts on Ubuntu, hear for How to How to Setup Apache Virtual Hosts on Ubuntu 16.04 with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.




Apache Virtual Host Setup

This Post is very big answer to the question: like as a How to setup simple domain on Means host like as Virtual Private Server(VPS) using ubuntu?, here you learn to simple setting ubuntu onther host meaning we may setup menas one or more multiple domains get data with single IP some address using Apache server Virtual Host.
Note: I’m used to consider simple we have my VPS server or local computer System is ready with simple Ubuntu to use these Post.
Now Get started.
Before start we simple need to have Apache installed on largest my Ubuntu Server, as well as if we have’t any installed Apache server, please got install by using following below command:

Also Read :   Top 10 Best Free PHP IDE for Website Developers

Install Apache:

sudo apt-get install apache2

step 1. Create Directory

After getting Apache host installed, we need to simple setup a Folders for my project/website, these is the Folders where we are simpe used to store our website more data or we called it as some Production source Code, therefore go ahead and use simple following below command to create new a Folders.

sudo mkdir -p /var/www/live24u.com/public_html

You may replace ‘live24u.com’ to my real domain name, please take a simple note like as domain my used to use the simple domain needs to have simple DNS forwarded data to my server IP ew address. if as well as we don’t have new created domain and my testing some these Post on local computer System no worries as well as we will get more data info on these values as well in the next last steps.

step 2. Directory Permissions

sudo chown -R $USER:$USER /var/www/live24u.com/public_html

sudo chmod -R 755 /var/www

Now we are ready simple to setup apache server virtual host.

Also Read :   frontaccounting Customization create module form Components

step 3. Virtual host file:

Apache server provides default virtual file simple called 000-default.conf file as well as which is located at /etc/apache2/sites-available/ therefore the easy way to simple create new virtual host file is just second copy these default data file with my simple change domain name or whatever and then we want but it’s new better way to keep your domain name to identify files.

Use following below lines to create duplicate/copy file of 000-default.conf

sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/live24u.com.conf

We have our file ready to configure, Now, do that in next step:

step 4. Configure Virtual host:

Edit and then the file we just simple created:

sudo nano /etc/apache2/sites-available/live24u.com.conf

Change #ServerName www.example.com to ServerName live24u.com
If we create need my site simple to be accessible with simple www add below as well as lines after ServerName

ServerName live24u.com
ServerAlias www.live24u.com



Assign our simple website root Folders which we had new setup in first simple two steps

DocumentRoot /var/www/live24u.com/public_html

Finally live24u.com.conf file needs to look like these:

ServerAdmin webmaster@live24u.com
ServerName live24u.com
ServerAlias www.live24u.com
DocumentRoot /var/www/live24u.com/public_html

We are done with the configuration, Now, enable our virtual host:

sudo a2ensite live24u.com

As we have made some new changes in the data configuration of apache server we need to restartsimple steps to our apache to complete the simple configuration.

Also Read :   List of Schemes Launched by Narendra Modi Government in 2017

sudo service apache2 restart

We are done, just needs to add Live24u test page in the root Folders so that we may see message/page as well as we may easily upload my simple website backup if we new have already in place.

and then create simple index page to show message.

sudo nano /var/www/live24u.com/public_html/index.html

Add following below content it the file

<html>
  <head>
    <title>Live24u.com Domain</title>
  </head>
  <body>
    <h1>Great, live24u.com is successfully setup on VPS!!</h1>
  </body>
</html>

If we are using these Post to setup virtual domain on my local computer System, use following below additional step to access my domain, we just simple simply needs to add create records under host file.

nano /etc/hosts

127.0.0.1       localhost
#virtual host
12.34.56.789    live24u.com

We are all done we may Live24u test these setting on local computer System by using live24u.com.




Example

I hope you have Got How To Configure Apache Virtual Hosts In Ubuntu And how it works.I would Like to have FeadBack From My Blog(live24u.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(live24u.com) Are Most Always Welcome.