httpd -vsudo apachectl startmkdir /Sitessudo nano /etc/apache2/users/USERNAME.conf<Directory "/Users//Sites/">Options Indexes MultiViews FollowSymLinksAllowOverride AllRequire all granted</Directory>sudo nano /etc/apache2/httpd.confLoadModule userdir_module libexec/apache2/mod_userdir.soLoadModule alias_module libexec/apache2/mod_alias.soLoadModule rewrite_module libexec/apache2/mod_rewrite.soLoadModule php5_module libexec/apache2/libphp5.so_www to USERNAME in httpd.confUser USERNAMEGroup staff<Directory "/Library/WebServer/Documents">...AllowOverride All...</Directory>Include /private/etc/apache2/extra/httpd-userdir.confsudo nano /etc/apache2/extra/httpd-userdir.confInclude /private/etc/apache2/users/.confsudo apachectl restartprintf "<?php phpinfo(); ?>" > /Sites/phpinfo.phpsudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plistsudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist/Library/WebServer/Documents/ or in /Users/USERNAME/Sites//Library/WebServer/Documents/sudo mkdir /Library/WebServer/Documents/MYWEBSITE/Users/USERNAME/Sites/mkdir /Users/USERNAME/Sites/MYWEBSITE.dmg install file for OSX 10.10 and install itsudo /usr/local/mysql/support-files/mysql.server start/usr/local/mysql/bin/mysql -vnano /.bash_profileexport PATH="/usr/local/mysql/bin:$PATH"source /.bash_profilemysql -v/usr/local/mysql/bin/mysqladmin -u root password 'yourpasswordhere'sudo mkdir /var/mysqlsudo ln -s /tmp/mysql.sock /var/mysql/mysql.socksudo nano /etc/apache2/httpd.confInclude /private/etc/apache2/extra/httpd-vhosts.confLoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.sosudo nano /etc/apache2/extra/httpd-vhosts.conf<VirtualHost :80>ServerName mywebsite.comServerAlias www.mywebsite.com
DocumentRoot "/Users/USERNAME/Sites/mywebsite"
ErrorLog "/private/var/log/apache2/mywebsite.com-error_log"
CustomLog "/private/var/log/apache2/mywebsite.com-access_log" common
ServerAdmin web@mywebsite.com
<Directory "/Users/USERNAME/Sites/mywebsite">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Restart apache
sudo apachectl restart
Set the hosts file
> Edit hosts
sudo nano /etc/hosts
> Add this to map domain
127.0.0.1 mywebsite.com www.mywebsite.comdscacheutil -flushcachesudo dscacheutil -flushcachesudo nano /etc/apache2/extra/httpd-vhosts.conf<VirtualHost :80>ServerName localhostDocumentRoot /Library/WebServer/Documents/</VirtualHost>iduid=501(USERNAME) gid=20(staff)sudo nano /etc/apache2/httpd.confUser USERNAMEGroup staffsudo apachectl restartNo comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.