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.1.3 32bit & 64bit)
<Apache 2.4.29/2.2.31> <PHP 7.2/7.1/7.0/5.6/5.5/5.4> <MySQL 5.7.19/5.6.39/5.5.28>
<MariaDB 10.2.14> <phpMyAdmin4.8.1> <MySQL Workbench 6.3.10>

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 MySQL 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

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.7 32 bit - Apache 2.4.37 - PHP 7.3.1/7.2.14/7.1.26/7.0.33/5.6.40 - MySQL 5.7.25 - MariaDB 10.3.12
Wampserver 3.1.7 64 bit - Apache 2.4.37 - PHP 7.3.1/7.2.14/7.1.26/7.0.33/5.6.40 - MySQL 5.7.25/8.0.14 - MariaDB 10.3.12
PhPMyadmin 4.8.4 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

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.