How to Configure PgAdmin4 to Use Apache2 from LAMPP? - apache

I installed LAMPP on my Ubuntu 20.04 machine. I also installed PgAdmin4 to work with my Postgresql 14. The problem is, both LAMPP and PgAdmin4 installation came with their own Apache2. This cause error for me, as in the development process, I use 127.0.0.1/pgadmin4 and localhost/ at browser interchangeably.
For now, each time I need to edit psql database in PgAdmin4, I need to turn off LAMPP using sudo /opt/lampp/lampp stop command and to turn on pgAdmin4 with sudo /etc/init.d/apache2 start. And vice-versa if I need to test the website output in LAMPP localhost.
Is there any way around them? How to configure pgAdmin4 to use Apache2 from LAMPP? Or to Install pgAdmin4 without the packaged Apache2?
I already tried using PhpPgAdmin 7 instead, but it keeps getting error.

Related

macOS Sierra 10.12.2 Apache not working

I've upgraded to the current version of macOS. I want to work with Apache. Well, my problem is, that when I try to access localhost with or without ~Username, I get an error message saying ERR_CONNECTION_REFUSED on Chrome or "Can't open Page" on Safari. Apache is running and apachectl configtest says "Syntax OK".
I placed the current version of phpMyAdmin into /Library/WebServer/Documents and tried to access it, same problem.
I followed the steps in this guide without a solution for me
Apache localhost/~username/ not working
So does anyone know what problem I'm facing? I'm clueless right now.
I had the same outcomes as above, using virtual hosts though, and after updating to macos 10.12.2 was receiving ERR_CONNECTION_REFUSED.
My original setup is based on the excellent posts here: https://getgrav.org/blog/macos-sierra-apache-mysql-vhost-apc
And as such, because I'm using Homebrew, all I needed to do was also run brew upgrade on CLI followed by sudo apachectl restart and I'm back up and running.

Ubuntu 16.04 Apache2 PHP7.0 doesn't interpret php commands

I searched the web and found that many people have issues with php7 on Ubuntu 16.04 but I have a slightly different experience.
Problem in short: I upgraded from 12.04 to (first to 14.04) 16.04 and now everything works except Apache2 with PHP7.
The problem: When I create php file like
Hello
<?
echo " World!";
?>
and access it through the browser, the browser renders the "Hello" but not the "World". So basically Apache knows that it's a php file (otherwise the file would be downloaded instead of shown) but doesnt interpret it.
Oh and it doesn't show the php code either (this is what's different in my problem compared to other asked questions).
I had PHP7 installed from a different ppa (ondrej) before but that also didn't work. I completely removed all the packages and PPAs from my sources and now I have only my Ubuntu sources left, I also completely purged all php and apache related packages, including any config under /etc/apache2 and /etc/php. This includes:
php*
php7.0*
libapache2-mod-php7.0
libapache2-mod-php
apache2*
I even removed the apt cache with apt-get clean and apt-get autoclean.
After I purged everything I reinstalled apache and php via
apt install apache2 libapache2-mod-php7.0 php7.0
I checked the mods enabled, php7.0 is enabled, restarted apache, even restarted the whole machine just to be sure but I can't get it to work.
Please don't tell me to reinstall Ubuntu because I want to understand what the problem is instead of just taking the easy way out, also everything else runs fine and I really, really don't want to reinstall all other software again since this is my development machine.
Is there any config file I have overlooked? I mean I completely purged the packages and the configs. /etc/apache2 and /etc/php were properly deleted after the purge.
Oh and also strange: Since the Update I cannot access files without the file extension. Before http://localhost/info would bring me to http://localhost/info.php automatically. Any hints?

change server selection after installing phpmyadmin

After reading a bit I installed phpmyadmin on an Ubuntu server (14.04) with
sudo apt-get install phpmyadmin
In the installation configuration screens I was asked whether I wanted to use apache2 or lighttpd servers. I selected lighttpd and the installation went on smoothly. I noticed that it still (aparently) installed apache2 server.
Now, reading more on the topic, I feel more confortable if I could use phpmyadmin on apache2 server instead of on lighttpd. Is there a way to change this selection now, without uninstalling and reinstalling again?
There are two possibilities about being prompted for a webserver to use; before apt-get downloads any files it resolves conflicts and installs dependencies -- if you don't have a webserver installed it will prompt you to install one (or do so automatically). The other time it asks you about which webserver to use is after downloading and during configuration; if you have more than one webserver installed, you're prompted for which you want to work with phpMyAdmin. You can pick more than one here, by the way.
To configure phpMyAdmin to work with Apache instead, you can use:
sudo dpkg-reconfigure -plow phpmyadmin

Why does apache2.2 keeps installing instead of apache2.4?

I've been trying to set Vagrant up for local development on my machine. I see from Apache's official website that 2.4.7 is the current stable version. And I had no issues installing it on my VPS. But with Vagrant it's a different story. I'm trying with both Base64 and Base32 boxes. This is the command i'm running:
sudo apt-get install -y apache2
It should install apache 2.4.x. But it doesn't. Sometimes it installs version 2.2, sometimes 2.4. This is driving me nuts, since the whole idea of using Vagrant is to have the same Virtual machine replicated everywhere. Any ideas?
Because the Debian based distro (possibly Ubuntu) you're using is still using 2.2.x. Switching to 2.4.x from 2.2.x means all the 3rd party modules they ship have to be upgraded (or at least rebuilt) so they probably haven't made the switch yet.

Apache Web Development on Cygwin

I'm trying to get an Apache server running on my Cygwin setup to follow the Java Ranch Cattle Drive tutorials online (basically, to learn Java EE web page development that uses a MySQL back end.)
I used the Cygwin Setup program to install httpd (which is how I installed most other dev tools I use on cygwin) and it says install complete, yet when I run 'httpd' it cannot find the command. It also appears the expected install directory (/usr/local/apache...) doesn't exist.
Does anyone have any experience using this setup, and if so, you could walk me through the initial steps of getting the server up and running and getting a browser to display the server's default page?
To keep answers focused, I didn't want to discus the drawbacks of running Apache on a Windows system - this is just for learning purposes. Thanks in advance.
Looking at the Cygwin Package Listing for httpd, you can see that the executable is installed under /usr/sbin.
So, if /usr/sbin is not on your PATH (it isn't on mine, not by default anyhow), you would actually run:
/usr/sbin/httpd
And btw, if you would like to list the files installed for a certain package, you can use cygcheck:
cygcheck -l httpd
cygrunsrv -I Apache -p /usr/sbin/httpd -a "-X"
This will solve the problem. This assumes you already have cyrunsrv set up. The reason httpd fails with cygrunsrv if you leave out the -X is that the process disconnects from the terminal and cygrunsrv considers that a failure. The -X option for httpd is the debug or terminal mode.
I couldn't find any detailed information on how to get Apache working on Cygwin, so here it is if someone's interested:
Install the httpd-* and httpd-mod_* packages you need. Note that the packages named "Apache" are deprecated. You need the ones named "httpd" (which are actually Apache).
Install cygrunsrv (normally this is a default Cygwin package)
Run /usr/bin/cygserver-config as admin. This is needed because Apache requires an IPC server running.
Open services.msc, then go to the CYGWIN Cygserver. Right-click on it and start it. If you don't do this, you'll probably get errors like "AH00023: Couldn't create the proxy mutex".
Finally, start Apache by running /usr/sbin/apachectl restart
Config is in /etc/httpd/.
Some information about running Apache on Cygwin:
http://httpd.apache.org/docs/1.3/cygwin.html
http://www.issociate.de/board/goto/895433/apache2_does_not_start_in_cygwin.html
http://www.cygwin.com/ml/cygwin-apps/2005-02/msg00085.html
Personally, I would recommend installing WAMPServer or other WAMP stack and do it that way. There is no difference, except that you'll need to control Apache through Windows commands [net start, net stop], not Cygwin's ones.