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 Pakainfo.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:
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/Pakainfo.com/public_html
You may replace ‘Pakainfo.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/Pakainfo.com/public_html
sudo chmod -R 755 /var/www
Now we are ready simple to setup apache server virtual host.
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/Pakainfo.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/Pakainfo.com.conf
Change #ServerName www.example.com to ServerName Pakainfo.com
If we create need my site simple to be accessible with simple www add below as well as lines after ServerName
ServerName Pakainfo.com ServerAlias www.Pakainfo.com
Assign our simple website root Folders which we had new setup in first simple two steps
DocumentRoot /var/www/Pakainfo.com/public_html
Finally Pakainfo.com.conf file needs to look like these:
ServerAdmin [email protected] ServerName Pakainfo.com ServerAlias www.Pakainfo.com DocumentRoot /var/www/Pakainfo.com/public_html
We are done with the configuration, Now, enable our virtual host:
sudo a2ensite Pakainfo.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.
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/Pakainfo.com/public_html/index.html
Add following below content it the file
Pakainfo.com Domain Great, Pakainfo.com is successfully setup on VPS!!
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 Pakainfo.com
We are all done we may Live24u test these setting on local computer System by using Pakainfo.com.
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(Pakainfo.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(Pakainfo.com) Are Most Always Welcome.