phpMyAdmin 500 Internal Server Error - apache

today I built a droplet from DigitalOcean, I installed LAMP and phpMyAdmin without any problem. After that for copy my old website to my new droplet, I tried to use ftp. I used vsftpd, created a user for it, changed the ufw permissions little bit, changed some settings from vsftpd.conf and that's all. Now I am trying to access phpmyadmin but
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request....Apache/2.4.18 (Ubuntu) Server at xxx.xx.xxx.xxx Port 80
sudo service apache2 status
OUTPUT:
netstat -ln | grep -E ':80|443'
OUTPUT: tcp6 0 0 :::80 :::* LISTEN

Its hard to diagnose the exact problem from your Error, I would start with:
Check that the server is running correctly (in Ubuntu sudo service apache2 status)
Check Apache is listening on port 80 (in Ubuntu netstat -ln | grep -E ':80|443'
Make sure the phpmyadmin permissions are correct (directory and files usually needs to be owned by the web server user www-data with proper access permissions)
Check the apache virtual host file to see if you have the right Directory configuration (usually phpmyadmin will have sample values in the setup file)
If all of that does not point you in the right direction to fix the issue you will need to start looking through your logs in /var/log/apache2/ and get some more detailed error messages.

Error 500 doesn't mean Apache listening issue. you should open your log file to see what problem occurred. usually, Apache error log is located in this PATH
/var/log/apache2/error.log if you didn't specify a custom log file for your virtual host. append error from the end of file in your question.

Related

MAMP 6.7 won't start on port 80

I just upgraded to MAMP version 6.7, to get php 8, it won't start on port 80 from GUI but it starts from command line with /Applications/MAMP/Library/bin/apachectl start (no error messages). Previous version of MAMP (5.7) was running without any problems).
I do not have any other applikation running on port 80 (did: ps aux | grep httpd ).
I do not get any error message in MAMPs error log.
I can start MAMP Apache server on any other port.
I had deactivated Macs own Apaoche server with:
sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
Installed new version off MAMP, copied over config files for mysql to bin (as I have password for mysql server), configurated phpMyAdmin for http login and no password, chosed php 8.20 in GUI for starting MAMP, checked that port 80 for Apache and 3306 from mysql was configurated, started server.
Edit: It was something about the admin rights on the log files in MAMP/logs (was set to: root as user and admin as group), so I changed permission on apache_error file. to my username (as I i have apache running under it) and read write for group admin, still server do not start.
It is something about the password prompt for the main GUI that not get trigged, I actually want to have that prompt when I start the MAMP servers.
Any ideas?
I upgrade to new version 6.8 of MAMP now who just come out, and that solved the problem, Apache starts and i get the prompt for password when using port 80.
The upgrade process is quite stupid though, IT DID NOT TAKE BACKUP on config files and database, when it wrote the date named backup files for old installation in Applications. Gladly I have strong routine on backup both by hand and in my system setup. So had to copy over config files for mySql (in bin directory) and database directory(in db directory). Need to do this on every new installation of MAMP.
This is stupid MAMP, fix it!

XAMPP 7.2.8-0 Mac Apache web server update/install won't start anymore

I am running MacOS Sierra Version 10.12.6 and I have just tried to upgrade to the latest version of XAMPP on localhost.
I have just upgraded from XAMPP 7.1.10 to 7.2.8-0 by performing an install of the xampp-osx-7.2.8-0-installer.dmg file.
It appears now that I am getting a conflict between AVAST running on port 80
The system was working before running both AVAST and XAMPP 7.1.10 I assume on the default port of 80 but I did not check before the upgrade to 7.2.8
Disabling the AVAST Shields still resulted in processes on port 80
colins-iMac:phpmyadmin colinhart$ sudo lsof -i :80
Password:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
com.avast 29044 root 46u IPv4 0xf605aed3cc5db167 0t0 TCP colins-imac:61319->host213-123-242-66.in-addr.btopenworld.com:http (ESTABLISHED)
com.avast 29044 root 57u IPv4 0xf605aed3d4de9a5f 0t0 TCP colins-imac:61274->64.95.190.66:http (ESTA
and XAMPP also running on Port 80 by default, I have tried changing the port for XAMPP to an available one 80+ to no avail
I am desperate to get this working now as I am unable to develop, so any help would be much appreciated.
I will continue trying to fix the problem by reviewing answers to similar queries.
UPDATE I uninstalled AVAST and installed AVIRA, and yet the Apache Web server still stops soon after Starting
Thanks
Colin
The resolution to the problem having tried virtually all suggestions given by previous answers on this site, was to change the /etc/hosts file as suggested in this response
Unable to start XAMPP Apache server on MacOS-Sierra
To solve this :
Executed following command
sudo -e /etc/hosts
Then, changed following entries
127.0.0.1 localhost
::1 localhost
to
127.0.0.1 localhost MacBook-Pro.local
::1 localhost MacBook-Pro.local
where MacBook-Pro.local is the name returned by hostname command in terminal session
colins-iMac:~ colinhart$ hostname
colins-iMac
colins-iMac:~ colinhart$
in my case the name should be colins-iMac
Many Thanks
Colin
Deleting the lib folder from XAMPP files and reinstalling worked for me
Check this SOF answer

Unable to start httpd on OS X Mavericks

I upgraded to OS X Mavericks and I am trying to start the apache web server
I am using the command
sudo apachectl start
to start the server but I get the following error
(13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
With AMPPS or any other app, you can run it through Terminal:
Start
$ sudo /Applications/AMPPS/apache/bin/apachectl start
Stop
$ sudo /Applications/AMPPS/apache/bin/apachectl stop
had the same thing this morning, out of the blue..
I found that running :
sudo /Applications/AMPPS/apache/bin/apachectl start
at least gave me some info :
AH00544: httpd: bad group name administration
so I typed (in terminal)
groups
to see which groups were available and found that there is no administration group but there is admin group
so I went into httpd.conf and found the user/groups config section and changed accordingly
and -surprise!- apache started!
Here is what u can do.
Make sure the server is turned on with sudo ( root ) but I assume this is going just fine since u are using sudo in your start post.
The other way to solve this is to check in your
/etc/apache2/httpd.conf
And change the listen port from 80 into 8080 or anything greater than 1024
Official Bug Fix is here, so you can manage it from UI.
Also sudo apachectl start/stop is for apache bundled with Mac OS X.
Type the whole path as suggested by Daniel above.
Have a read of this blog post
It sounds like you're not seeing the same "silent terminating" thing, but maybe you have a similar problem, that with Maveriks superfluous "Listen 80" line in another config file will now trip up apache. So check if you have a config file under /etc/apache2/users , and also check VirtualHosts which maybe configured in /etc/apache2/extra/httpd-vhosts.conf (or try temporarily disabling these)
Another service is running on the port 80.
Check the service by execute this command:
sudo lsof -i :80
Stop the service before you run start the apachectl.

How to install two Apache services

I would like two install two different apache2.2 services on a Windows machine. I already have one installed and running on ports 80 and 443. I copied the server installation directory and pasted it some where else. I went into httpd.conf and changed it from Listen 80 to Listen 8000. I also changed the Listen 443 to Listen 8001.
I can install it as a service, but it says there is an error in httpd.conf.
When I try to start the service it says:
make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down
Nowhere in the config file does it say to listen to port 80.
What could cause this?
EDIT
I found that if I changed the config file in the original Apache installation that I copied, it would change the error message.
For example I changed the original config files to listen on ports not in use and the error messages, when I try to start the new Apache service, would go away. However, in task manager it did not show the Service as running but as STOPPED.
I uninstalled the service and re-installed it using the -f flag to point to the correct config file and nothing changed. It seems there must be internal pointers or something that are kept when I copied it?
I also tried installing Apache from a .msi installer and it wont install because I already have an apache installation.
SECOND EDIT
Wish I would have seen this earlier. According to Using Apache HTTP Server on Microsoft Windows I may need to build Apache from source.
Note that you cannot install two versions of Apache 2.3 on the same computer with the binary installer. You can, however, install a version of the 1.3 series and a version of the 2.3 series on the same computer without problems. If you need to have two different 2.3 versions on the same computer, you have to compile and install Apache from the source.
I have never done something like this could some one perhaps explain this a little more clearly?
The solution was going into the original Apache install directory and running:
C:\original-apache-install\bin> httpd -k install -n "new service name" -f "new/config/file/location"
Just copying the installation and pasting somewhere else kept ties to the original config file and did not let me change what it pointed to. When I ran the above command in the new install directory it did not work. Example:
C:\new-pasted-apache\bin> httpd -k install -n "new service name" -f "new/config/file/location"
I successfully installed two different 2.4.x versions of apache by installing both services separately with the command that was already mentioned:
C:\Apache2.4.23> httpd -k install -n "Apache2.4.23" -f "C:/Apache2.4.23/conf/httpd.conf"
C:\Apache2.4.12\bin> httpd -k install -n "Apache2.4.12" -f "C:/Apache2.4.12/conf/httpd.conf"
When i checked both services in the "Services" interfaces of windows i noticed that the seconds service had the same executable path as the first installed service. I fixed that by editing the service via regedit (since the sc command did not accept the parameter "-k runservice" that is appended to the executable path):
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
See: https://superuser.com/questions/222238/how-to-change-path-to-executable-for-a-windows-service/252850#252850

Why does running "apachectl -k start" not work, but "sudo apachectl -k start" does?

I'm working on my OS X with the default installation of Apache. For some reason, when I run the "apachectl" command without the "sudo" I get "no listening sockets available / unable to open logs." I'm guessing this is a permissioning thing, so can someone help me out? I'm using Apache 2.2.
Also, side question, where the the Apache script file that is basically the "exe" that linux executes? I'm trying to intergrate my server with Aptana Studio, and it requires the path to the Apache install. I know in Windows, this would be "C:\path\to\httpd.exe", but I don't know how this works in linux.
Is your server listening on port 80? (Usually) only root is allowed to open ports below 1024. Hence the need for sudo.
As you can see, lots of people wonder how to get around this. One possible solution is to perform port-forwarding on your router. (I'm assuming here that you are behind a router...). Then incoming connections on port 80 can be forwarded to e.g. port 8080. Thus only locally does one need to connect to port 8080. (There may be more elegant solutions... somebody else will post them.)
I think generally (on both OS X and Linux - I'm not sure which one you're referring to) the httpd binary is located at: /usr/sbin/httpd
If you need to be able to restart Apache, and you can't do so as root (for whatever reason..), then you may have to settle for a non 'well known' port.
try this
(with php)
$a = shell_exec('sudo -u root -S /etc/init.d/apache2 restart < /home/$user/passfile');
password should stored in passfile