Help:LAMP issues

From Wikitech
Jump to navigation Jump to search

This is a FAQ-style list of common issues relating to LAMP instances.

"Permission denied" when trying to add HTML/PHP files

Use "sudo", for instance "sudo cp myfile.html /var/www/".

502 Bad Gateway nginx/1.1.19

This happens when the Instance Proxy cannot connect to the expected instance via port 80. Note that the server won't be immediately accessible after registering it with Special:NovaProxy. Waiting a few minutes before troubleshooting is recommended.

Potential causes:

webserver is not listening on port 80
If your webserver isn't accepting external connections on port 80, the proxy will return a 502. This may happen if your web service is down or if you have configured your webserver to listen on a different port or only to "localhost" or "".
security group not configured for port 80
In order to make an instance accessible via port 80, you'll need to set up a Special:NovaSecurityGroup with port 80 open and configure your instance to be a part of this security group.

Not Found. The requested URL / was not found on this server.

This can happen even if the server used to serve HTML content fine.

I solved the problem by creating a new instance. The problem still occurs sporadically, but usually a page refresh solves it.

My server is not accessible via HTTPS

Idea that does not work: Recreate the instance with certificates::star_wmflabs_org enabled.

HTTP request timed out

When using a public url for your wiki, making an internal PHP API call may time out.

# Edit /etc/hosts so that an entry similar to the following exists