Apache: Unterschied zwischen den Versionen

Aus Wikizone
Wechseln zu: Navigation, Suche
Zeile 29: Zeile 29:
 
Mit Bordmitteln (Apache und PHP ist Teil von High Sierra mySQL wird dazu installiert)
 
Mit Bordmitteln (Apache und PHP ist Teil von High Sierra mySQL wird dazu installiert)
 
[[Apache, PHP, mySQL auf High Sierra]]
 
[[Apache, PHP, mySQL auf High Sierra]]
 +
 +
== Virtual Host ==
 +
Virtual Hosts kann man folgendermaßen einrichten:
 +
 +
etc/httpd.conf - diese Zeile auskommentieren (oder einfügen wenn nicht vorhanden)
 +
Include etc/extra/httpd-vhosts.conf
 +
 +
Die Virtuellen Hosts können minimal z.b. so aussehen:
 +
 +
httpd-vhosts.conf file in the etc/extra/
 +
<pre>
 +
<VirtualHost *:80>
 +
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/" ServerName localhost
 +
</VirtualHost>
 +
<VirtualHost *:80>
 +
DocumentRoot "/Applications/XAMPP/xamppfiles/apps/wordpress/htdocs"
 +
ServerName wordpress.localhost </VirtualHost>
 +
</pre>
 +
Dabei ist der erste der Default Host für alle Domains die nicht explizit vorgegeben sind. Danach kommen beliebig viele Blöcke für Domains.

Version vom 31. Oktober 2020, 22:55 Uhr

Tipps und Tricks für die Arbeit mit dem Apache Server.

Siehe auch:

htaccess Apache auf dem Mac etc.
Mac - Apache MySql PHP Server mit Homebrew Super flexible Möglichkeit.

Apache2 und CGI/FastCGI

Apache2 und CGI/FastCGI

Informationen der Apache Umgebung herausfinden

In der Shell

httpd -V 

gibt einige Informationen zu Logfiles, Konfigurationsfiles etc. aus. Funktioniert auch unter Windows, Mac usw.

XAMPP auf Mac Apache Port ändern

Problem: In Mac OSX läuft bereits ein Apache auf Port 80. Wenn zusätzlich eine XAMPP Installation als Testumgebung läuft kann das zu langen Wartezeiten führen. Lösung: XAMPP auf Port 8080 umstellen. Dazu in etc/httpd.conf

Listen 8080 

einstellen. Dann im Browser mit

http://localhost:8080

aufrufen.

Eigener AMP Server mit Homebrew

Mac - Apache MySql PHP Server mit Homebrew

Apache mySQL PHP auf Mac High Sierra

Mit Bordmitteln (Apache und PHP ist Teil von High Sierra mySQL wird dazu installiert) Apache, PHP, mySQL auf High Sierra

Virtual Host

Virtual Hosts kann man folgendermaßen einrichten:

etc/httpd.conf - diese Zeile auskommentieren (oder einfügen wenn nicht vorhanden)

Include etc/extra/httpd-vhosts.conf

Die Virtuellen Hosts können minimal z.b. so aussehen:

httpd-vhosts.conf file in the etc/extra/

<VirtualHost *:80>
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/" ServerName localhost
</VirtualHost> 
<VirtualHost *:80>
DocumentRoot "/Applications/XAMPP/xamppfiles/apps/wordpress/htdocs"
ServerName wordpress.localhost </VirtualHost>

Dabei ist der erste der Default Host für alle Domains die nicht explizit vorgegeben sind. Danach kommen beliebig viele Blöcke für Domains.