Here some instruction how to configure virtual host on your Linux system.
- First you have to create a folder where your site will be. I found very useful this directory: /var/www/mynewsite.here
- Then you have to go cd /etc/apache2/sites-available .
- Create new file in this directory: sudo gedit your_site.conf , where gedit is default edit tool, so you can write yours.
Write below in your .conf file and save it. jquery.me is my website’s name you have to choose yours.
- <VirtualHost *:80>
ServerAlias jquery.me http://www.jquery.me
- After just type: sudo a2ensite your_site.conf
- And add your site to hosts: sudo gedit /etc/hosts
127.0.0.1 your_site.com http://www.your_site.com
- After restart apache server: sudo service apache2 restart
- That’s it! Just type in your browser address of your newly created website.