I am trying to access my web app from my phone connected via same router but I am being able to only access the localhost home page but when I click on the respective virtualhost, I am not being able to access the page.
I have setup my virtual host through the interface provide in wamp server.
Wamp Server Version: 3.0.6
httpd-vhosts.conf
# Virtual Hosts
#
<VirtualHost *:80>
ServerName localhost
DocumentRoot D:/wamp64/www
<Directory "D:/wamp64/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
#Require local
Require all granted
</Directory>
</VirtualHost>
#
<VirtualHost *:80>
ServerName transmit
DocumentRoot "d:/wamp64/www/transmit_renewed"
<Directory "d:/wamp64/www/transmit_renewed/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
#Require local
Require all granted
</Directory>
</VirtualHost>
Related
My local IP is 192.168.29.248. And I want to run the PHP site normally when I run 192.168.29.248:8086 and Django website as 192.168.29.248:8086/django/. How can I achieve this?
My current vhosts.conf is:
<VirtualHost *:8086>
ServerName localhost
ServerAlias localhost
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Please help?
I have installed wamp on C:/wamp64/ folder
I have created a virtual host called sampleapp.dev. But when I access it It says "This site can’t be reached".
my httpd-vhosts file
# 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>
ServerName sampleapp.dev
DocumentRoot "C:/wamp64/www/sampleapp/public"
</VirtualHost>
my hosts file
127.0.0.1 localhost
::1 localhost
127.0.0.1 sampleapp.dev
::1 sampleapp.dev
What I am doing wrong?
<VirtualHost *:80>
ServerName sampleapp.dev
ServerAlias sampleapp.dev
DocumentRoot "C:/wamp64/www/sampleapp/public"
</VirtualHost>
<Directory "C:/wamp64/www/sampleapp/public">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
my setting
it's working
As you can see from the Definition of the localhost Virtual Host, you need more than just the name of the VH defined, you also have to tell Apache who is allowed to access your new Virtual Host.
The <Directory...> block tell Apache this, specifically the Require local piece, but the other parameters also tell Apache useful information about whats allowed to be done in this new VH.
Try the below amendment.
I have changed sampleapp.dev to sampleapp.test. This is because if you ever use the Chrome browser, the .dev tLD does some odd things now. Google bought the .dev tLD and Chrome now will try and enforce the use of SSL (https) on all .dev tLD's. Simple solution it to just use something else like .local or .test
# 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>
ServerName sampleapp.test
ServerAlias www.sampleapp.test
DocumentRoot "${INSTALL_DIR}/www/sampleapp/public"
<Directory "${INSTALL_DIR}/www/sampleapp/public/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
As I use .test instead of .dev yo will also have to change your HOSTS file accordingly, and then reboot or refresh your dnscache like this from a command window started using "Run as Administrator".
Also avoid using Require all granted unless you actually want to allow the universe into your server. If your router blocks port 80, which they do by default nothing can actually get into your WAMPServer. But the second you decide you want to show a friend your nice new site and Port Forward port 80 to your WAMPServer PC, all sites that use Require all granted will become visible. Best to make that change only on the site you really want to be visible from the internet.
>net stop dnscache
>net start dnscahce
On win10 pro 64 I use WAMP Server 3.0.6 64bit for joomla localhosting
So, there are two virtual hosts in server: interopt and gmdb
The first works perfect
but when trying to run the second it responses with
Warning: session_write_close(): Failed to write session data (user). Please verify that the current setting of session.save_path is correct (f:/wamp64/tmp) in F:\wamp64\www\gmdb\libraries\joomla\session\handler\native.php on line 194
Session_save_path looks correct while it's really placed on f:/wamp64/tmp (folder has read/write permissions
On 194 line of native.php is
session_write_close();
I use php version 7.0.10 (but the same problem appears when turnning on 5.6.25 too)
virtual hosts seem work perfect and host file too
Any idea? Could you please help?
My virtual hosts
<VirtualHost *:80>
ServerName localhost
DocumentRoot f:/wamp64/www
<Directory "f:/wamp64/www">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName interopt
DocumentRoot f:/wamp64/www/interopt
<Directory "f:/wamp64/www/interopt">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName gmdb
DocumentRoot f:/wamp64/www/gmdb
<Directory "f:/wamp64/www/gmdb">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
I have some virtual-host and I can access it on the PC that has the server intalled. But I have others Pc and I want to access via the domain name.
I just can access to the server configuration page changing the statement "Require local" to "Require all granted". This only allow me to access through the ip address.
<VirtualHost *:80>
ServerName localhost
DocumentRoot D:/wamp64/www
<Directory "D:/wamp64/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName laravel5.1.app
DocumentRoot "d:/wamp64/www/laravel5_1/public"
<Directory "d:/wamp64/www/laravel5_1/public/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
To access the site using your domain names you must tell each of the other PC's where to find the domain name.
So you either need a local DNS Server or you edit the HOSTS file on each PC that you want to access the site from by adding something like this to the other PC's HOSTS
192.168.1.100 laravel5.1.app
Assuming your WAMPServer (Apache) is running on ip address 192.168.1.100
I have created a virtual host for a new application in wamp.
In my httpd.conf
# Virtual hosts
Include conf/extra/httpd-vhosts.conf //<--- Removed #
In my httpd.vhosts.conf I added a new host
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot "C:/wamp/www/myapp"
ServerName myapp.local
ServerAlias 127.0.0.1
SetEnv APPLICATION_ENV "development"
<Directory "C:/wamp/www/myapp/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
</Directory>
</VirtualHost>
The virtual host is working fine. But the problem is my other apps that run without virtual hosts are not working.
When i open http://localhost/fistapp/ it shows
Forbidden 403
You don't have permission to access / on this server.
Once you create a Virtual Host definition Apache basically ignores the localhost domain defined in the httpd.conf file, so you have to also define locahost in the httpd-vhosts.conf file as well. So your httpd-vhosts.conf file should look like this :
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp/www
<Directory "c:/wamp/www/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
# made some amendments to this VH as well
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/myapp"
ServerName myapp.local
# not sure why this is here ServerAlias 127.0.0.1
ServerAlias www.myapp.local
SetEnv APPLICATION_ENV "development"
<Directory "C:/wamp/www/myapp">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride all
Require local
</Directory>
</VirtualHost>
Dont forget to amend the C:\windows\system32\drivers\etc\hosts file to add your new domain like this
127.0.0.1 localhost
::1 localhost
127.0.0.1 myapp.local
::1 myapp.local