{"id":3627,"date":"2015-04-02T21:30:22","date_gmt":"2015-04-02T21:30:22","guid":{"rendered":"http:\/\/webninjataylor.com\/library\/?p=3627"},"modified":"2015-04-02T21:31:05","modified_gmt":"2015-04-02T21:31:05","slug":"create-multiple-localhosts","status":"publish","type":"post","link":"https:\/\/webninjataylor.com\/library\/create-multiple-localhosts\/","title":{"rendered":"Create Multiple Localhosts"},"content":{"rendered":"<h2>Change Default Listening Port<\/h2>\n<p>Go to MAMP &gt; Preferences &gt; Ports and set Apache Port to be 80.<\/p>\n<h2>Set up Localhosts\u00a0in Hosts File<\/h2>\n<p>Edit your hosts file so that you have some domains that will resolve to your local web server&#8230;<\/p>\n<pre>sudo pico \/etc\/hosts<\/pre>\n<p>Add the domains you want to resolve to your localhost&#8230;<\/p>\n<pre>127.0.0.1 local.example.com\r\n127.0.0.1 my-github-repo<\/pre>\n<h2>Add Virtual Hosts to your Apache\u00a0Config<\/h2>\n<p>Open up \/Applications\/MAMP\/conf\/apache\/httpd.conf in a text editor, scroll down, and add the following lines to the file&#8230;<\/p>\n<pre>NameVirtualHost *\r\n\r\n&lt;VirtualHost *&gt;\r\nDocumentRoot \"\/Applications\/MAMP\/htdocs\"\r\nServerName localhost\r\n&lt;\/VirtualHost&gt;\r\n\r\n&lt;VirtualHost *&gt;\r\nDocumentRoot \"\/Users\/YOURNAME\/sites\/example-a\"\r\nServerName local.example.com\r\n&lt;\/VirtualHost&gt;\r\n\r\n&lt;VirtualHost *&gt;\r\nDocumentRoot \"\/Users\/YOURNAME\/Downloads\/my-github-repo\"\r\nServerName my-github-repo\r\n&lt;\/VirtualHost&gt;\r\n<\/pre>\n<h2>Restart Apache<\/h2>\n<p>Stop Servers and then Start Servers on MAMP. Now you can visit the URL&#8217;s you configured like\u00a0http:\/\/local.example.com\/ and http:\/\/my-github-repo\/<\/p>\n<h2>Resources<\/h2>\n<ul>\n<li><a href=\"http:\/\/serverfault.com\/questions\/146550\/how-to-set-up-multiple-websites-virtual-hosts-on-mamp\" target=\"_blank\">StackExchange\u00a0Post<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Change Default Listening Port Go to MAMP &gt; Preferences &gt; Ports and set Apache Port to be 80. Set up Localhosts\u00a0in Hosts File Edit your hosts file so that you have some domains that will resolve to your local web server&#8230; sudo pico \/etc\/hosts Add the domains you want to resolve to your localhost&#8230; 127.0.0.1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[144],"tags":[142,147,157],"class_list":["post-3627","post","type-post","status-publish","format-standard","hentry","category-web-shots","tag-debugging","tag-mo","tag-tools"],"_links":{"self":[{"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/posts\/3627","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/comments?post=3627"}],"version-history":[{"count":2,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/posts\/3627\/revisions"}],"predecessor-version":[{"id":3629,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/posts\/3627\/revisions\/3629"}],"wp:attachment":[{"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/media?parent=3627"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/categories?post=3627"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webninjataylor.com\/library\/wp-json\/wp\/v2\/tags?post=3627"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}