XAMPP Server using Multiple ports instead port 80 - php

XAMPP server should run on port : 80 by default, but here in our case XAMPP server running on multiple ports shown in the span short below.
Why it happens and how to prevent this?
Also TaskMgr shows two apache services running:
XAMPP httpd.conf file is here:
After running 2 or 3 hours XAMPP server, Server got slow and not responding where I think the problem would be generated by the multiple open ports?
Any idea? how to block and allow only port 80 as it is already by default?

it's mostly because of internal connections between apache and another service on the server.
for example it could be because connecting to 3306 (mysql)
to find out that you can use netstat button on the right of the xampp panel
or type this command in command prompt (DOS)
netstat -na
e.g: if you saw lots of :3306 it means that you did not close mysql connection!

Related

Docker Mysql+PHP [Port mismatch issue with terminal & PHP Application]

I have written a new docker-compose file for MySQL & PHP connection
From MySQL:
Port exposing 3315:3306
From PHP:
To access a MySQL from PHP server, I have added line docker-compose.yml links as 'mysql' service name
Port exposing 30005:80
My Folder structure & file [Image-1]
This is command, which I used to run the docker
docker-composer --build up
My running containers list [Image-2]
This is how I'm accessing in terminal [Image-3]
The Result of the PHP script is [Image-4]
My problem to this configuration is, when you noticed the index.php file from the Image-1.
i have used port as 3306 to connect a mysql, but when you refer the Image-3. To connect a mysql in terminal, i have used port as 3315
Issue on this, Why i need to use 3306 as port in PHP application to MySQL server, instead of using mysql(In docker-compose.yml file) exposed port 3315.
In terminal, i can able to access correctly, but when we go for application i have this problem.
Someone can help me to understand the port mismatch in application & terminal for a MySQL connect.
Thanks in advance
All your containers are in one isolated network. Mysql service has hostname - mysql and listens to port 3306.
The host machine listens to port 3315 and forwards packets into that network on port 3306.

Why orientDB connection to localhost of docker is refused

I did build orientDB and appserver on docker. They are running as well. This is list containers on docker:
core#localhost ~ $ docker ps
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS
NAMES
01abef0204a7 fxrialab/appserver:latest /usr/sbin/httpd -D F 30 minute
s ago Up 30 minutes 0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp
appserver
f6d0631bb092 fxrialab/orient:latest /bin/sh -c cd /opt/o 30 minute
s ago Up 30 minutes 0.0.0.0:2424->2424/tcp, 0.0.0.0:2480->2480/tcp
appserver/db,orient
ebc1386250b9 fxrialab/data:latest /usr/sbin/sshd -D 30 minute
s ago Up 30 minutes 0.0.0.0:2200->22/tcp
data
Also i did create database on orientDB. I think orient is working fine. However when i login to my website. I got errors "Connection refused" like this:
Socket error #111: Connection refused
• vendors/OrientDB/OrientDB.php:254
OrientDBSocket->__construct('localhost','2424',30)
• apps/models/DB.php:11 OrientDB->__construct('localhost','2424')
I dont know what reason althought i did test fine on local when i enabled server.bat file. Ah, i using orientdb-1.7
Thank for advance !
localhost is a synonim for ip address 127.0.0.1
your binds are for 0.0.0.0
I am not familiar with OrientDB, but I believe that what you are facing is ports access problem (server configuration), not software problem (in this case software is OrientDB). Most servers are configured to block all ports, unless specifically allowed - for security reasons, so that noone can connect to the server on those blocked ports.
So, what is probably happening is that your local server is fine with using those ports, and remote server is secured and thus prevents connections.
Docker is running a virtual machine with separate network interface for each containers. Thus if your appserver connects to localhost, it won't see the orientdb.
You need to update your configuration to lookup the proper environment variable for the link (see http://docs.docker.com/userguide/dockerlinks/) or just use the db host. Docker injects a hostname into /etc/hosts for each linked container.
I've found cause of this issue, because im config HOST to connect is wrong. It's not localhost because docker uses its own internal IP's. In ssh type docker inspect orient then use global variables for config to access to IP & Port.

apache and mysql ports

I am installing an open source software, which is `vtiger, and that use mysql and php
The first screen in installing that software asks for mysql and apache code,
the installation tools set these values as:
apache port 8888
and mysql port 33307
but when I open my xampp I see different ports like this:
Should I change the values of these ports to the values that I see in the image or not?
Thanks in advance
edit
this is what the installation tool suggest
so should I replace the 8888 with the 8082
and should I replace the 33307 with 3306 ?
Mysql's default port is 3306, and your XAMPP control panel shows that's the one in use, so you don't need to touch anything here.
As per apache webserver, the default http port is 80, which in this case you could access with
http://localhost
but you can use pretty much whatever you want as long as you append the port number to the url
http://localhost:8082
http://localhost:8082/anotherpage.html
Your Apache webserver is listening to both 4430 and 8082. I wonder if http://localhost:4430 would try to open as https, but I believe that is irrelevant at this point.
Long story short: if you aren't planning to use any other app on port 80, just set Apache to listen to port 80 to forget about appending port numbers on your urls.

#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)

I can't access to PHPMyAdmin. when i want to go there, i got this error:
#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)
I googled this error but it don't clear.
I try to know that which port is open by this code :
pgrep mysql
two ports are open when mysql is running.
I want to access to PHPMyAdmin in my localhost. I am using Ubuntu OS
In Ubuntu, by default mysql is not listening to TCP/IP connections. It just uses a local socket.
The current local socket is configured in /etc/mysql/my.cnf . If you open this file, you should find something similar to:
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
What you should do is just to open PHPMyAdmin's config file (config.inc.php) and change the socket address. Maybe there's no local socket configuration on your PHPMyAdmin, or maybe it is different. This file should contain a line like (of course, adapt the address to what you found on my.cnf):
$cfg['Servers'][$i]['socket'] = '/var/run/mysqld/mysqld.sock';
Steps just to run the mysql server after crash.
** Worked on wamp server **
Check the {System name}.err file inside your mysql data directory.
From the log find out the databases causing issues
Cut them out from the data directory (keep in some safe places).
Start mysql service
go to C:\Windows\System32\drivers\etc edit host add 127.0.0.1 localhost
and restart server refrance check ans
This means that mysql server is not started.
This is very simply if you are using wamp left click the wampserver icon then mysql then services then install service after that restart wamp and the problem is solved

Wamp stopped working after vmware installation.

I have wamp running fine with 2 virtual hosts. But after installation of vmaware wamp server not starting. Any idea about this problem? Or how can i figure what make wamp not starting, does it store its error log somewhere?
I am using widows 7.
Thanks
It is possible that WMWare uses the same port as WAMP. I remember Skype doing this resulting in APACHE being unable to start the servers on its port.
You can use this tutorial to try and change the vSphere port from it's 80 default:
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1021199
LE: There could be some other WMWare component that uses the 80 port. Try closing all WMWare components and start WAMP. If it works, then WMWare is using the 80 port.
Most probably the 2 fight over the same port (80). Also, Skype might cause WAMP to fail at starting and to display "304" errors for every GET request on the server.
Change WAMP's listening port from \wamp\bin\apache\apache2.2.8\conf. Locate httpd.conf, open it with a text editor and search for listening. Change to whatever port you consider.

Categories