Setting up virtual host in Linux (Mint)

Setting up virtual host in Linux (Mint) with Apache

sudo gedit /etc/apache2/httpd.conf

Add the following line to this file

ServerName [your hostname]
DocumentRoot [path to web app directory]

SetEnv APPLICATION_ENV "development"
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all

2. Edit the httpd.conf using the following command on terminal-
sudo gedit /etc/hosts

Add the following line to this file-

[cc]127.0.0.1 [your hostname][/cc]

sudo a2enmod rewrite
sudo updatedb
cd /etc/apache2/mods-enabled
touch rewrite.load
sudo gedit rewrite.load

If you dont get the following line in your editor then add it-

LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

Restart your apache-

$ sudo /etc/init.d/apache2 restart

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s