Search found 100 matches: vhost

Searched query: +vhost

Return to advanced search

Re: 1.7.3 + Tomcat Apache Virtual Host NOT completely working

Not sure if there is yet a Tomcat addon for XAMPP 1.7.3 as the one referred to on the XAMPP For Windows home page is for XAMPP 1.7.2 - usually the Tomcat addon release follows later than the XAMPP version release, so if you are having Tomcat issues then perhaps you may need to wait for the latest version release.
Tomcat Readme file wrote:Add-on Tomcat 6.0.20 (for Apache 2.2.11 >= XAMPP 1.7.2-dev3.1 )



First, return your httpd.conf file back to the default installation file of XAMPP.

Make sure that your other instance of Apache is never run at the same time as XAMPP.

Your Tomcat configuration is taken care of in the C:\xampp\tomcat\conf\auto\mod_jk.conf folder so the entry in your httpd-vhost.conf file is not required and BTW the paths specified for Tomcat is relative to the C:\xampp\tomcat\webapps folder as defined in the C:\xampp\tomcat\conf\server.xml file
server.xml wrote: <!-- Define the default virtual host
Note: XML Schema validation will not work with Xerces 2.2.
-->
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
You also have some other problems with your vhosts and when there are errors the default vhost - localhost in your vhosts file - is always returned.

So having said all that and assuming you have put back XAMPP to it's default installation state then perhaps your vhosts file may look something like this:
Code: Select all
NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#

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


<VirtualHost *:80>
    DocumentRoot "C:/temp/5"
    ServerName dummy-host.localhost
<Directory "C:/temp/5">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>   
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:/temp/8"
    ServerName dummy-host2.localhost
<Directory "C:/temp/8">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>   
</VirtualHost>
Your C:\Windows\system32\drivers\etc\host file should have these entries immediately after the normal localhost entries
Code: Select all
127.0.0.1 dummy-host.localhost
127.0.0.1 dummy-host2.localhost
After returning your httpd.conf file to it's installation defaults and after making the above edits, save the files and restart the XAMPP Apache server and try again to access via your web browser but first clear your browser's cache.
by Izzy
13. January 2010 01:37
 
Forum: XAMPP for Windows
Topic: 1.7.3 + Tomcat Apache Virtual Host NOT completely working
Replies: 7
Views: 11804

Re: Virtual Hosts: Keeps going to XAMPP home page

If there is anything wrong with your vhosts configuration then Apache will resolve to the first good vhost, the default localhost in your case.

Try this and see if it helps, it is important to use the first line I have included in my example.
Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
ServerName localhost
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
ServerAdmin webmaster@localhost
</VirtualHost>

<VirtualHost *:80>
ServerName projectname
DocumentRoot "/sites/projectname"
ServerAdmin webmaster@localhost
<Directory "/sites/projectname">
Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
I am assuming your directory paths are spelled correctly and that they do exist.
Don't forget to add to this to your etc/hosts file"
Code: Select all
127.0.0.1 projectname
by Izzy
20. December 2009 01:57
 
Forum: XAMPP for Mac OS X
Topic: Virtual Hosts: Keeps going to XAMPP home page
Replies: 2
Views: 4634

Re: Adding several domains tosame host with different root vhost

Tim, yours is a different problem.

Tim Dawson wrote:...but 'http://hmicom' gives the 403 error (Access Denied).
This is because you have not given access permissions for the directory D:\websites\hmicom which, because it is outside the htdocs tree, has no access rights as per the httpd.conf file, for obvious security reasons.
Code: Select all
NameVirtualHost *:80

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

<VirtualHost *:80>
    ServerName hmicom
    ServerAlias www.hmicom
    DocumentRoot "D:/websites/hmicom"
<Directory "D:/websites/hmicom" >
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
</VirtualHost>
Your Windows hosts file looks OK.
by Izzy
26. October 2009 03:45
 
Forum: XAMPP for Windows
Topic: Adding several domains tosame host with different root vhost
Replies: 6
Views: 4491

Re: Lost localhost

Try the following by copy and paste into the apache\conf\extra\httpd-vhosts.conf file.
Code: Select all
NameVirtualHost *:80

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

<VirtualHost *:80>
ServerName hmecsc
DocumentRoot "C:/servers/hmecsc"
<Directory "C:/servers/hmecsc" >
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ServerAdmin webmaster@hmecsc
CustomLog logs/hmecsc_access.log combined
ErrorLog logs/hmecsc_error.log
</VirtualHost>
Save the file and then restart Apache.

samsmom wrote:Anytime I put localhost in first, I couldn't get Apache to restart.
When ever Apache can't start check out the error.log file for clues.

If there is a mistake in the vhosts file then Apache will resolve to the first good entry and is more than likely why you lost the localhost as it had errors and try using forward slashes first which is the server's default...

...but if you have issues with Vista some have found that using back slashes helped.

Localhost needs only limited entries as it is mainly covered in the httpd.conf file and so there is no need to duplicate the entries.

Logs for localhost are the access.log and the error.log files in the apache\logs folder so no need to duplicate and have too many log files to look through.

The other logs for vhosts are now defined better but you may change those if you prefer a shorter title and they don't need a full path unless they were placed elsewhere on your PC.

Your hosts file looks OK.

If the above code section works then you should be able to add your next vhost cdtc by using the hmecsc as a template.

Good luck.
by Izzy
25. October 2009 06:21
 
Forum: XAMPP for Windows
Topic: Lost localhost
Replies: 3
Views: 2940

Re: cannot access own pages because of xampp security

wallyboz wrote:Now, I host 3 sites for foundations and all reside in subfolders of htdocs and for all 3 I added VirtualHosts in the httpd.conf. The environment is exactly the same as I had on my v1.6.6a xampp.
However, xampp security doesn't allow me to access either of the pages.
The XAMPP security you set up should only relate to a .htaccess file in the \xampp\htdocs\xampp folder - so check that you don't have a .htaccess file in the \xampp\htdocs folder or in the foundation's sub-folders.

It is possible to use the httpd.conf file for vhosts, but in the \xampp\apache\conf\extra folder there is a httpd-vhosts.conf file specifically for this purpose, which I recommend you use instead of the httpd.conf file.

Do an Advanced forum search in the XAMPP for Windows forum for keyword virtualhost or vhosts for some helpful and useful examples in the results.


Please paste here the vhosts configurations.

Did you add the foundations to the Windows hosts file in the form 127.0.0.1 foundation1 etc.?

How are you calling the foundations in your browser?
http://foundation1 for example or http://localhost/foundation1 perhaps?

What does the apache error.log tell you? \xampp\apache\logs\error.log

Can you please paste the relevant error message that applies to your attempt at connecting to a foundation vhost using your browser?
by Izzy
23. October 2009 00:58
 
Forum: XAMPP for Windows
Topic: cannot access own pages because of xampp security
Replies: 9
Views: 8386

Re: Adding several domains tosame host with different root vhost

Znote wrote:...When I try this, I will get redirected to the folder named znote in htdocs. Even if I am using the skarheimdata-dyndns.org IP!
Stefan, in the httpd-vhosts file in the extra folder replace your entries with these and see how they work.
Code: Select all
NameVirtualHost *:80

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

<VirtualHost *:80>
ServerName z-note.net
DocumentRoot "C:/xampplite/htdocs/znote"
</VirtualHost>

<VirtualHost *:80>
ServerName skarheimdata.dyndns.org
DocumentRoot "C:/xampplite/htdocs/opensim"
</VirtualHost>
Save the file and restart Apache.

Test again.

If your vhost file has errors then it will usually load the first vhost which is the default host.

BTW Stefan, an Advanced search of this XAMPP for Windows forum looking for virtualhost or vhost will give far better results that any Google can dish up.

Good luck.
by Izzy
21. October 2009 03:05
 
Forum: XAMPP for Windows
Topic: Adding several domains tosame host with different root vhost
Replies: 6
Views: 4491

Re: How do I add a new site under Htdocs?

Apart from changing all the links in your web site, which is often nigh impossible, then perhaps your best solution would be to use a VirtualHost in the xampp\apache\conf\extra\httpd-vhosts.conf file - this method has a huge amount of flexibility and would do what you want quit easily.

This method would also allow you to use http://mysite instead of http://localhost/mysite and still be able to access XAMPP at either http://localhost or http://localhost/xampp - if you prefer, you can even place your mysite folder anywhere on your PC rather than under the htdocs folder by using this VirtualHost method.

Do an Advanced forum search and select the XAMPP for Windows forum then search for Key word vhost or virtualhost
(you may use my name Izzy in the Author box if you wish to narrow the huge amount of posts on this subject)
Select All available in the characters of posts box to see all the posts not just an abbreviated post.

After you give that a go and perhaps get stuck, then by all means post back with a copy and paste of your code in the httpd-vhosts.conf file so it can be checked out.

Good Luck.
by Izzy
27. September 2009 08:20
 
Forum: XAMPP for Windows
Topic: How do I add a new site under Htdocs?
Replies: 5
Views: 5389

Re: Server Side Include not working in XAMPP 1.7.2!

You could also try an Advanced forum search in the XAMPP for Windows forum for virtualhost or vhost as there are many posts with some very useful examples that relate to an XAMPP for Windows installation.

Good to see that you eventually had your SSI up and running, defining the correct paths can sometimes be a real headache.

Good luck and post back in a new topic after you have had a go at the VirtualHost configuration in the C:\xampp\apache\conf\extra\httpd-vhosts.conf file if you get to a log jam situation.
by Izzy
10. September 2009 00:00
 
Forum: XAMPP for Windows
Topic: Server Side Include not working in XAMPP 1.7.2!
Replies: 11
Views: 20628

Re: Virtual Hosts For some reason wont work

Try DocumentRoot "H:/apache2/imyourhandyman" with the quotes.

Same applies for this directive DocumentRoot H:/apache2/rantspace

As a rule of thumb the folder in the DocumentRoot directive must be identical to the folder in the <Directory> directive.

If there is an issue with your vhosts then usually you will only have loaded the first good vhost.

Run the command apache -S in a command prompt in the \xampp\apache\bin folder (cd to this folder) and see if you can spot the errors, if not paste the whole apache -S result here.

If you have name based and IP based mixed vhosts then I usually put the IP based first followed by the name based - but usually there is only the need to use name based unless you specifically can't do any other than use IP based vhosts.
by Izzy
31. August 2009 05:31
 
Forum: XAMPP for Windows
Topic: Virtual Hosts For some reason wont work
Replies: 19
Views: 11164

Re: Help -- Changing Xampp DocumentRoot (to accomodate SVN)

FeralReason wrote:Do I need to do something beyond changing the DocumentRoot line in the httpd.conf...
Glenn, the <Directory "C:/xampp/htdocs"> Directive must be set to the same as your DocumentRoot - this is the reason for the access denied error message as all directories, except those Aliased or Virtual Hosted, outside the DocumentRoot have access denied for obvious security reasons.

This sameness is explained in the comments of the httpd.conf file...
Code: Select all
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "C:/xampp/htdocs">
...and for future reference, these and all comments are well worth reading before making any changes in the httpd.conf file.

Also be aware that changing things in any conf or ini file requires first a backup copy be made then, in case you are not able to start the component after editing, you can revert to the backup copy to get you on the road again.


BTW it is not always a good idea to alter the default "out of the box" Apache settings as there are usually alternate methods to achieve your goals.


For Example:
You can use the Alias directive for your SVN files and edit the C:\xampp\apache\conf\extra\httpd-xampp.conf file where you will see some configurations already included and working.

This Alias method may work for your SVN after first returning your httpd.conf file back to the defaults before you edited it - don't try this first without making a backup of both .conf files as mentioned above.

The Alias directive is explained here:
http://httpd.apache.org/docs/2.2/mod/mo ... html#alias


You can add your svn Alias after the webalizer Alias so both entries would look like this after editing:
(and remember to save the file and restart Apache after editing)
Code: Select all
Alias /webalizer "C:/xampp/webalizer/"
<Directory "C:/xampp4/webalizer">
<IfModule php5_module>
<Files "webalizer.php">
php_admin_flag safe_mode off
</Files>
</IfModule>
AllowOverride AuthConfig
</Directory>

Alias /svn "C:/xampp/fp/httpdocs/"
# if this is where you want to put your SVN files
# my choice would be "C:/xampp/svn/" perhaps
<Directory "C:/xampp/fp/httpdocs">
# or <Directory "C:/xampp/svn"> if you changed it
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# <Directory> entries are the same as for the DocumentRoot in the httpd.conf file
# You can add or change them to suit your SVN file's needs, but there should be no need
</IfModule>
For a list of all Directives and what they mean and what they do can be found here:
http://httpd.apache.org/docs/2.2/mod/directives.html

For a list of the Options directive go here:
http://httpd.apache.org/docs/2.2/mod/core.html#options

This URI should now work and access your files in the above C:\xampp\fp\httpdocs\ folder or in the C:\xampp\svn\ folder if you changed it in the Alias settings.
http://localhost/svn
(BTW is this the correct spelling of the folder you intended as usually htdocs refers to the DocumentRoot folder).

Words after the hash # character are my comments and may be removed if you use the above example in your own httpd-xampp.conf file.

This Alias or VirtualHost method will still allow you to access all the default XAMPP web pages as was intended by the XAMPP developers at the URI of http://localhost/


As an alternative to the Alias directive you could use a VirtualHost directive and for some good examples and lots of info do an Advanced forum search in this XAMPP for Windows English forum for keyword virtualhost or vhost and all the vhost configurations can be found in the C:\xampp\apache\conf\extra\httpd-vhosts.conf file.

Glenn, kindly let us know how you get on please.

Good luck with it.
by Izzy
29. August 2009 23:48
 
Forum: XAMPP for Windows
Topic: Help -- Changing Xampp DocumentRoot (to accomodate SVN)
Replies: 4
Views: 8171

Re: Virtual Hosts For some reason wont work

Try this as there seems to be mixed forward and back slashes.
Code: Select all
NameVirtualHost *:80

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

<VirtualHost *:80>
ServerName development.abba.laptop
ServerAlias laptop.abba
DocumentRoot "C:/web/projects/abba/web"
<Directory "C:/web/projects/abba/web">
Options Indexes +FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
##ServerAdmin postmaster@dummy-host.localhost
CustomLog "C:/web/logs/abba/access.log" combined
ErrorLog "C:/web/logs/abba/error.log"
LogLevel debug
</VirtualHost>
Save the file after editing and then restart Apache.

Change the path in the localhost vhost to reflect your own installation path of XAMPP

If on Vista, sometimes forward slashes / have been known to play up so change them all to back slashes \.

The DocumentRoot and the <Directory> directives should both be exactly the same as should the NameVirtualHost and the <VirtualHost> directives.

URIs covered above are:
http://localhost
http://development.abba.laptop
http://laptop.abba

Make sure you add these to your C:\Windows\system32\drivers\etc\Hosts file and the first uncommented entries should look like this:
Code: Select all
127.0.0.1 localhost
127.0.0.1 development.abba.laptop
127.0.0.1 laptop.abba
Save the file after editing.


Here's a link to all the Apache Directives:
http://httpd.apache.org/docs/2.2/mod/directives.html
by Izzy
24. August 2009 19:12
 
Forum: XAMPP for Windows
Topic: Virtual Hosts For some reason wont work
Replies: 19
Views: 11164

Re: Virtual Hosts For some reason wont work

Was the coded section a copy and paste from the vhost file?

If so then this line has a typo

DocumentRoot "C:web\projects\abba\web"

Should be

DocumentRoot "C:\web\projects\abba\web"
by Izzy
24. August 2009 09:08
 
Forum: XAMPP for Windows
Topic: Virtual Hosts For some reason wont work
Replies: 19
Views: 11164

Re: Virtual Hosts For some reason wont work

My reply was only an example so you can use my example to create your own Hosts file as you seem to have changed your vhosts file without following my post re ServerAlias.

Did you go to the document links I gave to help you with your issue?

Did you read the comments in the vhost file re verifying your configuration?

You can also do an advanced forum search for virtualhost as this subject has been covered in depth many times in the past.
by Izzy
24. August 2009 05:40
 
Forum: XAMPP for Windows
Topic: Virtual Hosts For some reason wont work
Replies: 19
Views: 11164

Re: Virtual Hosts on Apache

First remove the virtualhost entries from the httpd.conf file then save the file and try and restart Apache to make sure the httpd.conf file is syntactically correct.

Next use \xampp\apache\conf\extra\httpd-vhost.conf file to add your entries for example:
Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
    ServerName   localhost
    DocumentRoot "E:/app/SymLink_DoNotDelete"
</VirtualHost>

<VirtualHost *:80>
    ServerName   overheard
    DocumentRoot "E:/app/SymLink_DoNotDelete/overheard/public"
</VirtualHost>
Save the file after editing.

Next open \Windows\system32\drivers\etc\hosts file by dragging it into your text editor (in Vista right click on the text editor and select to run as administrator then Open the above file).

make sure your have these 2 entries first and if not then add them:
Code: Select all
127.0.0.1 localhost
127.0.0.1 overheard
Save the file and now restart Apache and see if that works for you.

BTW always a good idea to keep clearing your browser's cache when working at localhost level or you may be served a cached page instead of a newly edited page.
by Izzy
17. August 2009 22:17
 
Forum: XAMPP for Windows
Topic: Virtual Hosts on Apache
Replies: 4
Views: 2147

Re: New Application Directory

Tom McIntyre wrote:What confused me and still confuses me is that none of the other applications distributed with xampp are located there.
Everything in XAMPP is usually tied to either a configuration *.conf file or an initialization *.ini file which would require you to investigate the XAMPP configuration file locations and read the contents, as you seem to have done with the httpd.conf file but reading and understanding the file's contents are 2 distinct differences.

PhpMyAdmin's location is Aliased in \xampp\apache\conf\extra\httpd-xampp.conf file as is the Security folder, Webalizer Stats etc. and the Apache documentation will explain the Alias directive as well as the multitude of other directives found in the configuration files.

Your forum folder for vBulletin location \xampp\forum\ if called from a URI in your browser http://localhost/forum/index.php will also be denied access because in the httpd.conf file this section will cause it to fail:
Code: Select all
#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features. 
#
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>
So how are you calling the forum's index file in your browser?

Anything that goes through your installed and running web server requires a URI in your browser to access the files and folders.

The applications in /xampp/htdocs/xampp/ are covered because they are in the DocumentRoot tree as would be your /xampp/htdocs/Hamilton folder.

...I would have thought it all some kind of background magic except I cannot see how the vBulletin application that I just installed today would be working correctly. I presume it must have registered itself somehow.
Not possible unless you ran an installer script that had permissions to change (edit) or created an Alias in the httpd.conf file or create a vhost entry in \xampp\apache\conf\extra\httpd-vhosts.conf file etc. - which again I believe would be impossible if installing via a web browser through the server, as most forums, blogs and CMS etc. do.


So in summing up, you can place your files in folders anywhere you like on your PC as long as the server knows where they are and what to do with them via directives in the server's configuration files, as mentioned previously the Apache documentation has all you need to achieve this aim along with the many examples contained in the many configuration files in XAMPP.
by Izzy
13. August 2009 06:54
 
Forum: XAMPP for Windows
Topic: New Application Directory
Replies: 4
Views: 2716
Next

Return to advanced search