![]() ![]() ![]() Each ServerName entry needs to match a host name from “/etc/hosts”, then we just specify the paths for the PHP/HTML files ( DocumentRoot), and the two log files. We’ve set up two virtual hosts in here, “scratch.localdev” and “my-client.localdev”. # Each site needs a ServerName that matches an entry in /etc/hostsĭocumentRoot "/Applications/XAMPP/vhosts/scratch.localdev/htdocs"ĮrrorLog "/Applications/XAMPP/vhosts/scratch.localdev/log/error.log"ĬustomLog "/Applications/XAMPP/vhosts/scratch.localdev/log/access.log" commonĭocumentRoot "/Applications/XAMPP/vhosts/my-client.localdev/htdocs"ĮrrorLog "/Applications/XAMPP/vhosts/my-client.localdev/log/error.log"ĬustomLog "/Applications/XAMPP/vhosts/my-client.localdev/log/access.log" common # All our websites are stored in sub-directories under here. Delete all the text in the file (it’s just comments and examples), replace it with the following, save the changes then exit Text Editor. ![]() This is where we tell Apache about our individual virtual hosts. In Finder, navigate to Applications > XAMPP > etc > extra and open “nf” in Text Editor. Enable the vhosts sub-configuration in XAMPP if it starts with #), remove the # and save the file. The line that comes after it should read Include etc/extra/nf. Select the “Apache Web Server”, click “Configure”, open the “Conf” file and find the line, # Virtual Hosts. If the XAMPP Control Panel isn’t already running, start it now. We need to check, and maybe adjust, Apache’s core configuration file to make sure the vhosts (Virtual Hosts) sub-configuration is enabled. Test these have worked by pinging one of the host names from the terminal, like this: # Ping one of our custom host names Edit the /etc/hosts file as administrator, on a Mac ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |