CLI - Command Line Interface

mkdir (option -p to recursively create any parent folders that don't already exist)

ls (option -a to view hidden files)

ps cax | grep node or ps aux | grep node (enter search term instead of "node")ls

cat file.js to view file contents, without bothering with vim

VIM

This is a command line text editor, and is very annoying, but can be used efficiently if you know all the shortcuts:

dd - delete entire current line
G - last line
$ - last character in line

Users, Groups, and Permissions

chmod -R 600 ~/.ssh/YOUR-FILE you'll need to do this on any newly created SSH key file before GIT can use it

chown $USER -R /www or whatever folder or file you want to take back ownership of, if you run into write permission issues

More tips coming soon, but generally for a very basic setup, for a beginner server administrator, it is not good to change any permissions other than this. Definitely don't ever do chmod -R 777 /some-folder

Domains

When someone visits your domain, http://paulshorey.com, the domain is not connected to the server, so nothing loads.

To connect a domain to the server, go into DNS settings, in the registrar (Name.com) and:

URLS

In PHP and local filesystem, you open some folder in your browser, and if that folder has an "index.html" or "index.php" file, the folder path "file:///volumes/Users/admin/desktop/my-website" will render as a web page.

In a Node.js server, it doesn't work like that. Your "index.js" file can be anywhere, and can be called anything, like "app.js". When it is run, inside the script you have to tell it what urls to use, and what to do when each url is visited. This will be covered later.

results matching ""

    No results matching ""