Email Id : phpmk888@gmail.com
Create virtual host files
Virtual host files specify the configuration of our virtual hosts and dictate how the Apache web server will respond to different domain requests.
Apache comes with a default virtual host file, 000-default.conf. Copy this file and modify it for the first domain.
Virtual host files specify the configuration of our virtual hosts and dictate how the Apache web server will respond to different domain requests.
Apache comes with a default virtual host file, 000-default.conf. Copy this file and modify it for the first domain.
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/yournamedev.dev.conf sudo nano /etc/apache2/sites-available/yournamedev.dev.confChange the ServerAdmin directive to the email that the site administrator can receive emails through. Then, you need to add three directives: ServerName – base domain for this virtual host. ServerAlias – defines further names that should match the base name, like www. DocumentRoot – the location of the document root for this domain. Save and close the file. Enable the virtual host files The a2ensite tool can be used to enable each of our sites like this:
sudo a2ensite yournamedev.dev.confWhen you are finished, you need to restart Apache to make these changes take effect:
sudo service apache2 reload… don’t worry, that does not affect our sites. Finally add redirect these domains localhost from /etc/hosts file. Edit the /etc/hosts file and add the following lines.
sudo gedit /etc/hosts
127.0.0.1 yournamedev.dev 127.0.0.1 www.yournamedev.dev
Really awesome blog. Your blog is really useful for me. Thanks for sharing this informative blog. Keep update your blog.
ReplyDeleteHire Remote Yii Developers in India