$ sudo nano /etc/apache2/sites-enabled/ nf This virtual host entry tells Apache (and Passenger) where your app is located. We need to create an Apache configuration file and setup a virtual host entry that points to your app. Now that you are done with transferring your app's code to the server and setting up an environment for your app, it is time to configure Apache so that Passenger knows how to serve your app. Installing services that your app depends on is outside of this tutorial's scope. Your app may also depend on services, such as PostgreSQL, Redis, etc. For example, if your application depends on Flask: $ sudo pip install flask A common way to install Python libraries is through pip. Most of these dependencies are Python libraries. Your application has various dependencies. Your app's code now lives on the server at /var/Install app dependencies If you are using our sample app, use this Git clone command instead: $ cd /var/www/ myapp $ sudo -u myappuser -H git clone -branch=end_result code $ sudo sh -c "chmod 600 ~ myappuser/.ssh/*" 1.3 Install Git on the server $ sudo sh -c "cat $HOME/.ssh/authorized_keys > ~ myappuser/.ssh/authorized_keys" $ sudo chown -R myappuser: ~ myappuser/.ssh We also ensure that that user has your SSH key installed: $ sudo mkdir -p ~ myappuser/.ssh But for demonstration purposes, this tutorial names the user account myappuser. You should give the user account the same name as your app. Passenger will automatically run your app under this user account as part of its user account sandboxing feature. For security reasons, it is a good idea to run each app under its own user account, in order to limit the damage that security vulnerabilities in the app can do. Now that you have logged in, you should create an operating system user account for your app. Starting from this point, unless stated otherwise, all commands that we instruct you to run should be run on the server, not on your local computer!
0 Comments
Leave a Reply. |