diff --git a/guides/add-domain-to-server.html b/guides/add-domain-to-server.html
index 7e1cc0a..cbf4963 100644
--- a/guides/add-domain-to-server.html
+++ b/guides/add-domain-to-server.html
@@ -4,7 +4,6 @@
-
@@ -33,28 +32,26 @@
- To avoid needing to remember an IP, this guide will help to link your domain name to your server.
+ To avoid needing to remember an IP, this guide will help to link your domain name to your server. It assumes you have already attained a domain name.
+
Login to your domain name registrar
Login to the registrar, and select the domain name you want to point at your server.
Find the section for DNS
- The domain name should have a section named, "DNS", "Custom DNS records", or something similar to this. Find, and open it, there should be a bunch of boxes and an option to add a new record
+ The domain name should have a section named, "DNS", "Custom DNS records", or something similar to this. Find, and open it, there should be a bunch of boxes and an option to add a new record.
Add the A record
- There will likely be many option for adding records, but all we need is to add a singular A record
- Find the box that allows you to "Add a new record" and input the below, changing and with your IP address, and domain name
-
-
+ Find the box that allows you to "Add a new record" and input the below, changing and with your IP address, and domain name.
- If there are not multiple boxes, but instead a single box to input your record into, this will be what you add instead
-
-
+ <DOMAIN> A 86400 <IP>
Wait for propagation
Now there's a bit of a waiting game, as you need to wait for the new DNS record to propagate (get updated) for all nameservers. This can be anywhere from instantly to 72 hours, but typically takes an hour or two.
Check your domain has propagated
- Pinging the domain name will let you know when the IP has propagated, as when the ping command shows your IP, you're all set
+ Pinging the domain name will let you know when the IP has propagated, as when the ping command shows your IP, you're all set.
+
+ ping -c 3 domainname.com
diff --git a/guides/add-php-to-nginx.html b/guides/add-php-to-nginx.html
index 456da21..f2fd409 100644
--- a/guides/add-php-to-nginx.html
+++ b/guides/add-php-to-nginx.html
@@ -36,42 +36,38 @@
PHP is one of the highest used programming languages for websites, and it allows you to add practically any functionality you'd ever want to your sites.
Install
- sudo apt install php-fpm php-mysql
-
- Um, I forgor
- sudo nano /etc/php//fpm/php.ini
- Comment the cgi.fix_pathinfo line, to look like below
- #set cgi.fix_pathinfo = 0
+ sudo apt install php-fpm
+ If you want to work with mysql, then you also need to install php-mysql.
Add to Website's NGINX conf
- For each website you want to use php, you'll need to edit the confige file
+ For each website you want to use php, you'll need to edit the config file.
sudo vim /etc/nginx/sites-available/
- The following code needs adding within the XXX block
+ The following code needs adding within the server block.
location ~ \.php$ {
include snippets/fastcgi-php.conf;
- fastcgi_pass unix:/run/php/php-fpm.sock;
+ fastcgi_pass unix:/run/php/php<VERSION>-fpm.sock;
}
- This will use nginx's fastcgi-php.conf snippet which is more secure by deafult than many other php/nginx configs because it 404s if the files doesn't exist. Read Neal Poole'sDon't trust the tutorials for more info.
+ This will use nginx's fastcgi-php.conf snippet which is more secure by default than many other php/nginx configs because it 404s if the requested file doesn't exist. Read Neal Poole's Don't trust the tutorials
for more info.
Reload NGINX
sudo systemctl reload nginx
Test it works
- Create a PHP file e.g. filename.php in the website's directory, and add the snippet below into it
-
+ Create a PHP file e.g. filename.php in the website's directory, and add the snippet below into it.
+ <?php phpinfo(); ?>
Go to that webpage in your browser e.g. domain.co.uk/filename.php, and if php is working you should see a dump of your PHP's version, headers, etc.
Make nginx use index.php as homepage/root
- Now we'll set nginx to load up index.php as the root of the website, if it exists. Open the site's config with an editor
+ Now we'll set nginx to load up index.php as the root of the website, if it exists. Open the site's config with an editor.
vim /etc/nginx/sites-available/
- Change the index line to read as below. This will then tell the server to load index.php, and if it doesn't exists, load index.html in it's stead
+ Change the index line to read as below. This will then tell the server to load index.php, and if it doesn't exists, load index.html in its stead.
index index.php index.html