for to work on a Server Host you need to change IP settings consequently...
1) Insert the Hostname you want to Add in /etc/hosts
Ex:
sudo pico /etc/hostsSo to work on a local domain you add on line 127.0.0.1 something like:
127.0.0.1 localhost drupal
2) Next you need to create a Referring file in /etc/apache2/sites-available
sudo touch /etc/apache2/sites-available/drupal
sudo pico /etc/apache2/sites-available/drupalTo set a Name-Based Virtual Host on port 80 you insert in this blank file something like:
<VirtualHost *:80>
ServerName drupal
DirectoryIndex index.html index.htm index.php
DocumentRoot /var/www/drupal
</VirtualHost> Make Virtual Host's Directory:
sudo mkdir /var/www/drupalDon't put at beginning "NameVirtualHost *:80" if it's already defined in /etc/apache2/ports.conf because your Virtual Host don't will work :)
Just to check look output of:
cat /etc/apache2/ports.confif contains this statement or not
Then you need also to add a reference for the new Hostname in /etc/apache2/httpd.conf
sudo pico /etc/apache2/httpd.confAnd insert:
ServerName drupal
Last, to keep your localhost working like before you need to edit:
sudo pico /etc/apache2/sites-enabled/defaultAnd Insert a line with:
ServerName localhost
3) After you need to activate the new configuration
sudo a2ensite drupal
4) Last Reload Apache
/etc/init.d/apache2 reload
To check it's effectively working:
su -c "'Welcome to Drupal!' > /var/www/drupal/index.html"
Test opening the address: http://drupal/index.html
You should be Greeted with a "Welcome to Drupal!" :)
Good Luck!