Hosten Sie mehrere Domänen "virtuellen Host" in einem einzigen Apache Server - MAMP

852
kyo

Tor

Ich versuche, mehrere Domains "Virtual Host" in einem einzigen Apache Server - MAMP zu hosten.


Versuch

In meinem MAMP wähle ich Port aus 8888


Ich habe das am Ende meines host fileauf meinem Mac

/ etc / hosts

127.0.0.1 l.ssc.com 127.0.0.1 l.pm.com 

httpd.conf

Ich habe hinzugefügt

<VirtualHost l.ssc.com:8888 > ServerName l.ssc.com DocumentRoot "/Applications/MAMP/htdocs/code/benu/ssc-portal/public/" <Directory "/Applications/MAMP/htdocs/code/benu/ssc-portal/public/"> # Require all granted Options All AllowOverride All Order allow,deny Allow from all XSendFilePath "/Applications/MAMP/htdocs" </Directory> </VirtualHost>   <VirtualHost l.pm.com:8888 > ServerName l.pm.com DocumentRoot "/Applications/MAMP/htdocs/code/biossantibodies/public/" <Directory "/Applications/MAMP/htdocs/code/biossantibodies/public/"> # Require all granted Options All AllowOverride All Order allow,deny Allow from all XSendFilePath "/Applications/MAMP/htdocs" </Directory> </VirtualHost> 

und starte mein MAMP neu.


Ergebnis

Nachdem Sie beide Standorte besucht haben,

http://l.ssc.com:8888/

UND

http://l.pm.com:8888/

Ich sah immer die gleiche Seite geladen, die erste, die in meiner httpd.conf -Datei deklariert wurde .

Hosten Sie mehrere Domänen


Ich gehe davon aus, dass http://l.pm.com:8888/ das andere Dokumentstammverzeichnis lädt.


Frage

Wie würde man gehen und dies debuggen?


Ich bin offen für alle Vorschläge in diesem Moment.

Alle Hinweise / Vorschläge / Hilfen dazu werden sehr geschätzt!

0

1 Antwort auf die Frage

0
kyo

Hier die Schritte, die ich unternommen habe, um dies zu erreichen

- Die Aktie MAMP DOCUMENT_ROOT wurde auskommentiert

/Applications/MAMP/conf/apache/httpd.conf

# MAMP DOCUMENT_ROOT !! Don't remove this line !!  # DocumentRoot "/Applications/MAMP/htdocs/code/benu/ssc-portal/public" # <Directory "/Applications/MAMP/htdocs/code/benu/ssc-portal/public"> # Options All # AllowOverride All # Order allow,deny # Allow from all # XSendFilePath "/Applications/MAMP/htdocs" # </Directory> 

Stellen Sie sicher, dass Sie eine vhost-Datei einschließen, indem Sie die folgende Zeile auskommentieren

# Virtual hosts Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf 

- Fügen Sie der vhost-Datei configs hinzu

/Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

NameVirtualHost *:8888  <VirtualHost *:8888 > ServerName l.ssc.com DocumentRoot "/Applications/MAMP/htdocs/code/benu/ssc-portal/public/" <Directory "/Applications/MAMP/htdocs/code/benu/ssc-portal/public/"> # Require all granted Options All AllowOverride All Order allow,deny Allow from all XSendFilePath "/Applications/MAMP/htdocs" </Directory> </VirtualHost>   <VirtualHost *:8888 > ServerName l.pm.com DocumentRoot "/Applications/MAMP/htdocs/code/biossantibodies/public/" <Directory "/Applications/MAMP/htdocs/code/biossantibodies/public/"> # Require all granted Options All AllowOverride All Order allow,deny Allow from all XSendFilePath "/Applications/MAMP/htdocs" </Directory> </VirtualHost> 

- MAMP neu starten