Search found 91 matches: vhost

Searched query: +vhost

Return to advanced search

Re: vhosts not working properly in Win 7 64b & 1.7.7

If your vhost code is wrong then you will always be served the first entry in the file.
NameVirtualHost *:80
<VirtualHost *:80>
ServerName local.bmg.com
DocumentRoot "d:/bmg/web/"
<Directory />
Options FollowSymLinks
AllowOverride None
Options None
Order allow,deny
Allow from all
Satisfy all
</Directory>
</VirtualHost>
Your Directory directive must be the same as your DocumentRoot directive and no backslash at the end of the path, for example.
Code: Select all
NameVirtualHost *:80
<VirtualHost *:80>
ServerName local.bmg.com
DocumentRoot "D:/bmg/web"
<Directory "D:/bmg/web">
Options FollowSymLinks
AllowOverride None
Options None
Order allow,deny
Allow from all
Satisfy all
</Directory>
</VirtualHost>
by Sharley
01. March 2012 02:33
 
Forum: XAMPP for Windows
Topic: vhosts not working properly in Win 7 64b & 1.7.7
Replies: 1
Views: 3721

Re: Wordpress .htaccess issue

You need to use full paths and tell Apache these vhosts are name based.

You have also duplicated your vhosts and omitted the localhost entry to act as a default.

Also worth a mention is that Apache and most things in XAMPP are case sensitive so try and use only lower case to save confusion and possible simple errors - lower case error and access log file names are the way to go.

Here is an example using an edited copy and paste of your vhost post:
Code: Select all
NameVirtualHost *:80

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

<VirtualHost *:80>
ServerName exoid.com
ServerAlias www.exoid.com
DocumentRoot "C:/xampp/htdocs/www/www.exoid.com"
AccessFileName "C:/xampp/htdocs/www/www.exoid.com/.htaccess"
ServerAdmin admin@exoid.com
ErrorLog "C:/xampp/htdocs/www/www.exoid.com/logs/errorlog.log"
CustomLog "C:/xampp/htdocs/www/www.exoid.com/logs/access.log" combined
</VirtualHost>
Save the file then restart Apache.
See if the above helps and you may copy and paste my edited code.

Notes:
Always check and double check spelling and file and folder case.

When using a fully qualified domain name then you will need to point your DNS to your XAMPP installation PC IP.

If you are just using this domain as a local copy of your hosted domain then you need to also enter the details in the C:\Window\drivers\etc\HOSTS file, for example, the first entries in the file should look similar to this
Code: Select all
127.0.0.1 localhost
127.0.0.1 exoid.com
127.0.0.1 www.exoid.com
That way you will be served your local version of your web site not your hosted version.

Good luck. :)
by Sharley
27. January 2012 22:18
 
Forum: XAMPP for Windows
Topic: Wordpress .htaccess issue
Replies: 3
Views: 5849

Re: rewriterule is working in conf but not in .htaccess

Hello Robert.

It is related to paths and the location of the .htaccess and configuration file of the vhost.

They are both in different locations and the vhost file that works is an absolute path starting with / so Apache knows to look in the web root (DocumentRoot) for directory foo.

The foo location path is relative to the .htaccess file which is already in the DocumentRoot so Apache looks for directory foo in the same directory as the .htaccess file is located.

Look up absolute and relative path meanings on the web for a more detailed explanation.

I hope this has helped a little.

Best wishes. :)
by Sharley
19. January 2012 16:50
 
Forum: Apache
Topic: rewriterule is working in conf but not in .htaccess
Replies: 1
Views: 3108

Re: Problem creating 2 vhosts

Try this by copy and paste and see if it works
Code: Select all
NameVirtualHost *:80

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

<VirtualHost *:80>
ServerName kambinator.myftp.biz
ServerAlias www.kambinator.myftp.biz
DocumentRoot "C:/xampp/htdocs/mysite"
ServerAdmin admin@kambinator.myftp.biz
ErrorLog "magazin.log"
CustomLog "magazin.log" combined
</VirtualHost>

<VirtualHost *:80>
ServerName magazin.myftp.biz
ServerAlias www.magazin.myftp.biz
DocumentRoot "C:/xampp/htdocs/prestashop"
ServerAdmin admin@kambinator.myftp.biz
ErrorLog "magazin.log"
CustomLog "magazin.log" combined
</VirtualHost>
No trailing slash in the DocumentRoot.
Save the file and restart Apache.

If Apache can't start read the C:\xampp\apache\logs\error.log file.

The first vhost will always be served by default unless the httpd-vhosts.conf file is in the correct format and all directives are included.

Make sure in your Windows hosts file (C:\Windows\system32\drivers\etc\HOSTS) you have the first line after the comments
Code: Select all
127.0.0.1 localhost


IMPORTANT SECURITY TIP:
Make sure in XAMPP 1.7.4 you have secured the C:\xampp\webdav folder if you intend to allow access from the Internet - the link in my signature will help.

Good luck. :)
by Sharley
05. January 2012 10:07
 
Forum: XAMPP for Windows
Topic: Problem creating 2 vhosts [SOLVED]
Replies: 3
Views: 7827

Re: Can't access sub-domains local or www

Big security hole:
puttsy wrote:Does the <locationmatch> look correct to be used to access these pages from outside my network?
This is a security measure for the folders listed, which are XAMPP system folders and should not be able to be accessed other than from localhost.
You should put it back to the default settings or you could open a big hole in your security - it has no effect on your other issues.

For access from other locations you should specify the IP address of who will have access instead of a blanket Allow from all
Code: Select all
# Close XAMPP sites here
<LocationMatch "^/(?i:(?:xampp|licenses|phpmyadmin|webalizer|server-status|server-info))">
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
    Allow from 192.168.0.0/16
    Allow from 123.123.123.123
    ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var
</LocationMatch>
You can add who you trust but not everyone on the Internet, big mistake.



Here is a httpd-vhosts.conf and HOSTS file based on the info you provided to try
Code: Select all
NameVirtualHost *:80

##----------localhost--------------------
<VirtualHost *:80>
ServerName localhost
##make sure the localhost index.php is in this folder
DocumentRoot "C:/xampp/htdocs"
</VirtualHost>

##----------wordpress--------------------
<VirtualHost *:80>
ServerName wordpress.mydomain.com
ServerAlias www.wordpress.mydomain.com
DocumentRoot "C:/xampp/htdocs/wordpress"
ServerAdmin me@mydomain.com
</VirtualHost>

##----------wiki-------------------------
<VirtualHost *:80>
ServerName wiki.mydomain.com
ServerAlias www.wiki.mydomain.com
DocumentRoot "C:/xampp/htdocs/wiki"
ServerAdmin me@mydomain.com
</VirtualHost>

##---------SMB.forum---------------------
<VirtualHost *:80>
ServerName forum.mydomain.com
ServerAlias www.forum.mydomain.com
##No trailing slash here
DocumentRoot "C:/xampp/htdocs/forum"
ServerAdmin me@mydomain.com
</VirtualHost>
Save the file and restarts Apache after adding each vhosts

Best method is not to add all the vhosts at once but to add one at a time testing each is working before adding another.

I prefer to add the Directory directive for each vhost then I can configure each vhost's Options etc. but at this stage the Directory directive in use will be that for htdocs in the httpd.conf file.
Code: Select all
127.0.0.1 localhost
127.0.0.1 wiki.mydomain.com
127.0.0.1 www.wiki.mydomain.com
127.0.0.1 forum.mydomain.com
127.0.0.1 www.forum.mydomain.com
127.0.0.1 phpbb.mydomain.com
127.0.0.1 www.phpbb.mydomain.com
127.0.0.1 wordpress.mydomain.com
127.0.0.1 www.wordpress.mydomain.com

See how that goes and if you still have problems follow the add one at a time suggestion.


Why don't you use the version 3 control panel found in the xampp installation folder:
xampp-control-3-beta.exe
Latest version download link in my signature, simply extract to the xampp installation folder and overwrite when asked then right click to run as administrator and to create a shortcut for easier access, to the desktop for example.

It is much improved over the 2.5 version with many great new features.

Good luck. :)
by Sharley
31. December 2011 08:42
 
Forum: XAMPP for Windows
Topic: Can't access sub-domains local or www
Replies: 4
Views: 11219

Re: Virtual Host issues on local network

Thanks for that. :)


Your vhost and hosts file settings will work for localhost and 127.0.0.1

You have to add to the other devices on your network a similar entry in their hosts file only this time you use the LAN IP address of the XAMPP PC
Code: Select all
nnn.nnn.nnn.nnn       roku
nnn = XAMPP PC IP.
by Sharley
29. December 2011 18:42
 
Forum: XAMPP for Windows
Topic: Virtual Host issues on local network
Replies: 7
Views: 6139

Re: Setting up sub-domains and directories

You have 2 domains (sub domains) so you would need to use virtual hosts so Apache knows which one to serve when a request from your browser is received.

Have a read through these forum search results and see if you can configure the \xampp\apache\conf\extra\httpd-vhosts.conf file.

There are some useful examples for you to work with.

You can paste in between forum code tags your attempt if you don't have any success so I can see perhaps what may need fixing.
by Sharley
24. December 2011 21:35
 
Forum: XAMPP for Windows
Topic: Setting up sub-domains and directories
Replies: 5
Views: 6469

Re: Virtual Hosts

Please do not post your actual domain names.
Thanks. :)


The vhost for your domain needs to have permissions set for a Directory (folder) or Apache will deny access - you are missing the <Directory> directive as your vhost is outside the htdocs (Apache server DocumentRoot) folder.

For example
Code: Select all
NameVirtualHost *:80

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

<VirtualHost *:80>
ServerName domain.co.uk
ServerAlias www.domain.co.uk
DocumentRoot "C:/domain.co.uk"
<Directory "C:/domain.co.uk" >
Options Indexes FollowSymLinks Includes ExecCGI
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Save the file and restart Apache.
If Apache can't start then check the C:\xampp\apache\logs\error.log file for clues.

Your domain is registered and the DNS is pointing to your XAMPP installation PC on your ISP network.
If you have connection problems:
1. Make sure that VirginMedia do not block port 80 for cable users.
2. Make sure the ports that XAMPP uses are open in your router and firewall.
3. Allow some time for DNS to propagate if you made recent changes at your domain name registrar.

Good luck. :)
by Sharley
14. December 2011 00:46
 
Forum: XAMPP for Windows
Topic: Virtual Hosts (XP) 1.7.7 [SOLVED]
Replies: 3
Views: 8995

Re: Server-Side Includes with .html files

There are a few things in your vhost that may need some attention as Apache and MySQL really don't like spaces in file or folder names.
Try and rename the Web Sites folder to lower case and remove the space - Apache is case sensitive so any slip ups will cause an error not to mention confusion for you, try and keep all things lower case.

Here is an amended container, that I have assumed you did not provide the full set and you should always have the default first container set to localhost
Code: Select all
NameVirtualHost *:80

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

<VirtualHost *:80>
ServerName xxx.test
DocumentRoot "C:/websites/XXX/www"
<Directory "C:/websites/XXX/www">
Options Indexes FollowSymLinks +Includes
AllowOverride All
AddHandler server-parsed .html .htm .shtml
AddType text/html .html .htm .shtml
AddOutputFilter INCLUDES .html .htm .shtml
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
I have just changed the extension order to see if that helps but if not then create a separate line for each extension for example:
AddHandler server-parsed .html
AddHandler server-parsed .htm
AddHandler server-parsed .shtml
etc.

You have added xxx.test to the Windows HOSTS file?

To see if there any issues with the vhost configuration file then in the xampp-control-3-beta.exe control panel found in the xampp folder click on the XAMPP-Shell button and type httpd.exe -S and if you don't understand the results then in the top right of the console window is a small icon that holds the Edit functions that you can use to mark and copy them to this topic.

There should be no reason that I can see for the SSI settings I posted not working except perhaps the order of the file extensions and to eliminate that possibility create that separate line for each file extension for all directives after testing the single lines with the changed order.

Good luck. :)
by Sharley
07. December 2011 15:18
 
Forum: XAMPP for Windows
Topic: Server-Side Includes with .html files (XPSP3) 1.7.7 [SOLVED]
Replies: 6
Views: 8732

Re: configuring development machine

You can have as many vhost containers as you need.

Good luck. :)
by Sharley
07. December 2011 14:49
 
Forum: XAMPP for Windows
Topic: configuring development machine
Replies: 5
Views: 4256

Re: configuring development machine

Do an advanced forum search for virtualhost or vhost in the XAMPP for Windows English forum as there are many useful working examples - you can use my name Sharley in the author field that may narrow the results for you.
Some search tips:
viewtopic.php?f=16&t=32670

A vhost will allow you to work on a web site that is not in the htdocs folder and indeed it cam be anywhere on your PC.
by Sharley
07. December 2011 13:09
 
Forum: XAMPP for Windows
Topic: configuring development machine
Replies: 5
Views: 4256

Re: Server-Side Includes with .html files

Where is the <Directory> or folder located (path) of the vhost with the SSI files?

Is it in the htdocs folder (the server DocumentRoot) or outside the htdocs folder?

The working index.shtml is a server wide configuration setting found in the httpd.conf file.

The settings in the vhost will override the httpd.conf file settings.

This may be required
Code: Select all
Options Indexes FollowSymLinks +Includes
AllowOverride All


You could try this
Code: Select all
AddHandler server-parsed .shtml .html .htm
AddType text/html .shtml .html .htm
AddOutputFilter INCLUDES .shtml .html .htm
Remember to save the httpd-vhost.conf file and then restart Apache after each edit, for testing.


Often to save confusion it is best to have all your html coded file extensions as .html not a mix of .html and .htm - just a preferred method I use where possible.
( I believe M$ introduced this confusion by using .htm extensions instead of what was an industry standard at the time .html extension and again I believe because of the old 8.3 file naming convention in DOS and earlier Windows ).

So if you can use just .html adjust the above code to suit.


Having all files parsed by the server can add extra load on the server especially if the server is a busy server and so introduce delays (lag) - you should consider this fact when developing.

This link may hold an interesting alternative to having all html files that do not contain SSI parsed by the server:
https://my.bluehost.com/cgi/help/257


If you encounter more problems then would you mind pasting your actual vhost container that you want SSI settings from your httpd-vhosts.conf file please so I can take a look at how your vhosts is constructed and provide a possible solution - you can obfuscate any sensitive info if you wish.

Good luck. :)
by Sharley
05. December 2011 22:54
 
Forum: XAMPP for Windows
Topic: Server-Side Includes with .html files (XPSP3) 1.7.7 [SOLVED]
Replies: 6
Views: 8732

Re: Subdomain/GoDaddy

I have just tested using localhost by adding both sub domain names to the Windows HOSTS file and both worked as expected when I edited the httpd-vhost.conf file like so
HOST file
Code: Select all
127.0.0.1 first.example.com
127.0.0.1 www.first.example.com
httpd-vhosts.conf file
Code: Select all
<VirtualHost *:80>
    ServerName first.example.com
    DocumentRoot "C:/xampp/htdocs/first"
    ServerAdmin webmaster@example.com
</VirtualHost>

<VirtualHost *:80>
    ServerName www.first.example.com
    DocumentRoot "C:/xampp/htdocs/first"
    ServerAdmin webmaster@example.com
</VirtualHost>
So it is possible that your Zone file is not correct if you are trying to connect through the Internet.

I also tested this httpd-vhosts.conf file
Code: Select all
<VirtualHost *:80>
    ServerName first.example.com
    ServerAlias *.first.example.com
    DocumentRoot "C:/xampp/htdocs/first"
    ServerAdmin webmaster@example.com
</VirtualHost>
also it worked on my PC using the same HOSTS file entries as the first test.

You can't use the HOSTS file if you are trying to access from the Internet (but is a good way to test your vhosts configurations), that is governed by the domain name zone file - sometimes editing this file can take some time to work it's way through the Internet DNS caches (propagation).

Best wishes. :)
by Sharley
05. December 2011 07:34
 
Forum: XAMPP for Windows
Topic: Subdomain/GoDaddy
Replies: 8
Views: 12215

Re: Subdomain/GoDaddy

Now assuming that your domain and sub domains at GoDaddy all correctly point to the IP address of your XAMPP server then using the following slightly edited vhost config may help.

www is also classed as a sub domain in the zone file but not sure if you can use a http://www.sub.domain.com in the vhosts file but this you can experiment with.
Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
    ServerName example.com
    ServerAlias www.example.com
    DocumentRoot "C:/xampp/htdocs"
    ServerAdmin webmaster@example.com
</VirtualHost>

<VirtualHost *:80>
    ServerName first.example.com
    ServerAlias www.first.example.com
    DocumentRoot "C:/xampp/htdocs/first"
    ServerAdmin webmaster@example.com
</VirtualHost>

<VirtualHost *:80>
    ServerName second.example.com
    ServerAlias www.second.example.com
    DocumentRoot "C:/xampp/htdocs/second"
    ServerAdmin webmaster@example.com
</VirtualHost>
Without the NameVirtualHost line Apache thinks that your vhosts are IP based and so a warning for the overlap.

Don't forget to Save and restart Apache and if Apache can't start check the \xampp\apache\logs\error.log file for clues.

BTW, when using a VirtualHost your web sites don't have to be in the htdocs folder, they can be located anywhere on your PC.

Please let me know how this all pans out and if the Google search results helped with GoDaddy's zone file settings.

Best wishes. :)
by Sharley
03. December 2011 10:08
 
Forum: XAMPP for Windows
Topic: Subdomain/GoDaddy
Replies: 8
Views: 12215

Re: Subdomain/GoDaddy

See if these search results from Google help with the zone file edits at GoDaddy.


Before we start I first need to know what you see when you type http://localhost in your browser?

Do you have all your web site files for example.com in the htdocs folder?

Did you delete or rename the default XAMPP index.html and index.php that was already in the htdocs folder?


You're seeing only the first vhost which is the default vhost in your current settings.

Open a command prompt in the \xampp\apache\bin folder and type
Code: Select all
apache.exe -S
and paste the result here please - you can use the edit menu found by clicking on the small icon top left of the console window.

I will make a few suggestions when you have provided the above requested information.
Thanks.
by Sharley
03. December 2011 09:23
 
Forum: XAMPP for Windows
Topic: Subdomain/GoDaddy
Replies: 8
Views: 12215
Next

Return to advanced search