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

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*

Related

ERR_EMPTY_RESPONSE when active mpm_event

I try to activate mpm_eventon my Apache (OS Debian 9 ) and disable mpm_prefork for active http/2 on my site.
But When I do that, my site goes down and shows ERR_EMPTY_RESPONSE on the browser.
The following commands I used to do that:
sudo apt-get install php7.4-fpm
sudo a2enmod proxy_fcgi
sudo a2dismod php7.4
sudo a2enconf php7.4-fpm
sudo a2dismod mpm_prefork
sudo a2enmod mpm_event
sudo service apache2 restart
In the apache log I see just this error:
AH00052: child pid 27520 exit signal Aborted (6)
Is there anyone who knows what should I do to fix that?
I found out that the problem is because of Mod_Ruid2 conflicts with PHP_fpm.
When I disabled Mod_Ruid2 the site was back up and running without any problems.
a2dismod ruid2
The purpose of mod_ruid2 is to allow run of scripts with the users
permission when Apache is using mod_php. In that mode Apache is ran
with root and child processes are being setuid-ed to the proper user
so they can't touch other user files.
The php-fpm is completely different approach. With php-fpm the apache
does not compile php scripts - everything is done by external binary
(called php-fpm). Therefore there is absolutely no need for mod_ruid2
when you are using php-fpm.
https://forum.directadmin.com/threads/php-fpm-and-mod_ruid2-with-php7-1.56552/
https://forum.vestacp.com/viewtopic.php?t=16041

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

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.

Apache server does not show up on EC2 IP

I am trying to install apache2 on my EC2 instance.
I did the following steps:
Launched an Ubuntu 16.4 instance with security group details
http - 80 - anywhere
https - 443 - anywhere
Once I login to my instance I did
sudo apt update
sudo apt install apache2
when I type
service apache2 status
it says that Apache is running
I assumed that after this if I go to my public IP address [xxx.xx.xx.xx] I would see the default apache server page.
But I see This site can't be reached.
The process seems pretty straightforward, what am I doing wrong?
I had this stupid case, it made me reinstall dozens of times.
Maybe my Security groups don't allow https://
Replace https:// with http:// if available.
It will work perfectly.

Why laravel homestead is not running Apache

Obviously, I've Laravel project that really needs the .htaccess rules and Nginx doesn't seem to be the best solution for me,
1- my question is why Laravel didn't provide homestead with Apache!
After a small research that I made I found online tool for converting the rules but the output didn't work (was too short), whereas, Apache is more likely known and usable, plus it's easier to define rules for security and pretty URLs ..etc. ( at least for me )
2- Please give me answers explaining why they choose Nginx!, more importantly I need to know what Seniors and Experts will use ( Nginx, Apache )
3- Do you advise me to install Apache on Homestead?
Laravel homestead is currently able to install apache using your Homestead.yaml file.
Add a key to your sites called type. Set it to apache. like so:
sites:
- map: laravel.local
to: "/home/vagrant/laravel"
type: apache
Make sure you don't mix up apache and nginx, that won't work.
Then run vagrant up and to install apache and provision the right config files.
If it doesn't work, then first make sure to update to the latest version of homestead.
Here is an interesting article on the matter: https://www.nginx.com/blog/nginx-vs-apache-our-view/. TLDR: Nginx is faster.
Only when you have an existing project and you really need to use apache. Or in case your application is going to run on an apache server. Starting fresh? Use nginx.
Steps are as follows here.
SSH into vagrant -> vagrant ssh
Stop Nginx -> sudo service nginx stop
Remove it -> sudo apt-get purge nginx
Update you repos -> sudo apt-get update
Install apache -> sudo apt-get install apache2
Restart it -> sudo service apache2 restart
You are now on Apache server, update the apache conf file as your needs.
What exactly are you trying to do and perhaps we can supply a solution to your problem. You shouldn't really need to be rewriting URLs with .htaccess as Laravel's routing handles this.
1) Regardless of software, if you're needing to configure the webserver for each specific project, its probably better to go and configure your own vagrant box that is relevant for that project.
2) Nginx outperforms apache and reduces a lot of the bloat that simply isn't needed. Its also what forge uses and so homestead uses in turn so its mocking the forge environment.
3) See point 1, configure your own vagrant box for this project.

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/