
Basically both of them are designed to perform similar kind of tasks but still they are different from each other. Thank you for reading my blog.Mac OS is the name that comes right after Microsoft while talking about operating system for computers. Thank you for reading, and let's connect! Now open the website again and see the beauty of your server.

I didn't, so create the folder in the place you provided in the vhost file and create a simple index.php inside. If you open your website link, another app might point to the default page, depending on whether you already set up the folder. Make sure you use the domain you set in the vhost file. sudo nano /etc/hostsĪnd add a line like this: 127.0.0.1 daily-dev-tips.local To make the local domain work, we need to map the domain to our local server. However, if we now visit: we don't see anything. Now we need to restart Apache sudo apachectl restart Next, set the ServerName to the URL you want to serve it on.

For me, it's a www folder at my user level. You have to set the DocumentRoot to your own directory on your local machine. Place the following information inside: DocumentRoot "/Users/chrisbongers/www/daily-dev-tips" ServerName daily-dev-tips.local AllowOverride All Require all granted Now we can create our first configuration in that folder. Now we need to make the configuration files, make sure the directory exist or create it. Note: You could also add all the hosts in the httpd-vhost file, but I found this a cleaner method. Look for the following line: #Include /private/etc/apache2/extra/nfĪnd below that, on a new line add the following: Include /private/etc/apache2/vhosts/ *. Execute the following command in your terminal. To do this, we need to modify the nf file. The first step to making this work is enabling virtual hosts on Mac OS X. Today, we'll set up a local PHP website that we can reach through our browser. It's actually possible to host a website on your local Mac, and it's not as hard as you would think! You might remember the days of MAMP/XAMP/WAMP? Well, for Mac OS X, we don't need these tools anymore.


Hosting a website on your Mac using Virtual Hosts 9 Jun, 2021
