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

Konfiguration av nätverk, hur man använder Ubuntu som server, och håller sin dator säker
Emil.s
Inlägg: 6633
Blev medlem: 12 dec 2006, 23:20
OS: Ubuntu
Ort: /Dalarna/Hedemora/
Kontakt:

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

Inlägg 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
Home sweet ~/ = http://sandnabba.se
KiviE
Inlägg: 2157
Blev medlem: 25 okt 2007, 14:00
OS: Ubuntu
Utgåva: 22.04 Jammy Jellyfish LTS
Ort: Luleå

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

Inlägg 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
Emil.s
Inlägg: 6633
Blev medlem: 12 dec 2006, 23:20
OS: Ubuntu
Ort: /Dalarna/Hedemora/
Kontakt:

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

Inlägg 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...
Home sweet ~/ = http://sandnabba.se
andol
Inlägg: 3093
Blev medlem: 31 dec 2007, 00:19
OS: Ubuntu
Utgåva: 23.10 Mantic Minotaur

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

Inlägg av andol »

Att /~foo fungerar annorlunda beror på att där så används /etc/apache2/mods-available/userdir.conf
Skriv svar

Återgå till "Nätverk, säkerhet och servrar"