Local site not running under MAMP after Yosemite upgrade - apache

I just upgraded to Yosemite and noticing problems with MAMP. I was running Piwik locally (port 7788) before the upgrade, and it worked perfectly. Now, however, when I start MAMP I just get a 500 Internal Server Error.
Some searching around suggested that one issue was that MAMP was using Port 8888 for Apache and 8889 for MySQL, whereas they should now be changed to Port 80 and 3306 respectively (the default ones for those apps). This didn't change anything for me though.
I also read it could be an issue around PHP and a suggestion was to go to \etc\apache2\httpd.conf and uncomment the line LoadModule php5_module libexec/apache2/libphp5.so, again this did nothing.
I don't know enough about Apache2/MySQL/PHP to trawl through them and figure anything out so I'm hoping someone here can suggest how I go about correcting this.

MAMP will use it's own version of Apache2 so you will need to change the settings/ uncomment the modules in that httpd.conf file.
/etc/apache2/ is the default server preinstalled on the machine, which is different to MAMP's
Try looking for it here: Applications ▸ MAMP ▸ conf ▸ apache

Related

AMPPS for Mac, local vhosts now no longer working

AMPPS 3.9 64-bit for Mac is working fine on MacOS 10.15.2.
I created some .local vhosts in /Applications/Ampps/Apache/conf/extra/httpd-vhosts.conf, and added the domains to /etc/hosts.
All was running well, I had about 5 different .local vhosts up and running fine.
On 1 .local website, after running WP Migrate DB Pro pulling a remote db down into the local site, every .local vhost has failed to load, producing ERR_CONNECTION_TIMED_OUT.
Restarting Apache has not resolved the issue.
I've double checked /etc/hosts/ & httpd-vhosts.conf and they both look fine.
I've tried Restore Config in the AMPPS control panel with no success. Rebooted with no success.
http://localhost/phpmyadmin opens fine.
Help and troubleshooting advice appreciated.
I found the local IP address had changed somehow, after running WP Migrate DB Pro.
Updating the hosts file with the new IP address has fixed the problem.

localhost refused to connect - MAMP Pro

There seem to be a few questions that are similar but could not find the answer.
An hour ago (and the months before that :-)) everything was working fine. It looks like after updating to XCode 9.2 things stopped working.
I've justed updated to MacOS High Sierra 10.13.2 as there were some Apache updates included, but it didn't solve the issue. Maybe the XCode update changed something to the httpd.conf file? I'm not too familiar with the settings in there, so I'm unable to determine if something changed in that file.
Error in Chrome:
This site can’t be reached
www.example.dev refused to connect.
ERR_CONNECTION_REFUSED
My setup:
MacOS High Sierra 10.13.2
MAMP Pro 4.2 (latest version)
Ports are Apache: 80 and MySQL: 3306
VPN is off
If I run sudo nano /private/etc/hosts it has the following entries (I run my local website on www.example.dev)
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
127.0.0.1 www.example.dev # Note; I added this myself a long time ago as else the URL including www doesn't work
127.0.0.1 example.dev # MAMP PRO - Do NOT remove this entry!
::1 example.dev # MAMP PRO - Do NOT remove this entry!
What I tried:
Changing ports to default MAMP ports (Apache: 8888 and MySQL: 8889). No luck
If I run apachectl configtest in terminal it returns Syntax OK
UPDATE
Just saw that if MAMP Pro is off:
It still gives the same error in Chrome
It still returns Syntax OK with apachectl configtest
When I run sudo apachectl stop it returns /System/Library/LaunchDaemons/org.apache.httpd.plist: Could not find specified service
UPDATE 2
Out of frustration I downloaded Firefox to check and... all my local dev sites work there! In Chrome I still get the same error, even after clearing browsing data.
Turns out, Chrome (and Safari as well) were redirecting to https, so https://www.example.dev. And the problem was the .dev TLD.
If you run into the same problem (force forward by Chrome to https) and:
You DON'T use .dev, read this post for possible solutions
You DO use .dev as your local TLD, you need to change it to something else. Chrome redirects .dev TLDs to https since version 63. See this article and your best alternative TLDs here.

XAMPP 1.7.7 - Apache won't start (ports already changed)

I installed XAMPP 1.7.7 for testing on the old php version. Current XAMPP is running fine. I changed the ports in httpd.conf from 80 to 8081, and in httpd-ssl.conf from 443 to 4434.
Still, when trying to start apache, I get the error
"error: apache was stopped unexpected. This might be caused by a blocked port, missing dependencies,..."
I also changed these ports again (they were not used in both cases).
I run XAMPP as an administrator and I disabled my firewall without any results... What are other possible options? (Error-)Logs are empty.
maybe the following information might help:
I am using windows 10, xampp 1.7.7 portable, and although I changed the ports, when I run XAMPP, it tells me the following:
Problem detected!
Port 80 in use by "Unable to open process" (PID 4)!
Apache will NOT start without the configured ports free!
Try to do this:
Run -> CMD, type services.msc and stop the program:
Web Deployment Agent Service
Afterwards try restarting XAMPP and say if it works or not!
I fixed it via reinstalling into another directory.

Unable to connect to localhost Apache Ubuntu

I run xampp (apache) on Ubuntu 12.04. I've got localhost declared as ServerName localhost in httpd.conf. So far, I've not experienced problems with this but now, the browser Firefox is unable to connect to localhost. What could the problem be? Thanks.
OK. Found the answer and responding to myself in case it could be of interest to others; Actually, Apache server was not running. When I started xampp, it said Apache is already running but in fact wasn't due to the fact that the file logs/http.pid was corrupt. I deleted this file and then restarted xampp. This time it did launch the apache server and everything is fine.

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.