Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] Did Apache change everything? (Setting up virtual hosts)



Dave M G writes:

 > So I looked on line, and now it seems everything is handled in a
 > directory called /etc/apache2/sites-available and basically all the
 > configurations are now done in a different way.

I believe this was invented by Debian, not Apache, and I would assume
fresh installs of Ubuntu would do the same thing.  I don't know what
the upstream does anymore, I haven't set up a webserver from source
since 1995. :-)

 > F**k.

This infrastructure has a *lot* of advantages in a virtual hosting
setup, though.

 > <VirtualHost *>

I think you *need* to have the port here.  It's been a while so my
memory could be fuzzy or the code could have been fixed in the
meantime, but I'm pretty sure <VirtualHost *> didn't work for me.

 >         ServerName www.local_site.com
 >         ServerAlias local_site.com
 >         ServerAdmin webmaster@example.com
 > 
 >         DocumentRoot /var/www/local_site.com
 >         <Directory /var/www/local_site.com/>
 >                 Options Indexes FollowSymLinks MultiViews
 >                 # pcw AllowOverride None
 >                 AllowOverride All
 >                 Order allow,deny
 >                 allow from all
 >                 # This directive allows us to have apache2's default
 > start page
 >                 # in /apache2-default/, but still have / go to the right
 > place
 >                 # Commented out for Ubuntu
 >                 #RedirectMatch ^/$ /apache2-default/
 >         </Directory>
 > 
 >         ErrorLog /var/log/apache2/local_site.com/error.log
 > 
 >         # Possible values include: debug, info, notice, warn, error, crit,
 >         # alert, emerg.
 >         LogLevel warn
 > 
 >         CustomLog /var/log/apache2/local_site.com/access.log combined
 >         ServerSignature On

I don't understand the CustomLog ... combined.  I thought that would
combine the access log with the error log, but you've specified a
separate ErrorLog.  I don't see what that would cause the problems
you've noticed, though.

 > Then I reloaded and restarted Apache, and it said:
 > 
 > [fail]
 > 
 > No error output, no nothing. Just [fail].

That kind of thing is why I haven't even tried Ubuntu yet. :-)

 > I went online and found instructions for editing ports.conf and
 > apache2.conf,

You do *not* want to touch them randomly.  I see no reason why you
would *ever* want to touch ports.conf on a sandbox host.

You do need to browse apache2.conf.  And maybe change it.

 > And, lastly, I checked the error logs in /var/log/apache2, but they just
 > have a long string of instances of saying "error log at
 > /var/www/local_site.com/error.log not found".

Looks to me like there's a conflict between something in apache2.conf
and your vhost config.  Search apache2.conf for ErrorLog and CustomLog
directives.

When are these messages generated?  At Apache start time?  Do they
seem to be errors or warnings?

 > What am I supposed to do to get my virtual host working?

I would start by commenting out the ErrorLog command in the vhost
file, and if that doesn't give you joy, comment out the CustomLog
command.



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links