Ich entfernte MacPorts nach ihrer Leitlinie vollständig hier . Deinstallieren aller Ports und Entfernen aller Ordner
sudo rm -rf \ /opt/local \ /Applications/DarwinPorts \ /Applications/MacPorts \ /Library/LaunchDaemons/org.macports.* \ /Library/Receipts/DarwinPorts*.pkg \ /Library/Receipts/MacPorts*.pkg \ /Library/StartupItems/DarwinPortsStartup \ /Library/Tcl/darwinports1.0 \ /Library/Tcl/macports1.0 \ ~/.macports
Ich habe dann Homebrew, dnsmasq und MySQL installiert. Die letzten beiden, die ich mit Brew und Apache installiert habe, wollten ich nativ ausführen. Nun scheint es so, als würde Apache immer noch über Macports laufen.
ps ax | grep httpd 254 ?? Ss 0:00.72 /opt/local/apache2/bin/httpd -k start 258 ?? S 0:00.02 /opt/local/apache2/bin/httpd -k start 259 ?? S 0:00.01 /opt/local/apache2/bin/httpd -k start 262 ?? S 0:00.01 /opt/local/apache2/bin/httpd -k start 1811 ?? S 0:00.01 /opt/local/apache2/bin/httpd -k start 1812 ?? S 0:00.01 /opt/local/apache2/bin/httpd -k start 1818 ?? S 0:00.01 /opt/local/apache2/bin/httpd -k start 1820 ?? S 0:00.01 /opt/local/apache2/bin/httpd -k start 1826 ?? S 0:00.02 /opt/local/apache2/bin/httpd -k start 1857 ?? S 0:00.02 /opt/local/apache2/bin/httpd -k start 2336 ?? S 0:00.01 /opt/local/apache2/bin/httpd -k start 3720 s000 S+ 0:00.00 grep httpd
Obwohl alle Ports entfernt wurden sowie alle Ordner, die sich auf MacPorts beziehen. Ich denke auch, dass alle Trägerraketen entfernt wurden. Wie kann httpd jetzt geladen werden?
Ein anderes Problem besteht darin, dass DocumentRoot weder das Standarddokument noch DocumentRoot "/Library/WebServer/Documents"
von DocumentRoot lädt . Es scheint das alte MacPorts documentRoot zu laden, aber woher? Alle Dateien und Ordner sind soweit ich weiß verschwunden. Und wenn ich danach suche, wird der neue DocumentRoot angezeigt/etc/apache2/httpd.conf
/private/etc/apache2/httpd.conf
sudo apachectl -V | grep -i SERVER_CONFIG_FILE | cut -f2 -d'"' | xargs grep -i '^DocumentRoot' | cut -f2 -d'"' /Library/WebServer/Documents
Und als ich den OSX-Apache entladen und geladen habe, wurde eine Fehlermeldung angezeigt, die darauf hinweist, dass mein vhost geladen wurde:
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist Password: jaspersmbp:etc jasper$ sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist jaspersmbp:etc jasper$ apachectl AH00112: Warning: DocumentRoot [/usr/docs/dummy-host.example.com] does not exist AH00112: Warning: DocumentRoot [/usr/docs/dummy-host2.example.com] does not exist AH00526: Syntax error on line 41 of /private/etc/apache2/extra/httpd-vhosts.conf: Invalid command 'VirtualDocumentRoot', perhaps misspelled or defined by a module not included in the server configuration
Das Öffnen von localhost lädt jedoch immer noch das falsche oder alte DocumentRoot
Hier die Hosts-Datei atm
## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost jaspersmbp.local wordpress.local joomla.local 255.255.255.255 broadcasthost ::1 localhost fe80::1%lo0 localhost # My local aliases
Und hier /etc/apache2/extra/httpd-vhosts.conf
fügte ich den VirtualHost um geladene lokale Domains mit * dev on the fly hinzu
<Virtualhost *:80> DocumentRoot "/Users/jasper/webdesign" ServerName vhosts.dev ServerAlias *.dev UseCanonicalName Off LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon ErrorLog "/Users/jasper/webdesign/vhosts-error_log" <Directory "/Users/jasper/webdesign/*"> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all </Directory> </Virtualhost>
Das Ausführen von apachectl scheint den Apache von MacPorts neu zu starten, aber ich kann es weder in .bashrc noch in .bash_profile in meinem $ PATH finden.
Und mein PFAD
echo $PATH /Users/jasper/.rvm/gems/ruby-2.1.1/bin:/Users/jasper/.rvm/gems/ruby-2.1.1@global/bin:/Users/jasper/.rvm/rubies/ruby-2.1.1/bin:/usr/local/heroku/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/jasper/.rvm/bin
Fragen sind:
- Wie kann ich den falschen Geist-Apache-Daemon stoppen?
- Wie kann ich herausfinden, wo das Dokumentstammverzeichnis tatsächlich geladen ist, und wie kann ich es ändern?