Pages: 12Next
Current Page: 1 of 2
configuring vhosts and phpmyadmin
Posted by: rpjd (37.228.254.---)
Date: June 16, 2016 12:29PM

I have installed 64-bit wampserver 5 or wampserver64 (not sure which is the official name) Apache 2.4.17, PHP 5.6.16, mysql 5.7.9, phpmyadmin 4.5.2, icon is green. I want to create virtual hosts for my projects and upgrade phpmyadmin to latest version 4.6.2.
The steps I know are: list vhosts in hosts file using 127.0.0.1 hostname, create virtual hosts in http-vhosts.conf using <VirtualHost> DocumentRoot "c:\wamp\www" SeverName localhost </VirtualHost> for localhost, then
<VirtualHost> DocumentRoot "c:\wamp\www\Hostname" SeverName Hostname </VirtualHost> for other hosts.
Uncomment Include conf/extra/httpd-vhosts.conf in httpd.conf
For phpmyadmin: download new phpmyadmin to c:\wamp\apps, change phpmyadmin alias version no in phpmyadmin.conf, copy cinfig.sample.inc.php to config.in.php
What am I missing?
Thanks.

Options: ReplyQuote
Re: configuring vhosts and phpmyadmin
Posted by: Otomatic (Moderator)
Date: June 16, 2016 03:05PM

Hi,

The Wampserver version is seen by About (Right-Click) or with clic on Wampmanager icon

> What am I missing?
You missed all that can be added or changed with Wampserver without having to get your hands dirty.

With Wampserver 3, VirtualHost can be created by three clicks : Wampserver 3 - Create or add a VirtualHost

All install files for addon or new versions of PhpMyAdmin, Adminer, PhpSysInfo and so on are on [wampserver.aviatechno.net]

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

Options: ReplyQuote
Re: configuring vhosts and phpmyadmin
Posted by: rpjd (37.228.254.---)
Date: June 16, 2016 06:48PM

I have these issues after after creaating host:
Warning: fopen(C:\\WINDOWS\\system32\\drivers\\etc\\hosts): failed to open stream: Permission denied in C:\wamp\www\add_vhost.php on line 229
Warning: fwrite() expects parameter 1 to be resource, boolean given in C:\wamp\www\add_vhost.php on line 230
Warning: fclose() expects parameter 1 to be resource, boolean given in C:\wamp\www\add_vhost.php on line 264
and in localhost:
The number of <Directory or </Directory> does not match the number of ServerName in C:/wamp/bin/apache/apache2.4.17/conf/extra/httpd-vhosts.conf file
I'm confused.

Options: ReplyQuote
Re: configuring vhosts and phpmyadmin
Posted by: Otomatic (Moderator)
Date: June 16, 2016 06:54PM

Hi,

See note 2 of TROUBLESHOOTING TIPS

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

Options: ReplyQuote
Re: configuring vhosts and phpmyadmin
Posted by: rpjd (37.228.254.---)
Date: June 16, 2016 07:35PM

Installed wampserver as administrator. Created 5 Virtual Hosts including localhost, but cannot access them
404 Not Found

The requested URL / was not found on this server.
Apache/2.4.17 (Win64) PHP/5.6.16 Server at project Port 80

Still have this on localhost
The number of <Directory or </Directory> does not match the number of ServerName in C:/wamp/bin/apache/apache2.4.17/conf/extra/httpd-vhosts.conf file

Options: ReplyQuote
Re: configuring vhosts and phpmyadmin
Posted by: Otomatic (Moderator)
Date: June 17, 2016 09:49AM

Hi,

Please, post here the contents of:
- C:/wamp/bin/apache/apache2.4.17/conf/extra/httpd-vhosts.conf file
- C:/windows/system32/drivers/etc/hosts file

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

Options: ReplyQuote
Re: configuring vhosts and phpmyadmin
Posted by: rpjd (37.228.254.---)
Date: June 17, 2016 05:47PM

I have 7 projects and 8 virtual hosts including localhost. Which is probably why I'm getting this error:
The number of <Directory or </Directory> does not match the number of ServerName in C:/wamp/bin/apache/apache2.4.17/conf/extra/httpd-vhosts.conf file
The number of <VirtualHost does not match the number of ServerName in C:/wamp/bin/apache/apache2.4.17/conf/extra/httpd-vhosts.conf file.
which I'm not overly worried about. Although I have the virtual hosts set up, I can't access the files. After restart DNS, wampserver icon is orange.

Options: ReplyQuote
Re: configuring vhosts and phpmyadmin
Posted by: Otomatic (Moderator)
Date: June 17, 2016 06:19PM

Hi,

Because I'm nice, I will repeat one last time my requests:

Please, post here the contents of:
- C:/wamp/bin/apache/apache2.4.17/conf/extra/httpd-vhosts.conf file
- C:/windows/system32/drivers/etc/hosts file

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

Options: ReplyQuote
Re: configuring vhosts and phpmyadmin
Posted by: rpjd (37.228.254.---)
Date: June 17, 2016 06:31PM

As requested, sorry about delay.

hosts:
127.0.0.1 Project1
::1 Project1

127.0.0.1 Project2
::1 Project2

127.0.0.1 Project3
::1 Project3

127.0.0.1 Project4
::1 Project4

127.0.0.1 Project5
::1 Project

127.0.0.1 Project6
::1 Project6

127.0.0.1 Project7
::1 Project7

httpd-hosts.conf
<VirtualHost>
DocumentRoot "c:/wamp/www"
ServerName localhost
</VirtualHost>

<VirtualHost *:80>
ServerName Project1
DocumentRoot c:/wamp/www/Project1
<Directory "c:/wamp/www/Project1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName Project2
DocumentRoot c:/wamp/www/Project2
<Directory "c:/wamp/www/Project2/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName Project3
DocumentRoot c:/wamp/www/Project3
<Directory "c:/wamp/www/Project3/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName Project4
DocumentRoot c:/wamp/www/Project4
<Directory "c:/wamp/www/Project4/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName PHProject5
DocumentRoot c:/wamp/www/Project5
<Directory "c:/wamp/www/Project5/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName Project6
DocumentRoot c:/wamp/www/Project6
<Directory "c:/wamp/www/Project6/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerName Project7
DocumentRoot c:/wamp/www/Project7
<Directory "c:/wamp/www/Project7/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

Options: ReplyQuote
Re: configuring vhosts and phpmyadmin
Posted by: Otomatic (Moderator)
Date: June 17, 2016 06:52PM

Hi,

First mistake: in the hosts file you must add:
127.0.0.1 localhost
::1 localhost

Second mistake: in the httpd-vhosts.conf file, the VirtualHost for localhost should be :
<VirtualHost *:80>
	ServerName localhost
	DocumentRoot c:/wamp/www
	<Directory  "c:wamp/www/">
		Options +Indexes +Includes +FollowSymLinks +MultiViews
		AllowOverride All
		Require local
	</Directory>
</VirtualHost>

After making the changes, and save files, so that they take effect, you must restart the DNS:
- Right-Click Wampmanager tray icon -> Tools -> Restart DNS

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

Options: ReplyQuote
Re: configuring vhosts and phpmyadmin
Posted by: rpjd (37.228.254.---)
Date: June 17, 2016 07:25PM

Made those changes and restarted DNS, icon green, no errors but still no access to virtual hosts files at Port 80.

Options: ReplyQuote
Re: configuring vhosts and phpmyadmin
Posted by: rpjd (37.228.254.---)
Date: June 18, 2016 04:51PM

Configuration for vhosts aside, is there any changes that need to be made to httpd.conf to be able to access project files on localhost?

Options: ReplyQuote
Re: configuring vhosts and phpmyadmin
Posted by: Otomatic (Moderator)
Date: June 18, 2016 05:22PM

Hi,

With VirtualHost correctly configured you only need to launch projects with :
'http://project1/' or 'http://project2/' or 'http://project3/' and so on.
or
with the menu Your VirtualHost on the Wampserver homepage ('http://localhost/'
or
with Wampmanager tray icon -> Your Virtualhost

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

Options: ReplyQuote
Re: configuring vhosts and phpmyadmin
Posted by: rpjd (37.228.254.---)
Date: June 18, 2016 05:34PM

Should I be able to see project files when selecting a project in localhost without any vhosts set up? If so, I'm missing something. I still get the localhost homepage when clicking a project link. The hosts and httpd.vhosts.conf file seem correct, I followed instructions per earlier comments. Frustrating.

Options: ReplyQuote
Re: configuring vhosts and phpmyadmin
Posted by: Otomatic (Moderator)
Date: June 18, 2016 06:56PM

Hi,

Do you use a proxy ?
If so, it is necessary to except 127.0.0.1

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

Options: ReplyQuote
Re: configuring vhosts and phpmyadmin
Posted by: rpjd (37.228.254.---)
Date: June 18, 2016 07:00PM

No, I have never tinkered with proxies.

Options: ReplyQuote
Re: configuring vhosts and phpmyadmin
Posted by: rpjd (37.228.254.---)
Date: June 18, 2016 08:33PM

By process of elimination I am trying to figure out why I'm not getting access to project files on localhost. I have the virtual hosts set up, but getting the error:
The number of <VirtualHost does not match the number of ServerName in C:/wamp/bin/apache/apache2.4.17/conf/extra/httpd-vhosts.conf file
I have checked httpd-vhosts.conf and every <VirtualHost has one and only one ServerName. So this error makes no sense.

Options: ReplyQuote
Re: configuring vhosts and phpmyadmin
Posted by: Otomatic (Moderator)
Date: June 18, 2016 09:03PM

Hi,

Two days ago, after you made modifications, there was no error with httpd-vhosts.conf file or hosts file.

What did you do.?

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

Options: ReplyQuote
Re: configuring vhosts and phpmyadmin
Posted by: rpjd (37.228.254.---)
Date: June 18, 2016 09:36PM

What config besides vhosts if any is needed to access project files?
127.0.01 ProjectName
When I select the project, it appears in the url as ProjectName/, but the page remains on localhost homepage.

Options: ReplyQuote
Re: configuring vhosts and phpmyadmin
Posted by: SimonT (---.lightspeed.stlsmo.sbcglobal.net)
Date: June 19, 2016 01:01AM

This is a very long reply - if you decide to follow my suggestions, as creating virtual hosts, print this out so you can refer to as you go through the steps.
----

You should start from scratch creating virtual hosts. Too many things have been changed, too many types of errors have occured - trust me, after 42+ years in data processing, I know that there are times when it is best to get a clean start on a problem and this is one of those times.

Make a backup copy of the C:/wamp/bin/apache/apache2.4.17/conf/extra/httpd-vhosts.conf file

- If you have the 64 bit version of WAMP installed, it may be at C:/wamp64/bin/apache/apache2.4.17/conf/extra/httpd-vhosts.conf instead of C:/wamp

Also backup any other files, anywhere, you have modified during your efforts to create virtual hosts and getting them working.

If what I suggest does not work, you can restore the backup copies of these files and be back where you started before you tried what I will suggest you try, below.

Backup, Backup, Backup - always backup anything before you change it, whether a file or a program open via a menu.

Did you backup the files you were going to change before you began creating virtual hosts - I doubt it but had you done so, you could have restored the files and been back to where you were before you started making virtual hosts and could have tried again, with a "clean slate."

It is always necessary to have a way to get back to the state of things before you make any changes, no matter how small the changes may seem to you - particularly when working with files or systems of which you have limited knowledge, such as WAMP, the virtual hosts file, etc.

Far better to make too many backups than not enough or none at all. You can always delete backups when you are absolutely sure you want need them.

So, backup the fies and then remove all the changes and additions you put in the virtual host file and in any other files, anywhere you made when creating virtual hosts or working on the problems.

Get things back to the way their were before you took even the first step to create a virtual host.

If need be, "drop back and punt" and un-install WAMP and re-install it, whatever it takes to get back to the exact state everything was in when you started to create virtual hosts. If make sure you save any files - such as web site files - you created in any directories under the WAMP root.

*** What I am going to suggest only applies to WAMP 3. Earlier versions do not have the automated virtual host creation function. You can find out what version of WAMP is installed by right clicking the WAMP icon and then clicking About...

If you are not on WAMP 3, I suggest you consider installing the latest version.

You want to get back to the point where you have no virtual hosts of your own showing on the WAMP virtual host menu --- left click the WAMP icon and then click the Virtualhost menu item -- hovering over thh Virtualhost menu item should also open the virutal host list.

If you can't get rid of virtual hosts that are shown there, use different virtual host names in the following procedure, don't try to use duplicate names, it isn't going to work.
--------

After you have put the files back they way they were, do the following:

Shut down WAMP - right click the icon, click exit.

Restart WAMP and wait for the icon to turn green.

Create you virtual hosts using the facility built into the latest versions of WAMP:

If you are running WAMP 3, you can make a virtual host very easily. Go to this post and read it [forum.wampserver.com]

Here are the steps described differently:

1 - You must know the complete path to the web site. If it is stored under say, C:\wamp\www\mywebsite - that is the complete path, the path you would use to access the site's file via, for example, Windows Explorer.

2 - You must choose a virtual site name - like mywebsite.com

3 - Left click the WAMP icon in the Windows system tray (the right hand side of the Windows taskbar).

4 - Click Localhost in the menu that appears which you click the WAMP icon.

5 - The "Localhost" (I think of it as the WAMP local "home" page) page will be opened in your browser.

6 - On the left hand side, almost at the bottom, you will find a section titled "Tools", under that will be a link titled "Add a Virtual Host" - click that link.

7 - The "Add a VirtualHost" page will open. There are two text boxes on the window which you must fill in correctly.

8 - The first one is where you put the name of the virtual host, the "domain name" if you like. If you want to be able to enter mywebsite.com in the browser address bar to get to your site, then type mywebsite.com into the box on the Add VirutalHost window.

9 - The second text box is where you put the full path to the web site. Enter it as I discussed in step #1

10 - Click the very wide button labeled "Start the creation of the VirtualHost (May take a while...)" , located at the lower right hand corner of the Add Virtualhost window and wait.

11 - If the virtual host is successful a new window will open telling that and telling you that you need to restart the DNS. Do so by right clicking the WAMP icon, click Tools, and then Click Restart DNS -- it is the topmost menu item. Wait for the WAMP icon to go to red, then orange, and back to green and your virtual host should be ready for use.

If the vitural host is not successfully created, I assume some message will be displayed - I don't know because the operation has never failed the several times I've used it.

Once the virtual host is created, you can go to the site by typing, using the example, mywebsite.com OR you can go there via the WAMP icon - left click the icon, click Your Virtualhosts and then click the one you want to access.

******************* REMEMBER - the "automated" method of creating virtual hosts is ONLY available on WAMP 3 or higher.

If you are running an older version, I strongly suggest you consider install in WAMP 3. As I understand it, you have to uninstalled earlier versions before installing version 3 but I've installed 3 on this system to start with.


================ SOMETHING you should remember whenever reading posts or WAMP documentation: the good folks (such as the moderator) who created WAMP, keep it up to date, and post answers here are French and their English ma at times be a bit confusing to a person whose spoken language is English. You need to read carefully and consider that they may be saying something in a different way than you might expect.

Their English is better than my French, I can maybe make out 10% of a menu in French but they use English very well. Keep in mind it is the second or third, or fourth language - they may know other languages besides French and English.

I took Spanish in high school but I only remember perhaps 0.5% of what I learned, or thought I learned.

Remember that these people are using English as a second language and read their replies, documentation, and text on the various WAMP web pages with that always in mind.

Options: ReplyQuote
Pages: 12Next
Current Page: 1 of 2


Sorry, only registered users may post in this forum.