Ok, per pix0r's, Sparks' and Dave's answers it looks like there are three ways to do this:
- Open C:xamppapacheconfextrahttpd-vhosts.conf.
- Un-comment ~line 19 (
NameVirtualHost *:80
).
Add your virtual host (~line 36):
<VirtualHost *:80>
DocumentRoot C:ProjectsransitCalculatorrunk
ServerName transitcalculator.localhost
<Directory C:ProjectsransitCalculatorrunk>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Open your hosts file (C:WindowsSystem32driversetchosts).
Add
127.0.0.1 transitcalculator.localhost #transitCalculator
to the end of the file (before the Spybot - Search & Destroy stuff if you have that installed).
- Save (You might have to save it to the desktop, change the permissions on the old hosts file (right click > properties), and copy the new one into the directory over the old one (or rename the old one) if you are using Vista and have trouble).
- Restart Apache.
Now you can access that directory by browsing to http://transitcalculator.localhost/.
Starting ~line 200 of your http.conf
file, copy everything between <Directory "C:/xampp/htdocs">
and </Directory>
(~line 232) and paste it immediately below with C:/xampp/htdocs
replaced with your desired directory (in this case C:/Projects
) to give your server the correct permissions for the new directory.
Find the <IfModule alias_module></IfModule>
section (~line 300) and add
Alias /transitCalculator "C:/Projects/transitCalculator/trunk"
(or whatever is relevant to your desires) below the Alias
comment block, inside the module tags.
Edit ~line 176 in C:xamppapacheconfhttpd.conf; change DocumentRoot "C:/xampp/htdocs"
to #DocumentRoot "C:/Projects"
(or whatever you want).
Edit ~line 203 to match your new location (in this case C:/Projects
).
Notes:
- You have to use forward slashes "/" instead of back slashes "".
- Don't include the trailing "/" at the end.
- restart your server.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…