Version 2.5
Posted by: Malcolm (101.175.71.---)
Date: September 25, 2014 09:02AM

I have Windows 7 Pro SP1; Wampserverr 2.5, 32 bit; Apache 2.4.9; MySQL 5.6.17; PHP 5.5.12; green icon.
I have been using Wampserver for many years but cannot get Ver. 2.5 to work. When I click "localhost" I get the usual display including a list of "Your Projects" (several websites). When I click on a project "Server not found" is displayed eventually. I read the forum entry by RiggsFolly of 28 May and attempted to follow instructions on creating a Virtual Host but this did not help. In his example he refers to "project1"; I am uncertain whether this is intended as a project name or actually a domain name (or a mixture of both). I have tried various combinations but none work. I would appreciate some assistance before I give up and return to Version 4.
Malcolm Tompson

Options: ReplyQuote
Re: Version 2.5
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: September 25, 2014 10:12AM

Hi Malcolm,

The folder 'project1' is just a folder name into which you place your website code, it has no relation to the actual domain name until Apache sees your Virtual Hosts definition.

The part that associates the folder name 'project1' with an actual domain name is the 'DocumentRoot' and 'ServerName' directives that you use in the Virtual Host definition.

So if you place your website pages/code into '\wamp\www\project1' then the Virtual Hosts Definition

<VirtualHost *:80>
     DocumentRoot "c:/wamp/www/project1"   <-- this is the folder that holds
     ServerName project1.dev               <-- this domain
     ServerAlias www.project1.dev          <-- and this alias for that domain
     <Directory  "c:/wamp/www/project1">   <-- this section defines access rights to the domain
        AllowOverride All
 		Require local
     </Directory>
 </VirtualHost>


Also the folder you place the website code into does not have to exist below the '\wamp\www' folder. You could do something like this to move the website code from the wamp folder completely

So you could create

'c:\websites\project1\www' and 'c:\websites\project2\www'

folders to hold 2 seperate sites. Then define the 2 Virtual Hosts so Apache knows where to get those sites from like so

<VirtualHost *:80>
     DocumentRoot "c:\websites\project1\www"
     ServerName project1.dev
     ServerAlias www.project1.dev
     <Directory  "c:\websites\project1\www">
        AllowOverride All
 		Require local
     </Directory>
 </VirtualHost>


<VirtualHost *:80>
     DocumentRoot "c:\websites\project2\www"
     ServerName project2.com
     ServerAlias www.project1.com
     <Directory  "c:\websites\project2\www">
        AllowOverride All
 		Require local
                Require ip 192.168.1
     </Directory>
 </VirtualHost>


This also helps you have more than one project under development or maintenance at the same time. You can also control their access privilages seperately by amending 1 site to allow access from places other than the local machine eg the 'Requie' directive. See project2's VHost definition.

There are also other advantages in using VHOST's, for example if you have one site that requires some amendments to the PHP parameters required to run the site. For example if project2 requires additional PHP limits to run you can amend those just for that specific site like so :-


<VirtualHost *:80>
DocumentRoot "c:\websites\project2\www"
ServerName project2.com
ServerAlias www.project1.com
<Directory "c:\websites\project2\www">
AllowOverride All
Require local
Require ip 192.168.1
</Directory>

php_admin_value upload_max_filesize 128M
php_admin_value post_max_size 128M
php_admin_value max_execution_time 360
php_admin_value max_input_time 360

</VirtualHost>
[/code]

This serves to allow you to make the amendment, but for them to be specific to just that site. This is also self documenting, so when you come to move the site to a live hosted environment you should be able to see what changes you had to make to get this site running as you want it.


I hope this clears up any lack of clarity in my original document.

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



Edited 3 time(s). Last edit at 09/25/2014 10:30AM by RiggsFolly.

Options: ReplyQuote
Re: Version 2.5
Posted by: Malcolm (101.161.163.---)
Date: September 26, 2014 03:49AM

Thank you for the advice, however I still cannot make it work. I get the home page satisfactorily listing my projects but when I click on one it fails to find the server.
Cheers,
Malcolm

Options: ReplyQuote
Re: Version 2.5
Posted by: Malcolm (101.161.163.---)
Date: September 26, 2014 03:58AM

I have just found when I click on some projects it returns a website with a similar name but not one of mine. For example, when I click on my project "Probus" (an Australian domain name) I get a Probus website in Helsinki, Finland!

Options: ReplyQuote
Re: Version 2.5
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: September 26, 2014 10:33AM

Have you created an entry in your HOSTS file for the domains that you have locally?

So for eample if you have a probus.dev domain in your Virtual hosts, you have to add these lines into the

C:\windows\system32\drivers\etc\hosts file.

127.0.0.1 probus.dev
::1     probus.dev

Then you have to restart you systems dnscache service like so ( or just reboot )

Launch a command windows using the "Run as Administrator" option

net stop dnscache
net start dnscache

Now windows will see that the domain probus.dev can be found locally and the browser does not go looking on the internet for this domain.

---------------------------------------------------------------------------------------------
(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: Version 2.5
Posted by: Malcolm (---.lns4.ken.bigpond.net.au)
Date: September 27, 2014 05:21AM

Another point I should make is the difficulty in refreshing the 'net' cache. When I enter 'net stop dnscache' in the command prompt, I get ''System error 5 has occurred. Access is denied.'. This can be overcome by navigating to the Accessories folder, then r/c Command Prompt, then click 'Run as Administrator'.
Cheers,
Malcolm

Options: ReplyQuote
Re: Version 2.5
Posted by: Malcolm (---.lns4.ken.bigpond.net.au)
Date: September 27, 2014 05:30AM

My previous reply vanished so I will repeat it.
Thank you for your ongoing assistance but I have found the solution! I was trying to open my projects by using the 'Localhost' menu item instead of 'My Virtual Hosts' as this was the method in previous versions of WampServer. Perhaps you should add this to your instructions and make your comments about wampmanager.tpl as point 4 of your instructions.
Cheers,
Malcolm

Options: ReplyQuote


Sorry, only registered users may post in this forum.