Apache2 site setup issues

Questions about applications and software
Forum rules
Before you post please read this

Apache2 site setup issues

Postby pdincubus on Fri Jun 13, 2008 1:41 pm

Hi all, be gentle - this is my first post! :)

I've added apache2, phpmyadmin, mysql and set up everything (as far as I can tell) correctly. if i visit 127.0.0.1 i get the usual "it works!" message, and i can login to phpmyadmin and mess to my heart's content.

The problem I have is when I add extra sites to local host, I've added the site names to the /etc/hosts file alongside my box name and localhost and when i visit the sites i get "internal server error" on any site but the default. I'm sure the site config is ok, or at least it's set up almost identical (bar the directories for the sites, and the sitenames) to a kubuntu box i set up at work. I can't see what I've done wrong - any ideas?

Below is my current config, i've edited out the names of directories and sites, etc. I've also got four extra sites set up on the actual config, all of which do the same. I've just included one below to save a little space.

Code: Select all
NameVirtualHost *
<VirtualHost *>
   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 /var/log/apache2/error.log

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

   CustomLog /var/log/apache2/access.log combined
   ServerSignature On

    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>

<VirtualHost *>
   ServerName site1
   ServerAdmin webmaster@localhost
   DocumentRoot /home/me/Websites/site1/
   <Directory "/home/me/Websites/site1">
      allow from all
      Options +Indexes
   </Directory>
   ServerAlias site1
</VirtualHost>


any help much appreciated!
:D
pdincubus
Level 1
Level 1
 
Posts: 4
Joined: Wed Jun 11, 2008 8:40 am
Location: England, UK

Linux Mint is funded by ads and donations.
 

Re: Apache2 site setup issues

Postby pdincubus on Fri Jun 13, 2008 6:21 pm

i've figured out the problem after a lot of digging around and a quick peak inside /var/log/apache2/error.log gave away the big clue.

Code: Select all
[Fri Jun 13 23:10:59 2008] [alert] [client 127.0.0.1] /home/me/Websites/site1/.htaccess: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration


i just had to create a symlink from /etc/apache2/mods-available/headers.load to /etc/apache2/mods-enabled/headers.load then run an apache2ctl graceful and away we go, seems to be working fine now :)
pdincubus
Level 1
Level 1
 
Posts: 4
Joined: Wed Jun 11, 2008 8:40 am
Location: England, UK


Return to Software & Applications

Who is online

Users browsing this forum: menhir and 13 guests