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!
Related
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
I have developed a website with a complete different virtual host in WAMP v 3.2.3 it's running well on my local machine(localhost) but the problem lies with it's access over the LAN.I have changed its apache httpd-vhosts.conf file from
# 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
</Directory>
</VirtualHost>
#
<VirtualHost *:80> //My required Virtual Host
ServerName test
DocumentRoot "c:/wamp64/www/project1/test/sites/">"
<Directory "c:/wamp64/www/project1/test/sites/">">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require Local
</Directory>
</VirtualHost>
to:
# 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
</Directory>
</VirtualHost>
#
<VirtualHost *:80> //My required Virtual Host
ServerName test
DocumentRoot "c:/wamp64/www/project1/test/sites/">
<Directory "c:/wamp64/www/project1/test/sites/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted // <--change(Local to all granted)
</Directory>
</VirtualHost>
and allowed incoming inbound connection from port 80
Still the problem persists and I cannot access my project from any other device.
It shows:
Forbidden
You don't have permission to access this resource
Apache/2.4.46 (Win64)PHP/7.3.21 Server at 192.168.43.*
Where'the problem?
Please help.
you don't need to hide your local IPv4 address 192.168.43.*, there are millions of devices around the world with same IPv4 address as you, people outside of your local network can not communicate with your local IP address just by knowing your IPv4 address, it is not possible.
You appear to have multiple virtual hosts set up for port 80. You only need one for local hosting.
Make sure that the firewall on your server computer is configured to let apache through.
Put whatever files you want to server inside the 'www' folder on your server computer.
Use the below config settings and restart apache so that the new config is loaded.
Open a web browser on any device that is connected to the same local network as your server computer i.e. mobile phone connected by wifi to the same router as your server computer.
Type in the server computer IPv4 address into the browser of your mobile phone, done...
<VirtualHost *:80>
DocumentRoot ${INSTALL_DIR}/www
<Directory ${INSTALL_DIR}/www>
Require all granted
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
</Directory>
</VirtualHost>
# 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
</Directory>
</VirtualHost>
To
# 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 all granted
</Directory>
</VirtualHost>
Next step: Open wamp file see this image
find this section to changes see this image
Require all denied
To
Require all granted
Save and close. Restart all service your wampserver
then paste your ipaddress in browser url see the result
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
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.
I want to host multiple websites on my computer. I'm using Windows with WAMP server. I already have domains and know how to map them to ip.
I have already edited httpd.conf file to allow virtual hosts.
My httpd-vhosts file looks like this,
<VirtualHost *:80>
DocumentRoot "C:/wamp64/www"
ServerName localhost
ServerAlias localhost
<Directory "C:/wamp64/www">
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wamp64/www/testcase"
ServerName test.mydomain.com
<Directory "C:/wamp64/www/testcase">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wamp64/www/test2"
ServerName test2.mydomain.com
<Directory "C:/wamp64/www/test2">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
The problem is that both my domains open only the first site in this VirtualHost tag.
Example: In this case, both my domains will open the WAMP server configuration page. If I were to move the "testcase" tag above the other, both my domains will open the "testcase" page.
Update:
My subdomains show corresponding pages successfully when I open them on the server. But when I open subdomains on another machine, they open the first entry in the VH.
Update 2: Okay, so this is just out of my understanding now. I thought may be WAMP is not my cup of tea. So I installed XAMPP and made changes to the VH configuration and still ended up with same problem. So I then got rid of XAMPP too and installed WAMPDeveloper Pro. What could go wrong when the software sets up all the configuration files for you, right? But to my surprise, I still have the same problem. The websites work fine when I open them (using actual domain name) on the server itself, but when I open them on machine outside network the first VH entry open for all the domains I open.
Can anyone please help me with this?
Thanks!
Using both Apache2.2 and Apache2.4 syntax gets Apache a litle confused.
So as I assume you are running Apache 2.4 change the VH defs to this
<VirtualHost *:80>
DocumentRoot "C:/wamp64/www/testcase"
ServerName test.mydomain.com
<Directory "C:/wamp64/www/testcase">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wamp64/www/test2"
ServerName test2.mydomain.com
<Directory "C:/wamp64/www/test2">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Why Apache opens the first site i.e. localhost in this case.
If Apache cannot make sense of a VH def, it ignores it and default to loading the first Virtual Host that was correctly defined in the httpd-vhosts.conf file.
Of course you will also need to amend your c:\windows\system32\driverrs\etc\hosts file to include these domain names
127.0.0.1 localhost
127.0.0.1 test.mydomain.com
127.0.0.1 test2.mydomain.com
::1 localhost
::1 test.mydomain.com
::1 test2.mydomain.com