Ubuntu Suomen keskustelualueet
Ubuntun käyttö => Ohjelmointi, palvelimet ja muu edistyneempi käyttö => Aiheen aloitti: Make1 - 10.06.08 - klo:19.34
-
Mor! Pitääkö tuolla Apache2 http.conf tiedostossa olla tekstiä? KUn avaan se on ihan tyhjä.
-
Mor! Pitääkö tuolla Apache2 http.conf tiedostossa olla tekstiä? KUn avaan se on ihan tyhjä.
Moi!
Ei pidä, sen sisältö on räjäytetty ympäri tota /etc/apache2:ta. Httpd.confissakin olevat merkinnät tosin käsitellään.
Pääasiassa konffittavia ovat mm. /etc/apache2/apache2.conf ja /etc/apache2/sites-available/default.
-
Kirjoitanko nämä komennot httpd.conf vai apache2.conf tiedostoon? koodia:
rivi 339: #UserDir disable
rivi 346: UserDir public_html
mkdir ~oppilas/public_html
$EDITOR ~oppilas/public_html/index.htm
chmod 711 ~oppilas/public_html
chmod a+r ~oppilas/public_html/index.htm
<Directory /home/oppilas/public_html/suojattu*>
AllowOverride AuthConfig
AuthUserFile /home/oppilas/public_html/.htpasswd
AuthType Basic
AuthName “Salasanaa vaativa hakemisto�?
Require valid-user
</Directory>
<Directory /home/oppilas/*>
Order deny.allow
Deny from all
Allow from sallittavan.koneen.ip.osoite
</Directory>
<VirtualHost apache.palvelimen.ip.osoite>
ServerAdmin webmaster@wwwmalli.jee
DocumentRoot /home/oppilas/public_html
ServerName wwwmalli.jee
ServerAlias www.wwwmalli.jee
ErrorLog logs/wwwmalli.jee-error_log
CustomLog logs/wwwmalli.jee-access_log common
</VirtualHost>
-
Eli tahdot tehdä käyttäjille omat hakemistot, jotka näkyvät osoitteella hosti/~käyttäjä?
Se onnistuu nykyään näin helposti (rivi kerrallaan syötät nämä komennot päätteeseen):sudo a2enmod userdir
mkdir /home/käyttäjä/public_html
Nuo <directory> säädökset voit heittää tonne /etc/apache2/sites-available/default -tiedostoon, soveltaen toki kun siellä varmaan jotain säätöjä on jo.
-
Siel on tällästä: NameVirtualHost *
<VirtualHost *>
ServerAdmin Make@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>
Laitanko noi directory ton virtualhostin perään??