I have a windows IIS server 2016 version 10 and i have a production server running in a virtualenv with wampp server running in https (ssl enabled)
I have a folder mainFolder in which my website is running https://mywebsite.com and i have a sub folder Mobile inside main MainFolder
I want to run a sub-domain using Mobile Folder http://mobile.website.com
After adding subdomain in go daddy my sub-domain is active and i made changes in C:\wamp\bin\apache\Apache2.2.21\conf\extra\httpd-vhosts.conf
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp64/www
<Directory "c:/wamp64/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
#
<VirtualHost *:80>
ServerName mobile.localhost.com
ServerAlias mobile.localhost.com
VirtualDocumentRoot c:/wamp64/www/website/Mobile
<directory "c:/wamp64/www/webiste/Mobile/">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from all
</directory>
</VirtualHost>
after seeing this tutorial https://web.archive.org/web/20180323082634/http://www.axertion.com/tutorials/2012/03/how-to-setup-local-subdomains-using-wampserver/
Now my subdomain is able to run in https but it access the main directory and i want to run my sub domain in http .
when i open my sub domian in http it says file not found (404 status code)
Any help would be appreciated
Related
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
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>
We are trying to go live with our Laravel project on an Ubuntu server running Apache. While all routes and functionality works locally, after going live, all routes that are not the home route result in a 404 error.
I am using the default laravel .htaccess in the /public directory.
My /etc/apache2/sites-available looks as follows:
<VirtualHost *:80>
ServerName mydomain.com
ServerAlias www.mydomain.com
ServerAdmin webmaster#localhost
DocumentRoot /var/www/html/mydomain.com/public
<Directory /var/www/mydomain.com/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
The /mydomain.com/ root directory does not currently contain any .htaccess.
I enabled modrewrite using a2enmod rewrite and restarted apache after every change.
Has anyone else run into this issue? I appreciate any suggestions on how to resolve.
Thanks in advance!
You write mydomin.com in every rows. But later you talk about mydomain.com folder. (Note the A). Is it just a mistyping?
Update: The problem is an other mistyping: directories should be the same on the following lines:
DocumentRoot /var/www/html/mydomain.com/public
<Directory /var/www/html/mydomain.com/public>
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 an Apache server that handles two virtual host on port 8080, one is private (localhost) and a second one is public (internet). The private virtual host works fine but the public keeps redirecting all public requests to the localhost and I'm not sure what I'm doing wrong. Please help! Below is the httpd-vhost.conf file:
# Virtual Hosts
<VirtualHost *:8080>
ServerName localhost
DocumentRoot c:/wamp64/www
<Directory "c:/wamp64/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:8080>
ServerName mydomain.com
DocumentRoot c:/wamp64/www/App
<Directory "c:/wamp64/www/App/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
DirectoryIndex index.html index.php
</VirtualHost>
#
Also, this is running WAMP / Magento on Windows Server 2012 and hosted in Azure. Thanks a lot!
Please find the comments on virtual host settings.
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
Refer this
I found that the virtual host was configured correctly and the re-directing problem was in MySQL Magento Db, which was pointing to the localhost:8080. I changed core_config_data under web/unsecure/base_url and web/secure/base_url to my public domain and it worked fine. I posted this answer in case someone else lands here with a similar problem. Thanks