Apache autostart

Inlagd av: admin på 11 man 8th, 2008

Starta och starta Apache-server är konfigurerad att starta automatiskt.
Servern har tidigare enligt följande.
 # cd /usr/local/etc/rc.d
# cp /usr/local/apache2/bin/apachectl /usr/local/etc/rc.d/apache.sh
# chmod 0755 /usr/local/etc/rc.d/apache.sh 
Det är apachectl start att börja med det nyligen är följande.
/etc/rc.local
 # Start Apache
/usr/local/apache2/bin/apachectl start 
apachectl kommer att passera om man inte vet hur man installerar olika versioner och ser ut på följande sätt.
 # which apachectl 

Metatagg charset förvrängda och skulle ange

Inlagd av: admin på 11 man 5th, 2008

En tidigare version av Apache som standard AddDefaultCharset direktivet "ISO-8859-1 (Latin-europeiska språk, franska, tyska)" skall anges.
Apache2.2 senare AddDefaultCharset standardinställning av direktivet är det inte.
httpd.conf och fixar.
httpd.conf finns vanligtvis nedan.
 /usr/local/apache2/conf 
Eller
 /usr/local/etc/apache2 

httpd.conf
 AddDefaultCharset  off 
Men i detta fall följande sidor alla charset måste anges.
 <META http-equiv=Content-Type content="text/html; charset=Shift_JIS"> 

Allt innehåll är samma karaktär kodning (teckenuppsättning) när det charset kan du även ange följande.
httpd.conf
 AddDefaultCharset  EUC-JP 

När du har en fast, Apache starta.
 # /usr/local/apache2/bin/apachectl restart 
apachectl kommer att passera om man inte vet hur man installerar olika versioner och ser ut på följande sätt.
 # which apachectl 

Visa inte innehållet i katalogen

Inlagd av: admin på 11 man 5th, 2008

Om du anger katalognamn i webbläsarens adressfält, index.html / index.php / index.cgi om du index.html / index.php / index.cgi föremål, hur man undviker dem och fortfarande se fillistan.
Google i index of Om du söker, du får vad分RI.
httpd.conf och fixar.
httpd.conf finns vanligtvis nedan.
 /usr/local/apache2/conf 
Eller
 /usr/local/etc/apache2 

httpd.conf
 Options  Indexes  FollowSymLinks 
Indexes bort
 Options FollowSymLinks 

När du har en fast, Apache
 # /usr/local/apache2/bin/apachectl restart 
apachectl kommer att passera om man inte vet hur man installerar olika versioner och ser ut på följande sätt.
 # which apachectl 

Konfigureras för att använda CGI

Inlagd av: admin på 11 man 5th, 2008

httpd.conf och fixar.
httpd.conf finns vanligtvis nedan.
 /usr/local/apache2/conf 
Eller
 /usr/local/etc/apache2 

Kommenterade av bullet (#), ta bort
httpd.conf
 AddHandler cgi-script .cgi 

Options för att ändra direktivet
httpd.conf
 <Directory />
     Options ExecCGI FollowSymLinks Includes MultiViews 
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory> 

URL från "~" (tilde) för att eliminera

Inlagd av: admin på 11 man 5th, 2008

httpd.conf och fixar.
httpd.conf finns vanligtvis nedan.
 /usr/local/apache2/conf 
Eller
 /usr/local/etc/apache2 

httpd.conf
 Alias / USERNAME / "/home/ USERNAME /public_html/"
<Directory "/home/ USERNAME /public_html">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory> 
Directory i direktivet är ett exempel. Ändra vid behov.