Brew Install Httpd: Welcome to Nginx? - apache

I'm trying to install the brew package httpd (apache). I'm so confused. Every time I do and navigate to http://localhost:8080 I get a big welcome screen that says "Welcome to Nginx." I don't understand.
Am I running nginx and not apache? How could that be?
I'm on macOS 10.15.6.
I'm running pretty basic commands...
brew install openldap libiconv
sudo apachectl stop
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
brew install httpd
sudo brew services start httpd
And then I get get this...
https://www.dropbox.com/s/yia1yk9uhsootpk/Screen%20Shot%202020-09-18%20at%208.53.39%20PM.png?dl=0
"Welcome to nginx"
What don't I know? A lot probably. If I edit the httpd.conf file to listen to another port, I get the same screen.
╰─ brew list
apr gettext jemalloc libidn2 node powerlevel9k
apr-util httpd libev libunistring openldap wget
brotli icu4c libevent ncurses openssl#1.1 zsh
c-ares jansson libiconv nghttp2 pcre zsh-completions
Can anyone shed some light on this for me?
Update:
lsof -i :8080
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Brave\x20 1225 user 35u IPv6 0xcdbe6ccead8e5deb 0t0 TCP localhost:53261->localhost:http-alt (CLOSE_WAIT)

I think I narrowed it down to "groonga." First I'm hearing of it, but apparently it's a mariadb brew dependency. I found where the "welcome to nginx" text was coming from.
var/www/index.html
Not sure why it's hard coding that text if it will also display with apache running. Very confusing. However, it adds that file to the default apache DocumentRoot.

Had a similar issue to this, discovered the fact that generic start file at usr/local/var/www/index.html, had been hard-coded to contain the "Welcome to nginx" when I installed nginx and
the message remained that way even I uninstalled it. The Apache (httpd) service also happens calls that index.html file upon startup which makes it appear as if it were nginx rendering that file.
Not too sure why nginx doesn't automatically empty the file upon uninstallation but just manually change/remove the contents of that file after uninstalling nginx and your problem should be fixed :)
Similar problem also addressed here: nginx uninstalled, localhost:8080 still showing nginx welcome page

Related

How to install mod_wsgi for apache2.4 with python 3.6 in centos?

I am a new to web development.I have created Django(-v 2.2) web application and I want to deploy it on my linux server(OS Centos).After installation apache2, when I was going to install libapache2-mod-wsgi-py3, it says that no package available. Is there different name for libapache2-mod-wsgi-py3 for OS Centos?
It is always recommended to install mod_wsgi directly into the python3 package using pip3.
pip3 install mod_wsgi
If you install mod_wsgi into the OS, it could cause conflict and unexpected behavior.
Do you have apache2-dev installed?
Also, for mod_wsgi it is better to go the CMMI path (configure-make-make install) in order to compile it with the correct version and load it in Apache as a module. This worked for me on Debian VPS:
To do so,
wget https://github.com/GrahamDumpleton/mod_wsgi/archive/4.6.5.tar.gz
tar xvfz 4.6.5.tar.gz
cd mod_wsgi-4.6.5
whereis apxs
whereis python3
./configure --with-apxs=/usr/bin/apxs --with-python=/usr/bin/python3.5
make
sudo make install
Double check the path for apxs and python, and run make install as sudo.
When it’s all ready, check the last line of prompt results, as there will be a path to a file: /usr/lib/apache2/modules/mod_wsgi.so
To cleanup after installation, run:
make clean
If you need to build the module for a different version of Apache, you should run:
make distclean
If you have a httpd.conf file, you should edit and add this line:
LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so
If not, create it and paste that line, and edit /etc/apache2/apache2.conf. file, by adding this line:
Include /etc/apache2/httpd.conf
You don't need that file to configure apache, but you can create it if other software relies on it being there.
You should restart Apache and check the log
sudo tail /var/log/apache2/error.log
as there should be a line that says:
Apache/2.4.25 (Debian) mod_wsgi/4.6.5 Python/3.5 configured -- resuming normal operations

Why localhost's phpmyadmin is empty with no login window?

I installed phpmyadmin following the instructions here. Installation has completed and I have phpmyadmin inside /usr/share/phpmyadmin and has linked to
sudo ln -s /usr/share/phpmyadmin/ /var/www/html/phpmyadmin
But doesn't show anything (the whole page is blank with no login window) when I access to http://localhost/phpmyadmin
What could be wrong?
My os is Ubuntu14.04 and installed Apache 2.4.7.
For those who has similar problem, please follow the steps below.
Please check error at /var/log/apache2/error.log
My error is PHP Fatal error: require_once(): Failed opening required './libraries/php-gettext/gettext.inc' (include_path='.')
So install sudo apt-get install php-gettext
Then restart sudo service apache2 restart.

Apache is viewing php files as texts

After I updated to php7.0 now it's viewing the files, I firstly thought it was in apache itself, but i have reinstalled it, what could be the problem..?
ubuntu 15.04
Install PHP 7 and the Apache PHP module as follows:
apt-get -y install php7.0 libapache2-mod-php7.0
Then restart Apache:
service apache2 restart
Another possible reason could be short open tag. Configure php.ini files related line as: short_open_tag = On and restart php service.

Installing Cobbler on Ubuntu 15.10 seems to break apache, how can I fix this?

I am trying to install Cobbler on a brand new Ubuntu 15.10 virtual box but it is not working. When I run the apt-get install cobbler cobbler-web it seems to break apache completely to the point I can't get it working again.
I see this in the apache error log:
[wsgi:crit] [pid 8112:tid 140273573488512] mod_wsgi (pid=8112): The mod_python module can not be used on conjunction with mod_wsgi 4.0+. Remove the mod_python module from the Apache configuration.
and this in the auth.log:
polkitd(authority=local): Unregistered Authentication Agent for unix-process:8081:54865 (system bus name :1.24, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
I have tried removing the mod_python and wsgi modules but apache still doesn't start up. And I think Cobbler uses them anyways, so I kind of need them.
I have also tried disabling polkitd. I don't find any clues when searching for that weird error message.
I was able to install Cobbler on Ubuntu 14.04 pretty easily and apache works fine.
Here is the basic chain of install commands I used:
apt-get update
apt-get install apache2
apt-get install isc-dhcp-server
apt-get install bind9 bind9utils bind9-doc
apt-get install cobbler cobbler-web debmirror mkisofs
Disable the module by typing sudo a2dismod python
You should then see this:
Module python disabled. To activate the new configuration, you need to
run: service apache2 restart
So type sudo service apache2 restart.
If that doesn't fix it, check the error log for more information by typing
cat /var/log/apache2/error.log.

Apache Command Line Not Functioning

Installed Apache Ver 2.2.3 on my vps with Centos 5.6 but when I try the a2dismod and a2enmod got Command not found error.
What can I do to fix it?
Thank you
This is my first vps and this is also my first experience with linux and centos.
The server is running fine just need to disable few modules.
On CentOS there are no a2enmod and a2dismod commands. To disable unneeded modules in Apache, you need to carry out steps as described at the lower end of – for instance – this post: http://www.cyberciti.biz/faq/howto-disable-apache-modules-under-linux-unix/
Perhaps those commands were not in your path? If the programs are in your current working directory, try ./a2dismod.
To see what path our shell is searching, try echo $PATH.