December 09, 2012

December 09, 2012
In this article, I'm going to explain about, How to create virtual Hosts for Drupal On Linux Ubuntu. By Using virtual host settings, we can access site as a domain like test.sitename.com instead of access like localhost/sitename. Here are the steps to create a virtual host for Drupal on Linux Ubuntu.

Step 1:

Assume your Drupal codes placed at /var/www/testDrupal

Step 2:

Access your Drupal site by using http://localhost/testDrupal

Step 3:

If you want to access the same site using test.testDrupal.com to solve path issues and wysiywig editor images, and files link issues.

Step 4:

Open the below file in your editor.

/etc/apache2/sites-enabled/vhosts.conf

Step 5:

Edit the file and add the below code in your vhosts.conf file.

<VirtualHost *:80>
ServerName test.testDrupal.com
ServerAlias www.test.testDrupal.com
DocumentRoot /var/www/testDrupal
</VirtualHost>

Step 6:

Open the file /etc/hosts in your editor and add the below code.

127.0.0.1 test.testDrupal.com

Step 7:

Restart your apache server by running below command using console.

sudo /etc/init.d/apache2 restart

Step 8:

Now you can access the site using http://test.testDrupal.com to view drupal instance in direct domain.

0 comments:

Post a Comment