![]() That's all! Now you can navigate to and see your web files! Quick Side Note The other method of quickly restarting Apache is by opening System Settings > Sharing and unchecking and then checking "Web Sharing". The last step in the process is restarting your Apache install: Coupled with the nf file's new settings, the address will find your mynewsites directory! Step 4: Apache Restart Now mynewsite.local host name is pointing toward your machine. # localhost is used to configure the loopback interface We'll add another record to this file which points the new website's ServerName setting from above (mynewsite.local) to the localhost IP address: The hosts file contains a list of host names and IP address to which they match. You can learn more about the possible settings here: Step 3: Edit hosts File You can also place more specific configurations within this new virtual host, including ProxyPass, directory settings, error documents, redirects, and other settings you sometimes see in. I generally create all my hosts with the ".local" domain. ServerName refers to the address we want to type into the browser to get to this new site. DocumentRoot points to the directory we created in step 1. The two important configurations are DocumentRoot and ServerName. Let's add mynewsite to the configuration:ĭocumentRoot "/Users/myUserName/Sites/mynewsite" This configuration file holds your website virtual host location details. My nf file is located within the following directory: private/etc/apache2/extra/. The next step is adding a new record to Apache's nf file. Let's create a directory within Sites named "mynewsite":Īs you'll see in a moment, you can add this directory anywhere you'd like, but for the sake of this post we'll add it in the standard Sites directory. User websites appear in the Users/Sites/ directory. Let me show you how to create multiple websites on your local machine. Hosting websites on my local machine during development is a must. ![]() One OS X feature I make much use of is the integrated Apache server. ![]() Compared to Windows-based machines, Mac's OS X operating system is light years better. As someone who had always developed on PCs, switching over to using Mac OS X was like going from peasant to prince.
0 Comments
Leave a Reply. |