Avoid to use Virtual Host
Posted by: mymage (---.2-87-r.retail.telecomitalia.it)
Date: December 10, 2018 10:48PM

Hi everyone,
I know that with the latest version WAMP encourages the use of virtual host to manage different sites and not use the simple sub directory path like localhost/testsite/index.php. Obviously it is a good option in a development / production system.
But for a local installation to be used for study and testing I would like to use the "raw" way to access pages with localhost/testpage.
Can anyone tell me where to find a simple explanation on how WAMP is configured to use alias/virtualhost and how to disable/enable it?
Thanks in advance

Options: ReplyQuote
Re: Avoid to use Virtual Host
Posted by: RiggsFolly (Moderator)
Date: December 10, 2018 11:51PM

Virtual hosts are not complicated.

All you do is click the link on the WAMPServer homepage and almost everything is done for you.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Avoid to use Virtual Host
Posted by: mymage (---.2-87-r.retail.telecomitalia.it)
Date: December 11, 2018 12:10AM

Thanks RiggsFolly, I promise to learn and use virtual host, but I like to know how things works.
I'm looking to know wath are the file/command that instruct Apache to use VH, or better to not permit to use subfolder because they can be used together even it is not a good confguration.
Thanks for your patience ;-)

Options: ReplyQuote
Re: Avoid to use Virtual Host
Posted by: Otomatic (Moderator)
Date: December 11, 2018 09:11AM

Hi,

> Can anyone tell me where to find a simple explanation on how WAMP is configured to use alias/virtualhost
This is not a specific configuration for Wampserver.
All hosting providers using Apache are configured to use VirtualHost.

> and how to disable/enable it?
See The need for Virtual Host and Wampserver 3 - Create or add a VirtualHost

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Avoid to use Virtual Host
Posted by: mymage (---.117-80-r.retail.telecomitalia.it)
Date: December 11, 2018 12:40PM

I apologize for have made you waste time and I write here the solution for any other distracted people like me.

After installing WAMP, I copied the files locally from a production site and tried to access the test with localhost/testsite, but the browser went redirected to [localhost]. I spent a lot of time looking for WAMP confguration thinking the problem was on virtual host or alias.
Following the first steps of "The need for Virtual Host" I activated the virtual host with "Include conf/extra/httpd-vhosts.conf" on httpd.conf, checked the httpd-vhosts.conf and created a "c:/wamp64/www/test " dir with an index.html Hello World, and it worked!
So I take a look to the production files and found an .htaccess file with the command "RewriteRule (.*) []%{HTTP_HOST}%{REQUEST_URI}".

cit. Experience is a sum of errors



Edited 1 time(s). Last edit at 12/11/2018 12:42PM by mymage.

Options: ReplyQuote


Sorry, only registered users may post in this forum.