VIRTUALHOST

Problems with the Windows version of XAMPP, questions, comments, and anything related.

VIRTUALHOST

Postby reejem » 16. April 2006 12:17

I'VE FOLLOWED THE GUIDE CREATED BY MR. WorldDrknss STEP BY STEP IN CREATING A VIRTUALHOST IN 1.5.1

11. Now create a new directory in C:\ called www
12. Now create another directory in C:\www called anything you want.
13. Now Navigate to C:\xampp\xampp\apache\conf
14. Open httpd.conf in your favorite text editor
15. Scroll down to the very bottom and delete everything starting at #NameVirtualHost *:80
In other words your going to delete the following:

#NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>

16. Now replace what you have just deleted with:

NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot C:/xampp/xampp/htdocs
ServerName localhost
</VirtualHost>

17. Now remember when I had you create your C:\www and another directory in C:\www now lets say that you made the directory called main so now main is in C:\www\ this is the directory where your going to have your web files in.
18. Now go back to httpd.conf and add the following after the one we just created above

<VirtualHost *:80>
DocumentRoot C:/www/main
ServerName localhost.main.com
</VirtualHost>

Notice that // or reversed from \\, this is a must for apache to work.
19. Now navigate to C:\WINDOWS\System32\Drivers\etc\
20. Open the file called Host or Hosts
21. you should see where is says 127.0.0.1 localhost now what you want to do is add the following:
127.0.0.1 localhost.main.com this will allow you to access your web files that are in C:\www\main.
22. You can add as many sites as you want just keep adding directories in C:\www and creating a VirtualHost as describe above pointing to the correct directory and giving it a name, then edit you Hosts file to allow you to access the web content in the folder.
23. If your going to go live then you don't need to edit the hosts file, but you will need some type of domain name to use so apache nows where to receive the right web contents.

24. That is the basic to get apache running and for you to begin creating website.



TOGETHER WITH THIS:


Open httpd.conf file scroll down intill you see DocumentRoot "C:/xampp/xampp/htdocs"
below that you will see
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
you will need to change Deny to Allow so it looks like:
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>

save and exit.
then open httpd-vhosts.conf in path/apache/conf/extra
and create something similar bellow.


HOWEVER, I'VE FOUND OUT THAT WHEN I GET DISCONNECTED FROM THE NET A PROBLEM OCCUR..."SERVER CANNOT BE FOUND"... IS THERE ANYTHING WRONG??? I CAN'T AFFORD TO ALWAYS BE ONLINE... I'M JUST A POOR DIAL-UP PREPAID SUBSCRIBER... IM SO SORRY I'M A PURE BGINNER WHO WOULD JUST WANT TO LEARN THE BASICS OF PHP DEV. THANK YOU...
reejem
 
Posts: 5
Joined: 13. April 2006 11:45

Is this a joke?

Postby lau_cph » 24. April 2006 00:21

Nothing personal, but maybe this server package is too easy?

I mean... if you disconnect from the internet, then it wouldn't quite be possible to connect to the server, as the server "serves web-content through the Internet!".

If you need a continues running website, then you might like to look at a free or low priced webhotel.

search google!
Thomas
lau_cph
 
Posts: 4
Joined: 23. April 2006 21:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 44 guests