Mailing List Archive


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

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



Well, things do change, and yes most people do hate that...
Try to step back and look from above, try to stay calm, it does help.

On Wed, Jan 20, 2010 at 11:30, Dave M G <dave@example.com> wrote:
[snip]
> Here's my current situation. I created a file for my site, called
> local_site.com in /etc/apache2/sites-available and put in the following
> configuration (taken off the web)
>
> - - - - -
>
> <VirtualHost *>
>        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
>
> </VirtualHost>
>
> - - - - -
>
> Then I ran "sudo a2ensite local_site.com", and it said "enabled".
>
> So far so good.
>
> Then I reloaded and restarted Apache, and it said:
>
> [fail]
>
> No error output, no nothing. Just [fail].
>
> I went to http://local_site.com and sometimes when I do, I get the
> default "It works!" page. Which I also get if I go to http://localhost.
>
> But sometimes if I reload it, I then get an "unable to connect" warning.
>
> I went online and found instructions for editing ports.conf and
> apache2.conf, but basically any and all edits I made to those files
> resulted in errors coming out when I restarted Apache. So for now I've
> put them back to their original.
>
> 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".

Maybe permissions problem? May be default index problem?

Assuming you run as apache:

touch /var/www/local_site.com/error.log
echo "TLUG" > /var/www/local_site.com/test.txt
chmod -R apache:apache /var/www/local_site.com
chmod 0755 /var/www/local_site.com/
chmod 0660 /var/www/local_site.com/error.log

restart apache, have a look at the log, try to access
http://local_site.com/test.txt

Try investigating with apache2ctl (if Ubuntu has it), check if
processes are running (top, htop, pstree), even try to strace the
daemon...


You are not running SELinux by chance, are you? I run into this in
recent CentOS install... (try as root `sestatus` if you have it)

Kalin.


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links