Immediately after that, add the following lines, changing sitename to the name of the new dev site’s folder, again using the appropriate letter in place of drive.We’ll add code for each dev site’s folder in the next step. Open your drive:\xampp\apache\conf\extra\nf file and add the following lines to the end of the file, using the appropriate letter in place of drive.127.0.0.1 sitename.localhostĪdd a new line for each dev site folder you create.Ĭontinuing with the example, I’ve added the line: Don’t change or delete the existing “127.0.0.1 localhost” line. Edit your HOSTS file (in Windows XP, the HOSTS file is located in C:\WINDOWS\system32\drivers\etc\) to add the following line, where sitename is the name of the folder you created in step 1. ![]() For example, if I’m creating a development site for on my d: drive, I’d create a folder at: Create a folder in drive:\xampp\htdocs\ for each dev site (adjust for your directory structure).Here’s how I managed to get it working: For XAMPP version 1.6.5 If you are having problems configuring your Apache installation to use the NameVirtualHost feature, you’re in good company. Unfortunately, setting up NameVirtualHost can be kind of tricky. This works great for all sorts of applications that rely on the site having a discernible root directory, such as WordPress. For example, I access the local dev version of this site at. You will be able to access each local site as a subdomain of “localhost” by making a change to the HOSTS file. This means that each dev site (or domain) can then consider itself to have a root directory. In other words, you can run more than one web site on a single machine. NameVirtualHost allows the server admin to set up multiple domains/hostnames on a single Apache installation by using VirtualHost containers. Then I discovered the NameVirtualHost feature in Apache. ![]() ![]() This setup was functional but far from ideal, as the index pages for these local sites weren’t in what could be considered a root directory, which lead to some tip-toeing around when creating links. Once I had my local server running, I put each dev site into its own folder in \htdocs\ and navigated to them by foldername/. To test these new pages, I used ’s wonderful XAMPP (which I really can’t recommend highly enough) to install Apache, MySQL, and PHP (among other things). Some time ago, I decided to start phasing out static xhtml in favor of pages using PHP includes.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |