Issues with Apache 2.4 and WampServer running side-by-side on Windows
Posted by: codeslayer2010 (---.se.biz.rr.com)
Date: June 25, 2018 11:11PM

THE ISSUE

I'm trying to run Apache 2.4 in a standalone installation with PHP and MySQL, all manually configured alongside my WAMPServer. This means I have two separate servers running side-by-side.

I was following a tutorial from 2015 on how to run two apache installs side-by-side on Windows. At a certain point it the instructions on screen didn't match up with what I was seeing on my system. I filled in the gaps a figured out some workarounds by Googling and researching some Stack Overflow posts.

Eventually, I did get both installs running side by-side by setting up some virtual hosts. I'm a newbie when it comes to Apache and virtual hosts, so I don't really understand the internals of virtual hosts on a deep level, but I think I get the general concept: it is like a symlink or alias for a URL or IP address that might be typed into your browser's address bar.

MY SYSTEM SETUP:
1 - Windows version: Windows 10 64-bit
2 - Version WampServer: 3.1.3 32-bit
3 - Apache 2.4.33 - PHP 5.6.35
4 - MySQL 5.7.21
5 - MariaDB 10.2.14
6 - PHP 5.6.35 for CLI (Command-Line Interface)
7 - WampServer Icon Color: ORANGE

MY CODE

Here is the setup that worked:

# 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 *:90>
ServerName myalbums
ServerAlias myalbums
DocumentRoot "${INSTALL_DIR}/www/myalbums/public"
<Directory "${INSTALL_DIR}/www/myalbums/public">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

A BIT OF BACKGROUND

I made some changes in some conf files (normally very meticulous in my documentation) -- just following directions from another tutorial -- that worked. Then I commented out the "*:80" virtualhost, but that broke the whole thing, which I thought was weird. If localhost on port 80 is the "real" and "true" host, then why would anyone make a "virtual" alias for it?

Anyway, like I said, the above config worked. Again, there are other files I modified just blindly following instructions and I don't remember what every file was, nor what I changed in them, NOR which of the many tutorial I've had to reference (because none of them are a complete tutorial on what I'm trying to do) those instructions came from.

Following yet another tutorial, I installed Zend PHP a few weeks later with composer and that is what the "myalbums" in the VirtualHost "*:90" is referring to, but have since deleted that folder.

WAMP ERRORS

WampServer was giving me a whole bunch of errors when I click on the green "W". I resolved most of them by tinkering and troubleshooting within some Apache config files. There were also error messages under the "Your VirtualHosts" submenu, three or four if I recall correctly. Some of them had something said something like "DON'T PUT WAMP PATHS IN THE WINDOWS PATH ENVIRONMENT VARIABLE". I removed the two references to WAMP in the Windown PATH variable.

I got rid of most of them errors, partially by searching Stack Overflow and following advice from another post to add "Listen 80" at the top of the httpd-vhost.conf file, and commenting out the "*:90" virtual host. Now, that file is the only one that still has an error:

"There is an error.
In the httpd-vhost.config file:

The Port used (80) for the VirtualHost localhost is not a Listen port"

In addition to that error, the big "W" **is orange** and I am unable to login to MySQL server, though I know my password is correct. What is going on?

MY QUESTIONS:

_This is one question asking in multiple parts to get prompt the most complete answer from various perspectives._

1. How can I run Apache 2.4 on the same server with WAMP? Does it have something to with virtual hosts?

1. Why can't I login to MySQL (nor phpMyAdmin) though my password is correct? Is this a known issue with WAMP or Apache?

1. Why is the "W" orange?

1. Can anyone give a complete step-by-step explaining how to run Apache 2.4 and Wampserver side-by-side on Windows 10 without conflicts and errors from WAMPServer?

Any help is appreciated.

Eric "CodeSlayer" Hepperle, Web Developer & WampServer enthusiast
[erichepperle.com]
[github.com]
[stackoverflow.com]



Edited 1 time(s). Last edit at 06/25/2018 11:19PM by codeslayer2010.

Options: ReplyQuote
Re: Issues with Apache 2.4 and WampServer running side-by-side on Windows
Posted by: Otomatic (Moderator)
Date: June 26, 2018 11:01AM

Hi,

I can't answer your question directly.
What I can tell you is that I can run two instances of Apache simultaneously.

Both versions of Wampserver (32 and 64 bit) are installed on my system.
For Apache 64 bit, I changed the default listening port (80) to port 8080, this was done by the tool built into Wampserver :
Right-click -> Tools -> Use a port other than 80

Exit Wampserver 64
Run Wampserver 32 (Which uses the default Apache port 80)

In a command window, opened as administrator, run the command
net start wampapache64
Launch a browser and in the address bar, type: 'http://localhost/'
which will open the Wampserver home page via Apache 32 bit
Open a new tab in the browser, and, in the address bar type:'http://localhost:8080/'.
which will open the Wampserver home page via Apache 64 bit.
You do have two instances of Apache.

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.3 32 bit - Apache 2.4.33 - PHP 7.2.7/7.1.19/7.0.30/5.6.36 - MySQL 5.7.22 - MariaDB 10.3.8
Wampserver 3.1.3 64 bit - Apache 2.4.33 - PHP 7.2.7/7.1.19/7.0.30/5.6.36 - MySQL 5.7.22 - MariaDB 10.3.8
PhPMyAdmin 4.8.2 - 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: Issues with Apache 2.4 and WampServer running side-by-side on Windows
Posted by: RiggsFolly (Moderator)
Date: June 26, 2018 11:30AM

Hi

Running 2 Apache's on the same physical box:

Because all web servers default to using port 80, and only one program can have access to any one port at any one time, if you want to run 2 Apache's or any other mix of web servers, you have to run each one on a different port.
One can run on port 80, but the other must use another port, like 8000 for example.
This can be a bit of a pain, as that means that to access one of them you are going to have to manually add a port number to the url i.e. `mysite.com:8000` or `localhost:8000`

The same limitation applies to MySQL, which by default listens on port 3306. If you want to run 2 MySQL Servers on the same box, one will have to use a different port number.
Again this means your PHP code will have to know which MySQL it wants to talk to, and use the correct port number to ensure its talking to the right MySQL.

Virtual Hosts
There is nothing magical about a VH.
It is a way of getting Apache to run more than one site from a single instance of Apache.
It has some distinct benefits, in that each VH site has its own DocumentRoot defined.

All Apache does when you have Virtual Hosts defined is look at the url of the incoming connection for the ServerName and then server the site from the DocumentRoot as if it was an Apache that served just one site from the `www` or `htdocs` folder.
It is in fact what hosting companies use to allow them to serve 100's of sites from a single Apache server.


Why can't I login to MySQL (nor phpMyAdmin) though my password is correct? Is this a known issue with WAMP or Apache?

Probably because your are not correctly configuring phpMyAdmin.
Remember if you have 2 MySQL Servers you probably have 2 different passwords set for the `root` account.
Again you must configure phpMyAdmin to know there are more than one MySQL Server it may be asked to connect to. Its perfectly possible, and you will find out how when you read the phpMyAdmin documentation.


Why is the "W" orange?
This is a little more difficult to diagnose remotely. But it basically means that one of the services, Apache or MySQL or mariaDB has not started.
As you have 2 MySQL Servers, but dont knwo how you configured them, or even if you are trying to run both at the same time, I cannot be much help.
I can say that as MySQL Server is perfectly capable of running multiple databases and serving connections from multiple bits of software it would make more sense to only have one MySQL Server installed. For no other reason than memory will be an obvious limit when running more than one.



Finally, I would love to know why you think it is necessary to run 2 of everything. Remember WAMPServer is primarily a devlopment environment designed to allow people to learn how to use Apache, MySQL , mariaDB, PHP and not as a LIVE environment. It can be used for that, but on a desktop system other limitation that exist within the Operating System of a desktop OS that dont exist within a Server OS make Windows Desktop OS almost useless for running a busy live server.

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


Sorry, only registered users may post in this forum.