Hello friends today Iam going to show you how you can convert http://localhost/your_project_name to http://your_domain_name in ubuntu. If you are working on some project then it will be easier to open your project using http://domain_name rather than typing http://localhost/your_project_name each and every time you view it in your browser.It is very easy to map your project directory to domain name. Lets get started...
Note: Iam assuming that you have Apache 2 installed on your machine.
Assumption: Let my current project is /var/www/mvc_project and I want to open it by domain name sjframework.com in my browser.
Step 1: Go to /etc/apache2/sites-enabled/
Step 2: Make copy of 000-default file.
Step 3: Now open your newly created file i,e. myproject with your favorite text-editor and make following changes and save it.
Here is my 000-default and myproject files
Step 4: Now open /etc/hosts file and add following line and save it.
Step 5: Restart apache server.
Now open your project with your specified domain name
Note : You can specify different domain name for different projects by creating different files in /etc/apache2/sites-enabled directory.
Note : This domain name is only local.
Hope you Enjoyed the Article :).
Assumption: Let my current project is /var/www/mvc_project and I want to open it by domain name sjframework.com in my browser.
Step 1: Go to /etc/apache2/sites-enabled/
$ cd /etc/apache2/sites-enabled/
Step 2: Make copy of 000-default file.
$ sudo cp 000-default myproject
Step 3: Now open your newly created file i,e. myproject with your favorite text-editor and make following changes and save it.
$ sudo vim myproject
<VirtualHost *:80> ServerAdmin webmaster@localhost #add servername ServerName any_name_you_want #add domain name ServerAlias domain_name_you_want #specify your project directory DocumentRoot /var/www/your_project_directory <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory /var/www/your_project_directory> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory>
Here is my 000-default and myproject files
Step 4: Now open /etc/hosts file and add following line and save it.
$ sudo vim /etc/hosts
127.0.0.1 your_domain_name
Step 5: Restart apache server.
$ sudo service apache2 restart
Now open your project with your specified domain name
Note : You can specify different domain name for different projects by creating different files in /etc/apache2/sites-enabled directory.
Note : This domain name is only local.
Hope you Enjoyed the Article :).
If You Liked This Post Please Take a Time To Share This Post
Thank you! It is advanced but simplify our works. And damn cool!
ReplyDeleteThanks for appreciation :)
DeleteThank you for useful post
ReplyDeleteThe same thing I wanted to learn, which you shared with us, really inspiring! http://www.lowhosting.com/bluehost-review/
ReplyDeleteHow i can do the same with windows and xampp system?
ReplyDeleteThis information is very helpful for me because you have shared great points about this concept. iPage Review
ReplyDeleteseems outdated cant find it in my version Apache 2.4.18
ReplyDeleteIt was such a valuable information. Thank you for sharing.
ReplyDeleteBitcoin for Web Design | Pay Bitcoin for Web Design | Hubli It companies| It companies in Hubli
This post is great. What shall I do if I want this to be non-local and as decentralised as it can be?
ReplyDeleteYour good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
ReplyDeletepython interview questions and answers
python tutorials
python course institute in electronic city
Great content thanks for sharing this informative blog which provided me technical information keep posting.
ReplyDeleteData Science Training in Chennai
Data Science training in kalyan nagar
Data science training in Bangalore
Data Science training in marathahalli
Data Science interview questions and answers
Data science training in jaya nagar
Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
ReplyDeleterpa training in bangalore
best rpa training in bangalore
rpa training in pune | rpa course in bangalore
rpa training in chennai
All are saying the same thing repeatedly, but in your blog I had a chance to get some useful and unique information, I love your writing style very much, keep on updates
ReplyDeletehonor service centres in chennai
honor service center velachery
honor service center in vadapalani
All are saying the same thing repeatedly, but in your blog I had a chance to get some useful and unique information, I love your writing style very much, keep on updates
ReplyDeleteAWS training in Chennai
AWS Online Training in Chennai
AWS training in Bangalore
AWS training in Hyderabad
AWS training in Coimbatore
AWS training
AWS online training
Fake Bank Statement
ReplyDeleteFake Bank Statement
Fake Bank Statement
Fake Bank Statement
Fake Bank Statement
Fake Bank Statement
Fake Bank Statement
Fake Bank Statement
Thanks for Sharing a Very Informative Post & I read Your Article & I must say that is very helpful post for us.
ReplyDeleteBest RPA Training in Pune
I read this blog,Thanks for sharing this information.
ReplyDeleteMachine learniing classes in Pune
very informative article.thank you for sharing.kepp up the good workAngular training in Chennai
ReplyDeleteThanks for Sharing a Very Informative Post & I read Your Article & I must say that is very helpful post for us.
ReplyDeletePoint cloud to 3D Model London
Point cloud to 3D Model
Reverse Engineering Services in London
Powerful paris dedicated server offering blazing speed, robust security, and 24/7 support for your online ventures. Elevate your server experience!
ReplyDelete