-1

I have a Virtual Host set up in apache to run CodeIgniter:

<VirtualHost *:80>
   DocumentRoot "/var/www/CodeIgniter"
   ServerName codeigniter.loc
</VirtualHost>

Problem is, when I point my browser to 127.0.0.1, I'm getting the CodeIgniter home page instead of a list of the files in my root directory. Why is apache doing this?

symlynk
  • 176
  • 6
  • Why would you expect 127.0.0.1 to show you a list of the files in your root directory? Do you expect it to act like a file browser, or did you have another virtualhost setup to do this for you via Apache? – covener Feb 03 '13 at 21:00
  • Not a file browser, just a standard apache page where there is no index file included – symlynk Feb 03 '13 at 21:04

2 Answers2

1

Because you've told it to direct all requests, regardless of what IP address they are from, to codeigniter. That's what the '*:80' part of your virtual host config is doing.

Try changing that to only use the IP address of the network adapter that you want to be listening for requests for the code igniter site.

Rob Moir
  • 31,664
  • 6
  • 58
  • 86
1

Unless told otherwise, Apache will direct traffic to the first VirtualHost specified. You could get around this by making a new Vhost for the root dir, which would obviously stop your CodeIgniter site from loading.

Oliver Haslam
  • 125
  • 1
  • 9