PHP Setup

From TRCCompSci - AQA Computer Science
Revision as of 14:17, 27 March 2017 by OwenWildin (talk | contribs)
Jump to: navigation, search

Local Option

You can use a webserver which runs on your local machine only. Some options are portable and require little to no installation or setup. Other options could involve installing your own local LAMP, XAMP or WAMP system. The A normally means Apache, the M normally means MySQL, and the P means PHP.

Portable WebServer

You can download a working portable webserver from this link:

http://www.usbwebserver.net/en/download.php

This is quite a simple program to use, and i would recommend it for most students. It works well on your own devices but less well on the college system.

WAMP etc

This essentially is the same as above but you have much more control on settings, versions etc:

http://www.wampserver.com/en/

XAMPP is available for Linux, Windows & Mac:

https://www.apachefriends.org/download.html

Your own webserver

You can run a local raspberry pi or other webserver and port forward on your router.

Tutorials:

https://www.raspberrypi.org/documentation/remote-access/web-server/apache.md

https://opensource.com/article/17/3/building-personal-web-server-raspberry-pi-3

Port Forwarding

You can port forward port 80 to the local webserver. Any traffic recieved by your router on port 80 will be diverted to the local webserver. All other ports will be ignored and any traffic will be dropped.

Remember never leave ports open other than port 80, ports are regularly sniffed to see what is open. NEVER PORT FORWARD SSH PORT 22 it seems like a good idea to allow you to login to your webserver from anywhere but it is very insecure. Even though i have port 22 blocked i still get atleast 5-10 attempts per day.

Dynamic IP Issues

Also you might need to use a service like DuckDNS (like this site) because your IP address might be dynamically allocated by your ISP. DuckDNS uses a script run on a regular basis on your server to update your IP address. You direct people to use the DuckDNS address and it diverts everything to your current IP. Other services are available but DuckDNS is allowed through any college firewall or filtering.

DuckDNS Install Instructions (click pi):

http://http://www.duckdns.org/install.jsp