Skip to content
Menu
Creating a Linode Server with Nginx
Notes
Send
1
Server Startup
2
Setup User
3
Enable Firewall
4
Set Server Time
5
Install MySQL
6
Install PHP
7
Install Email
Startup
Deploy Linode Image Ubuntu 19.04 Profile
Boot server
ssh into server as 'root' user
Change www-data password
psswd is a file, not a folder. Open file, then change line
Open file "passwd" at /etc/passwd using SSH
Find line: www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
Replace with: www-data:x:33:33:www-data:/var/www:/bin/bash
Create password for www-data user
PuTTY Command
passwd www-data
Enable Firewall and allow SSH
PuTTY Commands
ufw allow OpenSSH
ufw allow 9222/tcp
(allow whichever port is used)
ufw enable
Install http server and allow
PuTTY Commands
apt update
apt install nginx
ufw allow 'Nginx HTTP'
ufw allow https
ufw status
"ufw status" should bring back a status of "ALLOW" for each item.
Set Server Timezone
PuTTY Commands "date" command is to make sure we have the right date and time on the server
timedatectl set-timezone America/Denver
date
(optional)
Install MYSQL
PuTTY Commands (Setup 'password' in checkbox 4)
apt update && apt install mysql-server
mysql_secure_installation
mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '
password
';
Install MYSQL Part 2
PuTTY Commands
(Change user & password in checkbox 3)
(Use user and password from checkbox 3 for checkbox 4)
FLUSH PRIVILEGES;
SELECT user,authentication_string,plugin,host FROM mysql.user;
CREATE USER '
user
'@'%' IDENTIFIED BY '
password
';
GRANT ALL PRIVILEGES ON *.* TO '
user
'@'%' WITH GRANT OPTION;
SELECT user,authentication_string,plugin,host FROM mysql.user;
exit
Install PHP
PuTTY Commands
apt install php php-fpm php-common php-mysql php-gd php-cli
You will see "failed to start apache" in the logs, don't worry, we aren't using Apache.
Install PHP Part 2
Use SSH
Open /etc/php/7.2/fpm/php.ini
Change cgi.fix_pathinfo=1 to cgi.fix_pathinfo=0
Install PHPMyAdmin
PuTTY Commands
Read Guide
apt install phpmyadmin
Press "Tab" key, then "Enter" key, then "Enter" again
apt upgrade
Setup certifications for SSL
Use SSH
Using a previously made server, copy dummy certs folder from a previous ngnix folder to new /etc/nginx
copy confs folder from working site to /etc/nginx
Install Email
PuTTY Commands
Step 1-2
apt update
DEBIAN_PRIORITY=low apt install postfix
Read Step 1
postconf -e 'home_mailbox= Maildir/'
postconf -e 'virtual_alias_maps= hash:/etc/postfix/virtual'
To reconfigure PostFix settings use: dpkg-reconfigure postfix
Install Email Part 2
File Editor
Step 3
Open /etc/postfix/virtual
Read "Step 3" in the
guide
Install Email Part 3
PuTTY Editor
Step 3-5
postmap /etc/postfix/virtual
systemctl restart postfix
ufw allow Postfix
echo 'export MAIL=~/Maildir' | sudo tee -a /etc/bash.bashrc | sudo tee -a /etc/profile.d/mail.sh
source /etc/profile.d/mail.sh
apt install s-nail
Install Email Part 4
File Editor
Step 6
Open /etc/s-nail.rc
Read
Step 6
Install Email Part 5
PuTTY Editor
Step 7
Update "user" in checkbox 1
'init' | s-nail -s 'init' -Snorecord
user
Read
Step 6
Comments
This field is for validation purposes and should be left unchanged.
×
×
Cart
Home
Payment Options
For Pros
Creating a Linode Server with Nginx
Setting Up a New Site on Linode
Log In
Log Out
Sign-in
Username or Email Address
Password
Remember Me
Log In
Lost your password?
Contact Us
Name
Email
Message
Send