Error:
root@ip-112-21-1-80:/opt/lampp# sudo /opt/lampp/lampp stop
Stopping XAMPP for Linux 8.2.4-0…
XAMPP: Stopping Apache…not running.
XAMPP: Stopping MySQL…ok.
XAMPP: Stopping ProFTPD…ok.
Solution:
The error message you’re seeing indicates that there’s already a web server running on the ports that XAMPP’s Apache server is trying to use (typically port 80 for HTTP and port 443 for HTTPS). This conflict prevents Apache from starting. Here’s how you can resolve this issue:
1. Identify the Process Using the Ports
First, you need to find out which process is using the ports that Apache needs. You can do this by using the netstat
command in the terminal.
Open your terminal and run:
sudo netstat -tulpn | grep ':80\|:443'
This command will show you any processes that are using ports 80 and 443. Look for the PID (Process ID) in the output.
2. Stop the Conflicting Process
Once you’ve identified the process, you can stop it. This might be another instance of Apache, nginx, or some other service.
- If the process is another web server like nginx, you can stop it using:bashCopy code
sudo systemctl stop nginx
- If it’s another instance of Apache, you can stop it using:bashCopy code
sudo systemctl stop apache2
sudo kill -9 <PID>
3. Restart XAMPP’s Apache Server
After stopping the conflicting process, try starting XAMPP’s Apache again:
sudo /opt/lampp/lampp restart
4. Check Apache Status
You can check if Apache has started successfully by using:
sudo /opt/lampp/lampp status
5. Configure XAMPP to Use Different Ports (Optional
If you need to run another web server alongside XAMPP’s Apache, you can configure Apache to use different ports.
- Edit the
httpd.conf
file, which is usually located in/opt/lampp/etc/httpd.conf
. - Look for lines that say
Listen 80
and change 80 to another port number, e.g.,Listen 8080
. - Also, change the port in the SSL configuration file (
httpd-ssl.conf
), usually located in the same directory, fromListen 443
to something likeListen 8443
. - Save the changes and restart XAMPP.
After making these changes, Apache in XAMPP should start without conflicting with the other web server.