Supervisor will keep our server going and restart it in the case of hiccups and technical glitches. Supervisor is a cool little client/server tool that allows us to monitor and control processes on Linux and UNIX-like operating systems. NGINX is a free and open-source web server that we are going to install on our Droplet. mysql > CREATE DATABASE heroplex_db Īfter you're done, you can exit MySQL. Your application needs a database to connect to! Let's create one called heroplex_db (you can rename yours) and then flush privileges to make sure all of the changes stick. Create a new database for your application mysql > GRANT CREATE, ALTER, DROP, INSERT, UPDATE, DELETE, SELECT, REFERENCES, RELOAD, INDEX on *. For our Django app, the user needs the privileges listed in the command below. We have to explicitly grant the user privileges to perform a variety of actions on the database. Grant necessary database privileges to the user you just createdīy default, the MySQL user you just created doesn't have permission to do much of anything in the database management environment. Mysql > CREATE USER 'localhost' IDENTIFIED BY 'password' 6. I'm giving my MySQL user the same nane as my application- "heroplex." Replace "heroplex" below with whatever you want your user to be called, and replace "password" with a strong password that your app can use to connect to the database. Let's setup a dedicated MySQL user that the app can use to access the database. Create a dedicated MySQL userįor security reasons, we don't want our application to use the root MySQL user to connect to the database we are going to create. You'll be asked to set a MySQL root password, remove anonymous users, disallow remote root login, remove the default database (called "test"), and if you want to reload the privileges table for the changes to take effect (say "yes" to this last bit). You'll be prompted to run a password validator component- I chose option 2 for my password validation, but feel free to choose what makes sense for you. sudo apt -get install mysql -serverĪfter the installation finished, we're going to use an included security configuration script to clean up a few things and patch a few security holes. You might want to use another database management system, so feel free. Install MySQL and run configuration scriptĪs mentioned, this Django project uses MySQL, so we need to install mysql-server on the Droplet. The first think we're going to do is run updates on your instance, just to make sure we're starting with the most up-to-date packages. You'll see a welcome message from your Droplet. You will be prompted to enter the master Droplet password that you created in Step 1. This will attempt to log you in as the Droplet root user. In your terminal, type the following, replacing the address with the number you just copied: ssh 159.203. That droplet has an IPV4 address (in my case, it's 159.203.187.32)- go ahead and copy that address to your clipboard. On your Digital Ocean dashboard, you're going to see the Droplet you just created. Use terminal to ssh into the Droplet you just created.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |