- Register for Docker Hub
- Install Docker
- Fire up the container
- Create a
.htaccessfile in the Server Root
- Place your files in the directory
Sometimes your FEUP server, gnomo.fe.up.pt, can misbehave or your area in particular be misconfigured (some students have been encountering such issues this year).
If you encounter
Forbidden errors or any other mysterious stuff, but want to get some work done, try Docker to set a Apache + PHP Container in your local machine (you need Admin rights!).
Register for Docker Hub
(For Windows users)
Register here for free. You need a set of credentials to download the Docker engine.
For Windows and Mac, simply download the Docker Desktop Installer and run it.
For Ubuntu Linux, I have compiled a script for easy installation.
- Fire up the Terminal,
sudo -iand type user password
exitthe root command line
- Paste the script found here in the Terminal.
Fire up the container
- Create a new folder somewhere, for example ~/php in Linux (it will create a
phpfolder in your home directory), or in Windows create the
- Open a Windows (
cmd.exe) / Linux / Mac Terminal and run this:
- Navigate (
cd) to the folder you created before
- Run the following commands
(For Linux / Mac):
1 docker run -d -p 8080:8080 -it --name=php -v $(pwd)/html/site:/var/www/html quay.io/vesica/php73:dev
docker run -d -p 8080:8080 -it --name=php -v C:\webdev\html:/var/www/html quay.io/vesica/php73:dev
In Windows you may need to run cmd.exe as an administrator, because it needs that to be able to write to the
C:\webdev folder. In Windows, accessing the hard drive root requires admin rights.
The Server Root folder
From now on, we will call the folder
<folder that you created>/html Server Root. This folder will will be where you will put your
html and other files of your website.
.htaccess file in the Server Root
This is optional, but will allow the web server to generate nice file listings for easy navigation, like below:
To turn this on, go to the Server Root and create a new file called
.htaccess, including the dot.
The contents of the folder should be this:
Place your files in the directory
From now on, whatever you put in the Root Folder, should be accessible in the browser via the link http://localhost:8080.
You should also get lists of folders and files directly in the browser, because you created the