Page 1 of 1

Setting up VHOST

PostPosted: 13. June 2011 20:38
by squills
hello, Iam trying to set up vhost so i can access all 3 of my sites using fake address names
www.fakecomicbt.com
www.fakeftn.com
www.fakecarsite.com


when i use this current setup no matter what address i put in it always takes me to the www.fakecarsite.com files
here is my vhost
http://www.pastie.org/2062447

and my windows host file...
http://www.pastie.org/2062528


thats all i have changed, Also when i edited the vhost file, apache wont start or at least says its not starting. but when i put in any of the address it still takes me to the carsite files.
Any help would be great !
thanks
squills

Re: Setting up VHOST

PostPosted: 13. June 2011 20:54
by Altrea
Please take a look into your \xampp\apache\logs\error.log file.
Everytime Apache can't start there should be further information about that.

Re: Setting up VHOST

PostPosted: 13. June 2011 21:22
by squills
yes you would think, but it stays empty, i think it may be running but the green bar that says running is not working? cause nothing comes up in the error log or the access log also i have to run the xampp control panel in admin mode or else it gives me a error

Code: Select all
XAMPP Control Panel Version 2.5 (9. May, 2007)
Windows 6.1 Build 7600 Platform 2
Curreent Directory: C:\xampp
Install(er) Directory: C:\xampp
ERROR: Status Check Failure [1635760]
This program must be run from your XAMPP root directory


and when i try to start it i get I got error -1.

but when running in admin mode that error (error -1) goes away but the top error is still there..


OK EDIT, not sure if it was bugged or what, but the apache is now running :D now back to vhost?
anyone

Re: Setting up VHOST

PostPosted: 13. June 2011 22:58
by Altrea
squills wrote:but when running in admin mode that error (error -1) goes away but the top error is still there..

Thats a common error of the XAMPP control panel. It's buggy in the v1.7.4 Installer version.
I recommend you to use the recoded XAMPP control panel v3.0.2 instead.

Re: Setting up VHOST

PostPosted: 13. June 2011 23:06
by squills
thanks ill look into that , if i can get these vhost to work.. "P

Do i have to assign the folders any other way? btw if i type in localhost in address bar it still takes me back to the xampp screens
if that helps any..

Re: Setting up VHOST

PostPosted: 14. June 2011 04:01
by Sharley
squills wrote:...if i can get these vhost to work
Make sure that Apache has started, green running in the XAMPP Control Panel.

Then try this by overwriting your current files using copy and paste, if you prefer, to their respective files - check first I have not made any typos. ;)

Hosts file
Code: Select all
127.0.0.1      localhost
# ::1              localhost
127.0.0.1      fakecarsite.com
127.0.0.1      fakeftn.com
127.0.0.1      fakecomicbt.com


httpd-vhosts.conf file
Code: Select all
NameVirtualHost *:80

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

<VirtualHost *:80>
ServerName fakecarsite.com
ServerAlias www.fakecarsite.com *.fakecarsite.com
DocumentRoot "C:/xampp/htdocs/fakecarsite"
<Directory "C:/xampp/htdocs/fakecarsite" >
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ServerAdmin serveradmin@fakecarsite.com
CustomLog "logs/fakecarsite.com-access.log" common
ErrorLog "logs/fakecarsite.com-error.log"
LogLevel error
</VirtualHost>

<VirtualHost *:80>
ServerName fakeftn.com
ServerAlias www.fakeftn.com *.fakeftn.com
DocumentRoot "C:/xampp/htdocs/flipthenet"
<Directory "C:/xampp/htdocs/flpthenet" >
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ServerAdmin serveradmin@flipthenet.com
CustomLog "logs/flipthenet.com-access.log" common
ErrorLog "logs/flipthenet.com-error.log"
LogLevel error
</VirtualHost>

<VirtualHost *:80>
ServerName fakecomicbt.com
ServerAlias www.fakecomicbt.com *.fakecomicbt.com
DocumentRoot "C:/xampp/htdocs/comicbt"
<Directory "C:/xampp/htdocs/comicbt" >
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ServerAdmin serveradmin@comicbt.com
CustomLog "logs/comicbt.com-access.log" common
ErrorLog "logs/comicbt.com-error.log"
LogLevel error
</VirtualHost>
Save the file and restart Apache (a must do) to have the conf file read by the server - clear your browser's cache to avoid any cached files being presented by your browser and when working (developing) at localhost level do this often and in particular if and when you get an unexpected page presented.

Good luck.

Re: Setting up VHOST

PostPosted: 14. June 2011 13:03
by squills
THanks a ton.. noidea what you did different them me though?

but thanks it worked like a charm!