Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got a server (runnging Debian Squeeze) with Apache 2.2, there are 4 site running there. I'm using namebased virtulhosts because I've got a single IP. Initial configuration has been made with Webmin and probably something has been messed up.. is my default domain and is working correctly, is another site that is working. Now I want to add as a new site, so I've made this config file:

root@webamp:/etc/apache2# cat sites-available/ 
<VirtualHost *:80>
DocumentRoot /home/server/Condivisione/RAID/

I've added it to enabled-sites and restarted apache. The problem is that if I go to (or I'm redirected to with a 301 redirect.

Both and are A DNS records pointing to my IP address.

Strange thing is that if a change DocumentRoot of to

 DocumentRoot /home/server/Condivisione/RAID/Sito_SecondDomain

I correctly see content without being redirected ( is showed on address bar)

These are the other configurations I'm using.

root@webamp:/root#  source /etc/apache2/envvars ; /usr/sbin/apache2 -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:443         (/etc/apache2/sites-enabled/ssl.bbteam:1)
*:80                   is a NameVirtualHost
     default server (/etc/apache2/sites-enabled/000-default:7)
     port 80 namevhost (/etc/apache2/sites-enabled/000-default:7)
     port 80 namevhost (/etc/apache2/sites-enabled/
     ## other domains ##
     port 80 namevhost (/etc/apache2/sites-enabled/
Syntax OK

Content of default config file is

root@webamp:/etc/apache2# cat sites-available/default
<VirtualHost *:80>
DocumentRoot /home/server/Condivisione/RAID/Sito_Web_Apache_su_80

ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined

content of second domain config file is

root@webamp:/etc/apache2# cat sites-available/ 
<VirtualHost *:80>
DocumentRoot /home/server/Condivisione/RAID/Sito_SecondDomain
#redirect 301 /
<Directory "/home/server/Condivisione/RAID/Sito_SecondDomain">
    allow from all
    Options +Indexes

Probably a file permission problem?

root@webamp:/root# ls -lh /home/server/Condivisione/RAID/
total 7.1M
drwxrwxr-x 15 www-data server   4.0K Jun  5 13:29 Sito_SecondDomain
drwxrwxrwx 23 server   server   4.0K Jun  7 16:22 Sito_Web_Apache_su_80
drwxrwxr-x 17 www-data server   4.0K Jun  8 09:56

Do someone have an idea of what is happening?

Thanks, Francesco


Even if I use a subdirectory it is 301 redirected, like if I navigate to

I'm redirected to
share|improve this question
What content is in the directory? – Shane Madden Jun 9 '12 at 19:31
@ShaneMadden at the beginning it was only an index.html with something like "This is a test page". Now it contains Joomla's installation files.. – Francesco Jun 9 '12 at 23:20
Check if it stops redirecting with the Joomla files removed. If you don't have Apache configured to 301 redirect, it's not capable of doing so - so if the config doesn't have the redirect, then the source of it is guaranteed to be the dynamic content. – Shane Madden Jun 9 '12 at 23:25
@ShaneMadden I've tried removing Joomla's files, but the problem remains.. I'm thinking about purging apache's configurations and have it done from scratch... – Francesco Jun 12 '12 at 11:23

Your question seemed to be a bit over the place but I get the general idea of what you are looking for as per your problem. The issue may be due to how you havn't created a folder in /home/server/Condivisione/RAID/ for You can do so by mkdir /home/server/Condivisione/RAID/

When you created the config, webmin should have looked like:

Handle connections to address -- Any Address
Add name virtual server address (if needed) -- Checked
Listen on address (if needed) -- Checked
Port -- 80
Document Root -- /home/server/Condivisione/RAID/
Allow Access to this directory -- Checked
Server Name --
Add virtual server to file -- New file under virtual servers directory /etc/apache2/sites-available
Copy directives from -- Nowhere

After creating this, make sure you go to Virtual Server (for and click on Networking and Addresses and set:

Alternate virtual server names:
Server admin email address:

Once done with that, head back over to your virtual server and click on Aliases and Redirects and make sure there is nothing set under Permanent URL redirects (Code 301). If there is, remove it.

After all of that; select Apply Changes.

If you still are having issues with this; comment and i'll try to get back to you.

Hope this helps and DFTBA. :)

share|improve this answer
about folder missing my mystake, I've forgotten to change ls output to mask (real) Folder is there and permission seems ok. – Francesco Jun 9 '12 at 15:25
about webmin I've tried removing virtual server and recreating with your configurations but the behavior is the same. Double checked that there is no 301 redirect. Only 301 redirect I use is into's .htaccess to redirect to Thank you for your time. – Francesco Jun 9 '12 at 15:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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