Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Ok so I just started a new ubuntu server 11.10 and i added the vhost and all seems ok ...I also restarted apache but when i visit the browser i get a blank page

the server ip is http://23.21.197.126/ but when i tail the log

tail -f /var/log/apache2/error.log 
[Wed Feb 01 02:19:20 2012] [error] [client 208.104.53.51] File does not exist: /etc/apache2/htdocs
[Wed Feb 01 02:19:24 2012] [error] [client 208.104.53.51] File does not exist: /etc/apache2/htdocs

but my only file in sites-enabled is this

<VirtualHost 23.21.197.126:80>
         ServerAdmin something@gmail.com
         ServerName logicxl.com
         # ServerAlias
         DocumentRoot /srv/crm/current/public
         ErrorLog /srv/crm/logs/error.log

           <Directory "/srv/crm/current/public">
             Order allow,deny
             Allow from all
           </Directory>
   </VirtualHost>

is there something i am missing .....the document root should be /srv/crm/current/public and not /etc/apache2/htdocs as the error suggests

Any ideas on how to fix this

UPDATE

sudo apache2ctl -S
VirtualHost configuration:
23.21.197.126:80       is a NameVirtualHost
     default server logicxl.com (/etc/apache2/sites-enabled/crm:1)
     port 80 namevhost logicxl.com (/etc/apache2/sites-enabled/crm:1)
Syntax OK

UPDATE

 <VirtualHost *:80>
    ServerAdmin something@gmail.com
    ServerName logicxl.com
    DocumentRoot /srv/crm/current/public
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /srv/crm/current/public/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
share|improve this question
    
What do you get from apache2ctl -S? –  Shane Madden Feb 1 '12 at 2:41
    
updated my question with an answer –  Matt Feb 1 '12 at 2:59
1  
Are new errors occurring when you attempt to load the site? –  Shane Madden Feb 1 '12 at 3:11
    
fixed by changing the vhost....but i have no idea how...i am pasting my new vhost and if you can let me know what might have fixed the earlier issue –  Matt Feb 1 '12 at 3:16
1  
Then your adding of the FollowSymLinks option will have fixed it. I guess the symlink is pointing to that /etc location? –  Shane Madden Feb 1 '12 at 4:07

4 Answers 4

This sounds like apache is not finding your sites-enabled directory.
Look in your apache2.conf file (etc/apache2/apache2.conf) for a line like this:

Include sites-enabled/

Change it to an absolute path like this:

Include /etc/apache2/sites-enabled/

This should do the trick.

share|improve this answer
    
I did that and nothing changed but here is the last few lines of the apache2.conf...i will update my question with them –  Matt Feb 1 '12 at 3:04
    
fixed it with another vhost but can you look at the other vhost and tell me the difference –  Matt Feb 1 '12 at 3:19
    
did you restart after changing the line or after changing the vhost lines? –  Niko S P Feb 1 '12 at 3:20
    
i restarted after both and your change didnt do anything but the vhost change did –  Matt Feb 1 '12 at 3:24
    
strange since the only real difference in the vhost config is the <Directory /> line and that one should not even be there since <Directory> usually only takes absolute paths –  Niko S P Feb 1 '12 at 3:25

This is probably due to:

<VirtualHost 23.21.197.126:80>

Any request to http://localhost could have missed the initial vhost definition.

You then then changed it (correctly) to:

<VirtualHost *:80>

Unless you have a specific reason you should always use *:80 as this defines what address to listen on. ServerName defines what name to respond to . For example:

NameVirtualHost *:80
<VirtualHost *:80>
...
</VirtualHost>
share|improve this answer
    
<Virtualhost IP:Port> is actually the better method. There will be a time when you want the server to be able to reference itself only. Enabling that feature later when you have a ton of services defined already will be a pain in the behind, as the two methods are not compatible. –  Daniel Baker Oct 7 '12 at 13:49

You have forgot to add the new site to apache:

$ sudo a2ensite (your project name) 
share|improve this answer

I had the same problem. However, in my case it was simply due to... sites-available/default not being linked to sites-enabled/default.

In apache2.conf I have:

Include sites-enabled/

And my sites-enabled/default:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

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

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

  Alias /doc/ "/usr/share/doc/"
  <Directory "/usr/share/doc/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
  </Directory>

</VirtualHost>
share|improve this answer

Your Answer

 
discard

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.