wamp server put online for anyone to access - apache

Hi ive been attempting to set up a wamp server so people can access it for testing
everything works correctly on my pc and i believe i have everything set up correctly but noone can connect to the site as it cant be reached
i have opened port 80 on my router and my firewall
my hosts file is as follows
127.0.0.1 localhost
::1 localhost
127.0.0.1 bandicam.com
127.0.0.1 ssl.bandisoft.com
127.0.0.1 btcGame.local
::1 btcGame.local
my httpd-vhosts.conf is as follows
#
# Virtual Hosts
#
<VirtualHost *:80>
DocumentRoot "g:/wamp/www"
ServerName localhost
ServerAlias localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
<Directory "G:/wamp/www">
AllowOverride All
Options Indexes FollowSymLinks
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName btcGame.local
ServerAlias www.btcGame.local
DocumentRoot "c:/wamp64/www/btcgame"
ErrorLog "logs/btcGame-error.log"
CustomLog "logs/btcGame-access.log" common
<Directory "/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
is there any other things i need to change in order to get my website online?

Other people trying to access your computer should know where to look.
Your server should then be referenced in the hosts file of their machine, except that IP should be resolvable such as
your.local.ip btcGame.local

Related

How can I get virtual host to work with XAMPP?

I just reinstalled XAMPP on my Win 7 machine yesterday. I am working on a Laravel project. I installed the current version of Laravel and then I went to set up the virtual host on the local machine. When I go to the url I set up (jrd_dnd_tools.localhost) I get a Bad Gateway message If I go to localhost I get the site the url is supposed to go to. I've set up virtual hosts before but no idea why this is happening. I'm sure I am missing something stupid but can't figure out what.
httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin webmaster#jrd_dnd_tools.localhost
DocumentRoot "C:\Users\Joey\Web\jrd_dnd_tools/public"
ServerName jrd_dnd_tools.localhost
ServerAlias www.jrd_dnd_tools.localhost
ErrorLog "logs/jrd_dnd_tools.localhost.log"
CustomLog "logs/jrd_dnd_tools.localhost.log" common
<Directory "C:\Users\Joey\Web\jrd_dnd_tools/public">
AllowOverride All
Order Allow,Deny
Allow from all
## --New way of doing it
Require all granted
</Directory>
</VirtualHost>
.hosts
127.0.0.1 localhost
::1 localhost
::1 database.localhost
127.0.0.1 jrd_dnd_tools.localhost
What you have mistaken is *:80, for virtual hosts never use wildcards. Instead you can do jrd_dnd_tools.localhost. Here below is my virtual host setup, I did for demo.
And also notice directory separators I have in Document Root and directory.
Make these 2 changes and your virtual host will work like a charm.
<VirtualHost t.com:80>
ServerAdmin webmaster#t.com
DocumentRoot "C:/xampp/htdocs/t"
ServerName t.com
ServerAlias t.com
## ErrorLog "logs/jrd_dnd_tools.localhost.log"
##CustomLog "logs/jrd_dnd_tools.localhost.log" common
<Directory "C:/xampp/htdocs/t">
AllowOverride All
Order Allow,Deny
Allow from all
## --New way of doing it
Require all granted
</Directory>
</VirtualHost>

Wamp localhost editing send me to WAMPSERVER Homepage

I want to change the adress of my website from http://localhost/tests/home.html
to www.mywebsite.com.
I edited the following files as explained :
C:\wamp\bin\apache\Apache2.2.17\conf\httpd.conf
C:\wamp\bin\apache\Apache2.2.17\conf\extra\httpd-vhosts.conf
C:\Windows\System32\drivers\etc\hosts
However, i'm not redirected to home.html but to the Wamp Server Homepage.
Any idea on how to solve this ? For info, here's my httpd-vhosts.conf and hosts file.
<VirtualHost *:80>
ServerName www.mywebsite.com
DocumentRoot c:/wamp64/www/tests
<Directory "c:/wamp64/www/tests/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
127.0.0.1 localhost
127.0.0.1 tests
127.0.0.1 www.mywebsite.com
::1 localhost
::1 tests
::1 www.mywebsite.com
Also, note that there are more than one files in my www/tests folder, but i want to access to home.html specifically.
You also need a VH definition fot localhost when you create virtual hosts
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp64/www
<Directory "c:/wamp64/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
And the Server name should be mywebsite.com with a ServerAlias if you want to use the www.www.mywebsite.com
<VirtualHost *:80>
ServerName mywebsite.com
ServerAlias www.mywebsite.com
DocumentRoot c:/wamp64/www/tests
<Directory "c:/wamp64/www/tests/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
Hosts file changes
127.0.0.1 localhost
127.0.0.1 tests
127.0.0.1 mywebsite.com
::1 localhost
::1 tests
::1 mywebsite.com
Once these are chnaged, remember to reset the dnscache
net stop dnscache
net start dnscache
And the restart Apache to pick up these chnages
wampmanager -> Apache -> Restart Service

Apache 2.4.9 Virtual Host on WAMP port 100 On Windows 10 503 error

I keep getting a 503 error when I try to set up a virtual host. I can set up an aliased folder just fine, but no luck on the virtual host setup.
My hosts file looks like this:
127.0.0.1 localhost
::1 localhost
127.0.0.1 appmarket.local
::1 appmarket.local
My vs-hosts file looks like this:
<VirtualHost *:100>
DocumentRoot "C:/nanomarketvhost/local"
ServerName appmarket.local
ServerAlias appmarket.local
ErrorLog "logs/appmarket-error.log"
CustomLog "logs/appmarket-access.log" common
<Directory "C:/nanomarketvhost/local">
AllowOverride All
Options Indexes FollowSymLinks
Require local
</Directory>
</VirtualHost>
<VirtualHost *:100>
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
<Directory "C:/wamp/www">
AllowOverride All
Options Indexes FollowSymLinks
Require local
</Directory>
</VirtualHost>
I have commented out the lines in the httpd.conf to load virtual hosts.

apache virtual host setting is not working

I am trying to setup the virtual host for apache on Mac.
Here is my virtual host setting in /etc/apache2/extra/httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin localhost
DocumentRoot "/Users/Ivy/Sites/Symfony"
ServerName symfony.dev
ErrorLog "/private/var/log/apache2/symfony.dev-error_log"
CustomLog "/private/var/log/apache2/symfony.dev-access_log" common
<Directory "/Users/Ivy/Sites/Symfony">
options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Additionally, editing the file in /etc/hosts
127.0.0.1 symfony.dev
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
192.168.43.168 matrixdemo.squiz.net
But when i go to symfony.dev in the web browser, it cannot connect to. could someone help me on that?
Note: tried to restart the apache several times
Try this it will work
NameVirtualHost *:80
#Do not forget to include server name and server alias in host file
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "D:\Local server\htdocs\localhost"
CustomLog logs/localhost.access.log combined
ErrorLog logs/localhost.error.log
</VirtualHost>
You could make it
<VirtualHost symfony.dev>
ServerName symfony.dev
ServerAdmin your.mail#whatever.com
DocumentRoot "/Users/Ivy/Sites/Symfony/web"
ErrorLog "/private/var/log/apache2/symfony.dev-error_log"
CustomLog "/private/var/log/apache2/symfony.dev-access_log" combined
<Directory "/Users/Ivy/Sites/Symfony/web">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
=> "Directory" instructions should be for your root-symfony-directory/web folder, as your document root.
=> What's this "common" behind your Custom Log directory ? Did you mean "combined" ?
=> In symfony2, you need to make sure that all the requests are directed to you bootstrap - this is where rewrite engine comes in. Oh, But I see this bit has moved into the .htaccess in earlier versions of symfony :o So no need for it here. Note that you have configuration instructions for apache and symfony2 here
There is much more science behind this, but these are the parameters I use for my setup. For more info, read the docs !

How to set up virtual hosts on Apache 2.2

Can anyone direct me to a good tutorial on how to set up virtual hosts using Apache 2.2? Here's my situation:
I have Apache running on my laptop and I want two websites-- one on port 80 and one on port 8089. I want to access each site from the other computer on my network by entering the computer's IP address, such as http://192.168.1.102 and http://192.168.1.102:8089. Yet when I enter the second url, it directs me to the website running on port 80.
Thanks in advance for any help.
First you need to instruct Apache to listen on the ports you need:
Listen 80
Listen 8089
Second you need to tell it what to do with 80 and 8089 traffic:
<VirtualHost *:80>
DocumentRoot /website/site80
ServerName internet.dev
</VirtualHost>
<VirtualHost *:8089>
DocumentRoot /website/site8089
</VirtualHost>
Third you need to "allow" Apache to use those directories:
<Directory "C:/website/site80">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory "C:/website/site8089">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Just have 2 virtual hosts defined like this, but with differeing DocumentRoots:
<VirtualHost *:80>
ServerAdmin webmaster#dummy-host.somecompany.com
DocumentRoot "/docs/dummy-host.somecompany.com"
ServerName dummy-host.somecompany.com
ServerAlias www.dummy-host.somecompany.com
ErrorLog "logs/dummy-host.somecompany.com-error.log"
CustomLog "logs/dummy-host.somecompany.com-access.log" common
</VirtualHost>
<VirtualHost *:8089>
ServerAdmin webmaster#dummy-host.somecompany.com
DocumentRoot "/docs/dummy-host.somecompany.com"
ServerName dummy-host.somecompany.com
ServerAlias www.dummy-host.somecompany.com
ErrorLog "logs/dummy-host.somecompany.com-error.log"
CustomLog "logs/dummy-host.somecompany.com-access.log" common
</VirtualHost>