Mainos / Advertisement:
Ero sivun ”Apache2” versioiden välillä
Siirry navigaatioon
Siirry hakuun
Rivi 19: | Rivi 19: | ||
== .htaccess == | == .htaccess == | ||
− | . | + | .htaccess tiedosto mahdollistaa konfigurointi tiedostojen tallentamisen suoraan verkkosivuhakemistoon, esimerkiksi /var/www/.htaccess. |
+ | |||
+ | Sallitaan .htaccess tiedoston ylikirjoittamaan entiset konfiguroinnit: | ||
− | |||
/etc/apache2/sites-available/default | /etc/apache2/sites-available/default | ||
Rivi 36: | Rivi 37: | ||
#RedirectMatch ^/$ /apache2-default/ | #RedirectMatch ^/$ /apache2-default/ | ||
</Directory> | </Directory> | ||
+ | Käynnistä Apache uudelleen: | ||
+ | |||
+ | service apache2 restart | ||
+ | |||
+ | Luodaan .htaccess tiedosto /var/www/.htaccess |
Versio 5. toukokuuta 2014 kello 20.34
Apache on yleinen verkkosivuja varten palvelu.
Apachen asennetaan komennolla:
aptitude install apache2
Apachen oletusverkkosivuhakemisto sijaitsee:
/var/www
Apachen konfigurointi tiedostot löytyvät täältä:
/etc/apache2
Oletusverkkosivun asetukset löytyvät täältä:
nano /etc/apache2/sites-enabled/000-default
.htaccess
.htaccess tiedosto mahdollistaa konfigurointi tiedostojen tallentamisen suoraan verkkosivuhakemistoon, esimerkiksi /var/www/.htaccess.
Sallitaan .htaccess tiedoston ylikirjoittamaan entiset konfiguroinnit:
/etc/apache2/sites-available/default
seuraavanlaiseksi:
<Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all # Uncomment this directive is you want to see apache2's # default start page (in /apache2-default) when you go to / #RedirectMatch ^/$ /apache2-default/ </Directory>
Käynnistä Apache uudelleen:
service apache2 restart
Luodaan .htaccess tiedosto /var/www/.htaccess
Mainos / Advertisement: