Now that you’ve set up your Ubuntu server, installed Django and set up your app, now it’s time to actually code the damn thing. But first you need to learn how to FTP into your server with an FTP client.
What’s that, you askt? It’s the thing you use to connect to the server, edit files, upload stuff, etc. It’s sweet.
Oh, also: I’ve also decided at this point that I’m not going to focus at all on setting stuff up on a Windows computer. Sorry. It’s just too damn difficult. Either install Linux, buy a Mac or pick something else to do.
LOGGING IN WITH A FTP CLIENT
I’m being lazy, so I’m going to just show you how to connect with FTP. Yes, everyone will tell you that SFTP is better. It is safer. It is more secure. But dammit, let me be lazy right now. You can learn more about using SFTP with AWS and Coda here.
We’re going to use vsftpd. First, ssh into your server. Then type this to download and install vsftpd:
sudo apt-get install vsftpd
Then you’re going to need to edit your permissions and add a user.
So let’s create a user.
sudo adduser somename
It will then ask you to enter in a password — which you need to remember — and then other information. The password is the only thing you should really care about, feel free to hit enter on everything else.
Next we’re going to want to give that person sudo power, so you can stop logging in as ubuntu. Do this:
cd /etc sudo nano sudoers
This will take you into a text editor to edit your sudoers file, which is where the sudo permissions live. Some people use different text editors, but this is my goddamn tutorial, and we’re using nano, dammit.
Here’s what your screen looks like:
Now, with your arrow keys, scroll down to underneath root. You’re going to add that username you added previously, and then type ALL=(ALL) ALL after it, so basically it’s copying what the root has.
somename ALL=(ALL) ALL
Type Ctrl + O to save, then Ctrl + X to exit. Bam. You just made a user. You’re super awesome.
Now let’s edit your permissions. Go here for more information on this.
sudo nano vsftpd.conf
Now, for security reasons (I say this as I teach you how to use FTP, ha ha ha), change this line
Then uncomment this line by deleting the # from them (that is how you uncomment stuff, by the way):
Then Ctrl + O followed by Ctrl + X. Next, enter in this command:
sudo /etc/init.d/vsftpd start
So open up FileZilla after you download and install it. Click the top left icon above the word “Host.” Click new site, give it a name. For the Host field, you need to put your IP address of your AWS instance. You find that by looking at AWS server name, which was something like ec2-18.104.22.168.compute-1.amazonaws.com. In this instance, the IP would be 22.214.171.124.
User is the username you created up there, and password is the password. Server type should be FTP. Click on Transfer Settings, and change it to “Active.” Now click Connect.
This should look familiar. It’s the structure of the files. Voila. You have now set up vsftpd, learned the very basics of using nano to edit stuff in the terminal and FTPd to your server. Next you will learn how to set up your models.py file. So move on to Step Four.