WAMP Server will not allow access to website using "www" - apache

I cannot access my website using "www" before domain name but I can if I don't use the "www". I would like to have both accessible.
I am very familiar using Apache2 Server on Linux but it's not often I have to use it alongside WAMP. I have done plenty of messing around in the config files and have tried a few different methods but nothing seems to be working.
Here is the httpd-vhosts.conf file:
# Virtual Hosts
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName wherehousemke.com
DocumentRoot "c:/wamp64/www/wherehousemke"
<Directory "c:/wamp64/www/wherehousemke/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
Require all granted
</Directory>
</VirtualHost>
The website that I am trying to get this to work for is http://wherehousemke.com. That URL is working but if you add "www" in there It will NOT work.

you need to add a DNS record that redirects from your TLD to the www subdomain https://www.digitalocean.com/community/questions/using-cname-for-www-redirection

Related

WAMP server not able to be viewed on LAN

I've tried changing things in the vhost config and the httpd config but it never is able to be viewed on the same wifi network.
In vhosts I changed it to
# Virtual Hosts
#
<VirtualHost *:80>
ServerName Test
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www/ConklinServer"
<Directory "${INSTALL_DIR}/www/ConklinServer">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
But it doesnt work, i also changed the listen ip in httpd config and that doesnt work either. Help!

Apache virtual host subdomains not working

I am using httpd-vhosts.conf,apache version 2.4.51 and Windows Server.
The subdomain is not working.
httpd-vhosts.conf:
NameVirtualHost *:80
#
<VirtualHost *:80>
ServerName mydomain.com
ServerAlias www.mydomain.com
DocumentRoot "e:/wamp64/www/mydomain.com"
<Directory "e:/wamp64/www/mydomain.com/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
#
<VirtualHost *:80>
ServerName subdomain.mydomain.com
ServerAlias subdomain.mydomain.com
DocumentRoot "e:/wamp64/www/mydomain.com/subdomain"
<Directory "e:/wamp64/www/mydomain.com/subdomain/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Both mydomain.com and www.mydomain.com works great!
But if i try using: http://subdomain.mydomain.com i always got the error:
Hmm. We’re having trouble finding that site.
We can’t connect to the server at subdomain.mydomain.com
If that address is correct, here are three other things you can try:
Try again later.
Check your network connection.
If you are connected but behind a firewall, check that Firefox has permission to access the Web.
hosts file is correct too:
127.0.0.1 mydomain.com
::1 mydomain.com
127.0.0.1 subdomain.mydomain.com
::1 subdomain.mydomain.com
P.S. I can access it directly from the host machine, but i can't on another device.
Why only the subdomain is not working, please?
What am i missing?
Thank you!!!
It seems to be more a DNS problem than a config problem on your serveur. Did you set any DNS for your subdomain ? Maybe you could find some help here :
https://www.godaddy.com/help/create-a-subdomain-4080

Subdomain on WAMP Server Not Working

I'm having an important issue with my WAMP Server configuration. I've tried many configurations listed on many websites to no avail. I'm trying to make the directory /forums be accessible via https://forums.centmc.tk. However, upon travelling to https://forums.centmc.tk, it almost immediately says "forums.centmc.tk's server IP address could not be found." https://centmc.tk works fine, and so does the 301 redirect from https://centmc.tk/forums to https://forums.centmc.tk. I just can't figure out why the subdomain won't work.
I know it's an issue with my httpd-vhosts.conf file, so here's that:
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "c:/wamp64/www"
<Directory "c:/wamp64/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:443>
DocumentRoot c:/wamp64/www
ServerName centmc.tk
SSLEngine on
SSLCertificateFile c:/wamp64/bin/apache/apache2.4.27/conf/centmc.tk.crt
SSLCertificateKeyFile c:/wamp64/bin/apache/apache2.4.27/conf/centmc.tk.key
Redirect 301 /forums https://forums.centmc.tk
Redirect 301 /forum https://forums.centmc.tk
<Directory "c:/wamp64/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:443>
ServerName centmc.tk
ServerAlias forums.centmc.tk
VirtualDocumentRoot "c:/wamp/www/forums"
ErrorLog "c:/wamp64/bin/apache/apache2.4.27/logs/errors.log"
<Directory "c:/wamp/www/forums">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Thanks for any help in advance! Sorry for the rather large text brick at the top.
Lucas.
Sounds like a DNS problem. If you are running a DNS server on your network, you will need to add an "A" record for the "forums" subdomain. Something like this:
; example.com [448369]
$TTL 86400
# IN SOA ns1.linode.com. admin.example.com. 2013062147 14400 14400 1209600 86400
# MX 10 mail.example.com.
# A ###.###.###.###
mail A ###.###.###.###
www A <put your server IP here>
forums A <put your forums server IP here>
If you're using public DNS servers (like 8.8.8.8, 4.4.4.4, or just your default ISP's DNS servers... you'll need to add a CNAME record to wherever your domain name is registered. (GoDaddy for example). Here's a link to how to do it on GoDaddy: https://www.godaddy.com/help/add-a-subdomain-that-points-to-an-ip-address-4080
I hope that helps.

Accessing Wamp 3.1.0 from other devices

I have Wamp Server 3.1.0 installed on my Windows computer.
I am trying to access my sites from other devices, connected are connected on the same network.
I have searched online. And I have followed tutorials, but nothing matches what I need. The closest I got was: How to enable local network users to access my WAMP sites?
My httpd-vhosts.conf looks like this:
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName laravel.dev
DocumentRoot "c:/wamp/projects/forum/public"
<Directory "c:/wamp/projects/forum/public/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName test.dev
DocumentRoot "c:/wamp/projects/test/public"
<Directory "c:/wamp/projects/test/public/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local granted
</Directory>
</VirtualHost>
My expectation at this point is I can go onto another device and access my Wamp Server 3.1.0 and my individual projects.
Unfortunately I'm hit with an Error 500 saying:
Forbiddon
You do not have permission to access / on this server.
_______________________________________________________________
Apache/2.4.27 (Win64) PHP/7.1.9 Server at 192.168.1.21 Port 80
I have double checked my ipconfig and IPv4 Address matches the IP in the Error 500 code: 192.168.1.21
I did notice that the Apache version and PHP version match the versions I am using. So I know I'm accessing the server. Just not sure of the Error 500 code.
I have tried accessing my projects from these URLs:
http://192.168.1.21
http://192.168.1.21:80
http://laravel.dev/
http://test.dev/
http://localhost/
And none of them work.
Thanks in advance.
Change Require local granted to Require all granted, if not solved, Try to edit httpd-vhosts.conf file like this:
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require ip 192.168.1
</Directory>
</VirtualHost>
try access your ip computer from other device, for example your computer ip is 192.168.1.4, if you can access this ip, then create your virtual host.
if you can not access that ip, try fixing it so ip can be accessed. then create a virtual hosts.

External access web page with VirtualHosts and Wampserver

I am a newbie in wampserver.
I installed it and I can acesss web pages with localhost port 8000 without problems. Yes, I changed default port to 8000 and all works well with localhost.
Now, I created a simple project web page and I need external access. Here is my settings:
But I get the next error when I try to acesss remotely:
Forbidden
You don't have permission to access / on this server.
Apache/2.4.23 (Win64) PHP/5.6.25 Server at agenda.myvnc.com Port 8000
//agenda.myvnc.com is my elastic IP host server
My sample project:
Folders:
c:\wamp64\www
...........cloudappoint.myvnc.com(subfolder in www)
File in cloudappoint.myvnc.com folder: index.php
NOIP DNS:
- Host:cloudappoint.myvnc.com
- Target IP:XXX.XXX.XXX:8000(My host is located at amazon ec2 with elastic ip- XXXX.XXX.XXX)
- type:URL
WampServer VirtualHosts:
<VirtualHost *:8000>
ServerName cloudappoint.myvnc.com
DocumentRoot c:/wamp64/www/cloudappoint.myvnc.com
ErrorLog "logs/agenda-error.log"
CustomLog "logs/agenda-access.log" common
<Directory "c:/wamp64/www/cloudappoint.myvnc.com">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
EDITED: Here is my complete Virtual hosts file:
<VirtualHost *:8000>
ServerName localhost
DocumentRoot c:/wamp64/www
<Directory "c:/wamp64/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:8000>
ServerName cloudappoint
ServerAlias cloudappoint.myvnc.com
DocumentRoot c:/wamp64/www/webagenda
ErrorLog "logs/agenda-error.log"
CustomLog "logs/agenda-access.log" common
<Directory "c:/wamp64/www/webagenda/">
Options +Indexes +FollowSymLinks +MultiViews
DirectoryIndex index.php
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
I am unable to acesss remotely cloudappoint.myvnc.com, but if I move
<Directory "c:/wamp64/www/webagenda/">
Options +Indexes +FollowSymLinks +MultiViews
DirectoryIndex index.php
AllowOverride All
Require all granted
</Directory>
out from VirtualHost, all works well. Then, I guess 3.06 has broken Directory into Virtual Hosts.