How to create virtual host on ubuntu?
create conf file under /etc/apache2/sites-available/
name it as vhosts.conf and put following contents
run following command to enable site
run following command to restart apache service
run following command to enable rewrite mode
and thats it
create conf file under /etc/apache2/sites-available/
name it as vhosts.conf and put following contents
<VirtualHost 127.0.0.3:80>
ServerAdmin webmaster@test.dev
ServerName test.dev
ServerAlias www.test.dev
DocumentRoot /var/www/html/projects/test
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
run following command to enable site
sudo a2ensite vhosts.conf
run following command to restart apache service
sudo service apache2 restart
run following command to enable rewrite mode
sudo a2enmod rewrite
and thats it
Comments
Post a Comment