How can "localhost" give an answer when apache2 is not installed? - apache

My apache2 configuration is driving me crazy, and since I'm new to Linux/Ubuntu (16.04) and servers, I've been trying to install/remove lamp (and also xampp, and also phpmyadmin) a great number of times now, with several methods... without much results.
However, my current configuration is :
mysql-server is installed, and I can connect with 'mysql -u root -p'
phpmyadmin : I have tried to reinstall it, but there was a problem with apache2 (could not reload it or something... I haven't figured it yet)
php7 is installed and has been working until my server has crashed (I haven't tried to remove it)
apache2 : I used to have a lamp configuration + XAMPP (lampp in /opt/), but since there has been a problem, I uninstalled XAMPP and recently I also unistalled apache2 (sudo apt-get purge apache2, sudo apt-get autoremove, sudo apt-get clean and I verified that the configuration files have been deleted).
When I still had apache2, I finally had this problem : when opening "localhost" on Firefox, it was showing :
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /
on this server.<br>
</p>
<p>Additionally, a 403 Forbidden
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>
My main question for this post now :
Since I have deleted Apache2, "localhost" should not be working at all now on my browser (Firefox)... However, I still get the exact same page ?! Do you know why / can help me ?
Thanks a lot in advance to all who can help me, either to understand my problem better (so that I know a bit more where/how to search for answers), or to solve my problem (and help me work on my website again ^^) !

Have you already stopped Apache via systemctl? Something like sudo service stop apache2 (or is it sudo service apache2 stop), will stop the server from running. Even though you have uninstalled everything, the server process will still run if you haven't stopped it.

Related

M1 BigSur httpd error LaunchAgents/homebrew.mxcl.httpd.plist

I am a bit confused that Apache httpd.conf not in the /usr/local/etc/ anymore, because there is no visible etc/ folder in the local. It's being empty. So did a bit search and found the a httpd.conf in the /etc/apache2/httpd.conf not very sure it is the right file, because it looks bit different. Anyway the below issue started after loading brew install httpd
httpd error LaunchAgents/homebrew.mxcl.httpd.plist
when I use the command brew services start httpd it gives the message of ==> Successfully started httpd (label: homebrew.mxcl.httpd) but when I check the services list I see the httpd error. And when I try to reach localhost I see It works message but when I refresh the page no more It works message and I only see the localhost refused to connect.
what is the correct way to install and run the apache?

Wondering - "sudo ufw app list" still show apache after removal

I thought i had completly remove Apache from my server, until this morning where i could see, this sudo ufw app list
ALlready many posts here on how to remove apache etc... and everything works fine.
I'm just wondering why Apache still shown here ?
sudo ufw app list lists every app profile that you've made on the firewall. Although you uninstalled apache its profile on the firewall still exists.
If you'd like to remove it try
sudo rm -R /etc/ufw/applications.d/apache2*

How do you remove SSL encryption after letsencrypt set up forced SSL?

I chose to force https on my server when setting up let's encrypt, not realizing what a NIGHTMARE it would cause for my Node.js WebSocket server. Nothing that I've found online works to get a secure WebSocket connection up and running. (Probably because I'm using Apache for everything aside from WebSockets)
So I've decided to just disable SSL site-wide. I don't have any real use for it as my server is strictly for development anyway.
I've tried the method here But Apache reports that the site is already disabled. So I cleared the cache on my browser and even tried to visit the site incognito to no avail.
I also looked at the instructions here but NONE of my site-available contain the lines that are mentioned.
Then I saw this post but my apache2.conf file did not contain the lines he mentioned either.
I'm puling my hair out.
If anyone else has this issue, here's what I did to solve it.
I saw a configuration file named <sitenam>-le-ssl.conf in /etc/apache2/sites-enabled So I tried a2dissite <sitename>-le-ssl.conf
But Apache said "the file doesn't exist"
So I copied that file to my home directory with cp <sitename>-le-ssl.conf ~(AND YOU SHOULD TOO! just in case...)
Then I deleted that file with sudo rm <sitename>-le-ssl.conf
Then, restart apache with sudo service apache2 restart
Finally, clear the cache on your browser and visit your site. Everything should be back to normal now.
No idea why letsencrypt set up my server in such an odd way. It didn't follow ANY of the standards that others said it should.
Hope this helps someone in the future.

XAMPP Access Forbidden [ubuntu]

Yesterday I was able to completely normally use PHP and phpmyadmin with XAMPP and make apps. The only thing changed is that I restarted the computer. Now I start lampp like always
sudo /opt/lampp/lampp start
and I get
XAMPP: Starting Apache...fail.
XAMPP: Another web server is already running.
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.
Maybe the apache is the problem I don't know. But when I open localhost in browser, I get
Forbidden
You don't have permission to access / on this server.
Apache/2.4.7 (Ubuntu) Server at localhost Port 80
I added 'Require all granted' to that httpd.conf file, and it didn't help, so something else must be going on. I tried a lot of other threads on forums, nothing helped.
Ideas?
Thanks
It could be possibly because another instance of Apache is running on your system. Just try to close all intances via sudo killall -9 apache2 and then try to start/restart the LAMPP.
Most linux OS ships Apache as default server, so if you even haven't installed them, they might be running in your system.

Apache is running but not working

I am running a huge php-application on an ubuntu server, using apache2, php5, mysql.
Sometimes (approx. once a month) the page ist not reachable from the internet ("it's down").
The weird thing is, that service apache2 status says that apache is running.
The solution is always to restart apache using service apache2 restart and everything works fine again.
The server load is at a minimum and can't be part of the problem (I guess).
I know, this description is not as detailed as it should be, but I do not have more information.
Any suggestions about what could cause this problem are appreciated!
Disable Firewall or Antivirus and try again.
Change /etc/apache2/apache2.conf => change all AllowOverride all,
and make sure that /etc/apache2/sites-available/000.default.conf => verify the path of the Directory that you access.
assign the necessary permissions of the webroot directory for the domain.
chmod -R 755 /var/www/html/