setting virtualhost on xampp - xampp

I'm using two xampp applications. First xampp has default setting such port apache on 80. Second xampp, i use for a project learning that apache on 9999. I wanna make an virtualhost on second xampp. I did set on
Hosts file
127.0.0.1 localhost
127.0.0.1 helloword.com
Httpd.conf
Listen 9999
Httpd-vhosts.conf
<Virtualhost *:9999>
DocumentRoot "C:/xampp/htdocs/project/public"
ServerName helloword.com
</Virtualhost>
It is where file index.html on public folder. But, when i browse http://helloword.com, it failed to view index. Index can browsed when i type http://localhost:9999/
Where should i change that setting?

Uncomment the below line in your httpd.conf.
Include conf/extra/httpd-vhosts.conf

Related

Create virtual host for Laravel using Xampp with the port 8003

I am trying to create a virtual host for my project using Xampp.
I added 127.0.0.1 project.com in the hosts file in C:\Windows\System32\drivers\etc
I changed the port 80 to 8003 in the httpd.conf file in C:\xampp\apache\conf (I changed everything from 80 to 8003 in this file)
I added this:
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/project/public"
ServerName project.com
</VirtualHost>
in the httpd-vhosts.conf in C:\xampp\apache\conf\extra
When I leave it with the 80 port in the files, it works good. But when I try to use the 8003 port does not work. I get the same message as when I stop Apache.
Edit1: I changed this:
<VirtualHost *:8003>
DocumentRoot "C:/xampp/htdocs/project/public"
ServerName project.com
</VirtualHost>
Now I can access to the ulr but just if I try with the url like this: project.com::8003
With the number port at the end of the url.
There is a way to use project.com without add the number port?
You need to check 4 things.
Are you sure you are listening to port 8003 in httpd.conf file.
Set ServerName domainName.com:8003 in httpd-vhosts.conf.
You also need to change: VirtualHost *:8003 in httpd-vhosts.conf.
<VirtualHost *:8003>
DocumentRoot "C:/xampp/htdocs/project/public"
ServerName project.com
</VirtualHost>
Now, you should be able to access with your URL: http://domainName.com:8003
last but not the least don't forget to restart xampp.
Hope this helps! :)

access to virtualhost from another pc xampp

may I ask question about the Apache Virtual Host config?
I use XAMPP, and my ipv4 is 192.168.1.7
I have configured my host file (C:\Windows\System32\drivers\etc...) like
127.0.0.1 g4.org
192.168.1.7 g4.org
and C:\xampp\apache\conf\extra\httpd-vhosts.conf like
NameVirtualHost 192.168.1.7:80
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/rs"
ServerName g4.org
ServerAlias www.g4.org
</VirtualHost>
The virtualhost works perfectly on the machine that has installed xampp .
but the problem is in the another machine(PC) [SAME LAN] if i go to http://192.168.1.7 the page load and work perfectly
but
if i go to this link http://g4.org the page won't load and say
ERR_CONNECTION_REFUSED
In the another machine, just put the "192.168.1.7 g4.org" at the host file.

Virtualhost setup on localhost displays indexof

I'm attempting to set up a virtual host on Windows vista32. I keep getting a listing of the root folder htdocs instead of the site I've setup.
Here's my virtual host entry in Apache httpd-vhosts.conf:
<VirtualHost *:80>
ServerName site-ashback.co.uk
ServerAlias www.site-ashback.co.uk
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/site-ashback.co.uk"
DirectoryIndex index.php
</VirtualHost>
Hosts file:
127.0.0.1 site-ashback.co.uk
None of the examples I've been using have shown a few entries which are present in my hosts file thus:
127.0.0.1 localhost
::1 localhost
These two lines appear after all the commented examples and I've put my entry after these. Does this suggest I should use'localhost' instead of 127.0.0.1?
When I click my site in the listing it takes me to the site properly but the address then reads: site-ashback.co.uk/site-ashback.co.uk/. All I wanted to do is remove the word 'localhost' from local sites addresses when testing so that the path read like the real domain name when we go live.

Virtual Hosts not working XAMPP 1.8.3

Im trying to set up a virtual host using my local xampp stack but after following many tutorials i simply can't work out where im going wrong.
Here is what i added to my httpd-vhost.conf file:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName localhost
DocumentRoot E:\Programs\xampp\htdocs
</VirtualHost>
<VirtualHost *:80>
DocumentRoot E:\Programs\xampp\htdocs\CVCMS
ServerName cvcms.dev
<Directory "E:\Programs\xampp\htdocs\CVCMS">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
And here is my hosts file
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
# ::1 localhost
127.0.0.1 lmlicenses.wip4.adobe.com
127.0.0.1 lm.licenses.adobe.com
127.0.0.1 cvcms.dev
I have restarted apache after every change, i have made sure http.conf is linked to the httpd-vhosts file.
The issue is when i type in the domain cvcms.dev it shows the xampp splash page instead of the index.php in my cvcms folder.
Any ideas why?
Thanks
please remember to add the quotes to your virtual host document root path. At the same time what you need to to do enable them is to find httpd.conf , in this version it should be in your etc folder within your XAMPP's root folder.
Look out for :
# Virtual hosts
#Include etc/extra/httpd-vhosts.conf
Since '#' is a comment prefix, you have to uncomment "#Include etc/extra/httpd-vhosts.conf"
See if this works. Remember to restart your XAMPP's apache server to read the new settings you've just set. Cheers !
You can read more on this here.

Apache 2.2 localhost VirtualHosts problems

I am trying to setup my dev machine with virtual hosts so I can access my development projects with a simple url, like http:// project.dev/ rather that a whole http:// 127.0.0.1/dev/path/to/root/of/project/ type of url.
Now, I'm aware there are many tutorials and questions already answered about this, but after trying many of them, I feel like I'm running in circles here.
The problem is simple: after setting up my hosts file and my virtual hosts, any attempt to access a virtual hosts irremediably displays the content of my server DocumentRoot.
my hosts file:
127.0.0.1 localhost
127.0.0.1 mydomain.dev
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
my httpd-vhosts.conf
NameVirtualHost *:80
<VirtualHost *:80>
ServerName localhost
DocumentRoot /Users/pilot/Sites/
</Virtualhost>
<VirtualHost *:80>
ServerName mydomain.dev
DocumentRoot /Users/pilot/Sites/devel/vytamin/dev/
</VirtualHost>
I precise that the httpd-vhosts.conf file IS loaded in my httpd.conf and I do get a warning if I point the virtual host document root to a wrong folder.
I made a try setting the localhost virtual host to the following, without any success.
<VirtualHost *:80>
ServerName localhost
DocumentRoot /Users/pilot/Sites/devel
</Virtualhost>
The following URLS all display the DocumentRoot of my server defined in my httpd.conf file, and seem to ignore the DocumentRoot defined in my VirtualHosts.
http:// 127.0.0.1/
http:// localhost/
http:// mydomain.dev/
I'm running Apache2.2 on Mac OSX 10.5 Leopard, but not the one shipped with mac os. I compiled my own under /usr/local/apache2 and web sharing IS disabled
I can't see anything wrong with my set up so I hope the community will!
Thanks for your help!
Ok, I found the problem!
The configuration above is perfectly fine, it was just that my apache was not restarting properly.
Neither apache_ctl graceful or apache_ctl restart was terminating all httpd processes I have running, therefore failing to reload properly the changes in my configuration files.
Once I killed the remaining processes and really restarted apache, it worked...
Solved, but I feel dumb to have found that!
Now I have a daemon situation to solve!

Resources