November 25, 2024, 06:29:21 AM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: Virtual directories  (Read 4730 times)

Offline ilias

  • Linux Learner
  • ***
  • Posts: 116
Virtual directories
« on: July 01, 2006, 10:47:01 AM »
Hi all

I have developed two Intranet based websites for my company, both are hosted as virtual directories in a single machine using Apache eg finance and HR and they are accessed as http://company/finance and http://company/hr. where company is the host/machine name

My question is , i want to access them as http://finance and http://Hr. not as above, what are the steps

Offline gauravbajaj

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 658
Virtual directories
« Reply #1 on: July 01, 2006, 02:11:30 PM »
ok
Why dont u use Virtual Hosting
Make entry in forward file of DNS

finance IN CNAME company
hr        IN CNAME company


Make below entries in apache.conf/httpd.conf

<VirtualHost finance>
    ServerName   finance
    DocumentRoot /.../...  --> give the directory pathname here where index.html/index.php file resides
    ServerAdmin abc@xyz.com    ErrorLog /var/log/apache2/www.example.com-    

</Virtualhost>

<VirtualHost hr>
    ServerName  hr
    DocumentRoot /.../...  --> give the directory pathname here where index.html/index.php file resides
    ServerAdmin abc@xyz.com    ErrorLog /var/log/apache2/www.example.com-    

</Virtualhost>

after that restart apache service

Gaurav

Offline ilias

  • Linux Learner
  • ***
  • Posts: 116
Virtual directories
« Reply #2 on: July 02, 2006, 06:04:22 AM »
Hi

Tks, it worked out. I am wandering how i missed out this simple thing.

Anyway thanks a lot