I removed MacPorts completely following their guideline here. uninstaling all ports and then removing all folders
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
I then installed homebrew, dnsmasq and MySQL. The latter two I installed using Brew and Apache I wanted to run natively. Now the isue seems to be that Apache is still running via Macports.
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
This although all ports have been removed as well as all folders related to MacPorts. I also think all launchers have been removed. How could httpd be loaded now?
Other issue is that the DocumentRoot does not load the default documentRoot
DocumentRoot "/Library/WebServer/Documents" from
/private/etc/apache2/httpd.conf . It seems to load the old MacPorts documentRoot, but from where? All files and folders are gone as far as I know. And when I check for it, it does show the new DocumentRoot
sudo apachectl -V | grep -i SERVER_CONFIG_FILE | cut -f2 -d'"' | xargs grep -i '^DocumentRoot' | cut -f2 -d'"' /Library/WebServer/Documents
And when I unloaded and loaded OSX's Apache I did get an error message showing my vhost was loaded:
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
But opening localhost still loads wrong or old DocumentRoot
Here the hosts file 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
And here the VirtualHost at
/etc/apache2/extra/httpd-vhosts.conf I added to loaded local domains with *dev on the fly
<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>
Running apachectl seems to restart MacPorts' Apache, but I cannot find it in .bashrc nor .bash_profile in my $PATH.
And my PATH
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
- How can I stop the wrong ghost Apache daemon
- How can I find where the document root is really loaded from and change?