-8

Is this virtual host configuration correct?

DocumentRoot /sda1/htdocs
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
<Directory /sda1/htdocs>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
</Directory
11

/sda1/ isn't a directory in the Linux Filesystem Hierarchy Standard (FHS), so you can do this, and create the directory in /sda1/htdocs, but I for one, would think you're a twat for doing so.

Everyone else uses /var/www or /srv/. For a damn good reason. It's where people expect to find things. Breaking from the FHS is just asking for trouble.

A better bet would be

DocumentRoot /var/www/htdocs 
<Directory /> 
    Options FollowSymLinks 
    AllowOverride None 
</Directory> 
<Directory /var/www/htdocs>
    Options Indexes FollowSymLinks MultiViews 
    AllowOverride None 
    Order allow,deny
    Allow from All
</Directory>

Which is pretty much the apache default for 000-default.

|improve this answer|||||
  • For example one good reason not to mount to locations based on the physical device names is that you are setting exposing your private bits needlessly. What happens next week when sda1 fills and you add sdb1 to your system? Are you going to go through and modify all your configuration files to point at a new location? If you must have a /sda1 mount point, at least use a symlink or bind-mount to add a layer of abstraction, so you can easily change it in the future, without having to make a huge change in your config. – Zoredache Feb 10 '12 at 1:32
  • many thanks is this is good DocumentRoot /var/www/htdocs <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/htdocs> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny – laith1952 Feb 10 '12 at 1:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.