Sida 1 av 1

Får inte en subdomän att fungera (Apache)

Postat: 30 apr 2008, 15:20
av Emil.s
Vet inte vad som är fel...
Tänkte sätta upp en liten subdomän att använda till skolarbeten.

Kod: Markera allt

root@Sandnabba.se: /home/server/httpdoc/skolan #> ls -l 
total 4
-rwxrwx--- 1 server www-data  28 2008-04-30 14:53 index.html
drwx------ 2 root   root     112 2008-04-30 14:59 test
root@Sandnabba.se: /home/server/httpdoc/skolan #> cat index.html 
<p>Inget här för dig!</p>
Så långt bra...

cat /etc/apache2/sites-enabled/XXX

Kod: Markera allt

.......

# Skolan.sandnabba.se:
<VirtualHost *:80>
        ServerAdmin admin@sandnabba.se
        ServerName skolan.sandnabba.se
        DocumentRoot /home/server/httpdoc/skolan/

        ErrorLog /var/log/apache2/skolan_error.log
        CustomLog /var/log/apache2/skolan_access.log combined
</VirtualHost>

........
Efter ett besök så säger loggen:
[Wed Apr 30 15:18:15 2008] [error] [client 10.0.0.8] Directory index forbidden by Options directive: /home/server/httpdoc/skolan/

Vilken "Option"?

Följande finns, men jag vet inte vad som är fel...

Kod: Markera allt

root@Sandnabba.se: /home/server/httpdoc/skolan #> grep "Options" -R /etc/apache2/
/etc/apache2/mods-available/mime.conf:# (You will also need to add "ExecCGI" to the "Options" directive.)
/etc/apache2/mods-available/mime.conf:# (You will also need to add "Includes" to the "Options" directive.)
/etc/apache2/mods-available/userdir.conf:                Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
/etc/apache2/mods-available/alias.conf:    Options Indexes MultiViews
/etc/apache2/mods-available/autoindex.conf:# IndexOptions: Controls the appearance of server-generated directory
/etc/apache2/mods-available/autoindex.conf:IndexOptions FancyIndexing VersionSort HTMLTable NameWidth=* DescriptionWidth=*
/etc/apache2/conf.d/pitchfork.conf:	Options -Indexes
/etc/apache2/mods-enabled/mime.conf:# (You will also need to add "ExecCGI" to the "Options" directive.)
/etc/apache2/mods-enabled/mime.conf:# (You will also need to add "Includes" to the "Options" directive.)
/etc/apache2/mods-enabled/userdir.conf:                Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
/etc/apache2/mods-enabled/alias.conf:    Options Indexes MultiViews
/etc/apache2/mods-enabled/autoindex.conf:# IndexOptions: Controls the appearance of server-generated directory
/etc/apache2/mods-enabled/autoindex.conf:IndexOptions FancyIndexing VersionSort HTMLTable NameWidth=* DescriptionWidth=*
/etc/apache2/apache2.conf:#        Options IncludesNoExec

Re: Får inte en subdomän att fungera (Apache)

Postat: 30 apr 2008, 16:00
av KiviE
I konfig filen för din virtuella host kanske de här raderna hjälper

Kod: Markera allt

<Directory /home/server/httpdoc/skolan>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
</Directory>
Vet inte om de är nödvändiga men man brukar ha lite sådana inställningar.

Här står lite om virtuella hostar med http://ubuntu-se.org/wiki/Servrar/apache_vhost

Re: Får inte en subdomän att fungera (Apache)

Postat: 30 apr 2008, 16:09
av Emil.s
Upptäckte nu att Directory index inte fungerar någonstans! Iallafall inte i något Vhost. Däremot i (...).sandnabba.se/~users.

Den enda <Directory> jag har är denna:
<Directory /home/server/httpdoc >
AllowOverride All
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</Directory>

Och det har alltid fungerat förut...

Re: Får inte en subdomän att fungera (Apache)

Postat: 02 maj 2008, 13:35
av andol
Att /~foo fungerar annorlunda beror på att där så används /etc/apache2/mods-available/userdir.conf