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) [SOLVED]



TLUG,

Thank you guys so much for your help.

Making a long story short, I think the critical difference was I needed
to change where it said "<VirtualHost *>" to "<VirtualHost *:80>" in the
config file I created for my site in my /etc/apache2/sites-available
directory.

None of the other config files need to be altered or touched. I
completely uninstalled Apache, including removing any and all
configuration files, then re-installed it, to make sure I didn't have
any previous edits floating around.

There also might have been some naming confusion, which was also the
source of the error logs not finding the right directories. I tend to
name my local testing site "http://local_mysite.com"; so that when I'm
testing I don't confuse it with the actual "http://mysite.com"; that's
live on the web. But sometimes I mix up when to use the "local_" prefix
in my directory names and when not to. So I made sure I was consistent.

After I ensured I had a clean Apache server without any of my bumbling
edits, I created a file in /etc/apache2/sites-available called
local_mysite.com, and put in the correct configuration file (below).

After that, I ran "sudo a2ensite local_mysite.com", then
"/etc/init.d/apache2 reload".

Boom! The site works.

Thanks to everyone who advised and educated me about what the deal with
Apache is.


Just for future reference, this is the contents of my
"/etc/apache2/sites-available/local_mysite.com" file:

<VirtualHost *:80>
   ServerName www.local_mysite.com
   ServerAlias local_mysite.com
   ServerAdmin webmaster@example.com

   DocumentRoot /var/www/local_mysite.com
   <Directory /var/www/local_mysite.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 /home/dave/Apache_Logs/local_mysite.com/error.log

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

   CustomLog /home/dave/Apache_Logs/local_mysite.com/access.log combined
   ServerSignature On

</VirtualHost>


-- 
Dave M G


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links