Posts

Showing posts from March, 2017

How To Set Up HTTPS For A Website On Ubuntu

Image
Prerequisites: You must set up the following first: A website hosting server.  See How To Set Up Website Hosting On Ubuntu. Context:Domain name: yourdomain.comHostname: bluedroplet.yourdomain.comUsername: alexSteps: Get a SSL certificate.You can get a free SSL certificate by the following steps: SSH into your server.ssh alex@bluedroplet.yourdomain.comInstall the Certbot client.sudo apt-get install letsencrypt -yGet a SSL certificate for your site using the letsencrypt command.sudo letsencrypt certonly --webroot -w ~/sites/yourdomain.com/public -d yourdomain.com - The -w flag should point to your site’s public directory. - The -d flag is the domain you’re requesting the certificate for. - You should be prompted to enter your email address, which will be used for expiration notices. - You'll see the following message on success, showing the certificate location.

Install the SSL certificate.Edit the site’s Nginx configuration file.sudo nano /etc/nginx/sites-available/yourdomain.com Remove…

What Is Markdown ?

Image
Markdown is an easy-to-use syntax for styling your writing. It includes conventions for Syntax highlighted code block

# Header 1
## Header 2
### Header 3

- Bulleted
- List

1. Numbered
2. List

**Bold**and _Italic_and `Code` text

[ Link](url) and ![Image](src) Syntax Headers# This is an <h1 >tag
## This is an <h2 >tag
###### This is an <h6 >tag Emphasis *This text will be italic*
_This will also be italic_

**This text will be bold**
__This will also be bold__

_You **can** combine them_
*This text will be italic*
_This will also be italic_

**This text will be bold**
__This will also be bold__

_You **can** combine them_
Unordered lists * Item 1
* Item 2
   * Item 2a
   * Item 2b
Ordered lists 1. Item 1
1. Item 2
1. Item 3
  1. Item 3a
  1. Item 3b
Images ![Lo…

How To Set Up A Vue Web App Development Environment

Image
Prerequisites You must set up the following first: Node.js and npm. See How To Install NodeJs And Npm On Linux. ContextDevelopment platform: MacOS or Linux.Project directory name: vue-app. Steps Let's call the app vue-app and set it up under the home directory. ~
└── vue-app Go to the home directory. cd ~ Install Vue CLI. sudo npm install --global vue-cli Create a new project using the "webpack" template. vue init webpack vue-app Install dependencies in the ~/vue-app folder cd vue-app
npm install Launch the app in a browser npm run dev A browser window will be launched showing the webpack content at http://localhost:8080. Note: If you run "npm run dev" on a virtual development environment such as vagrant, you will need to configure port forwarding on your local machine, then you can go to the app page on the forwarding port on your local machine. E.g. http://localhost:808080. Modify the code in ~/vue-app/src/components/Hello.vue and see the changes on your browser. Now you can…

How To Set Up NodeJs And Npm On Linux

Image
Steps Get the installation script. Replace 6.x with the correct version string.cd ~ curl -sL https://deb.nodesource.com/setup_6.x -o nodesource_setup.sh Run the script under sudo.sudo bash nodesource_setup.sh Install the Node.js package, which contains npm as well. You don't need to install npm separately.sudo apt-get install nodejs Install the build-essential package for some npm packages to work. sudo apt-get install build-essential Update npmnpm install npm@latest -g Verify that you are running node v4.x.x or higher and npm 3.x.x or higher.node -v 
npm -v Done.

How To Set Up An Angular Web App Development Environment

Image
- This guide is applicable to Angular 2 onwards. - You should set up Angular on a development machine but not on the hosting server. PrerequisitesYou must set up the following first: Node.js and npm. See How To Install NodeJs And Npm On Linux.Steps Let's call the app angular-app and set it up under the home directory. ~ └── angular-app Go to the home directory.cd ~ Create the angular-app project repository from the Angular quickstart repository.git clone https://github.com/angular/quickstart.git angular-app Go to the angular-app project directory.cd angular-app Install npm packages.npm install Launch the app.npm start A browser window will be launched showing the quickstart content from http://localhost:3000. Note: If you run "npm start" on a virtual development environment such as vagrant, you will need to configure port forwarding on your local machine, then you can go to the app page on the forwarding port on your local machine. E.g. http://localhost:30000. Modify the code in…

How To Set Up A WordPress Website On Ubuntu

Image
Sites are also known as server blocks or virtual hosts. Prerequisites: You must set up the following first: A Website Hosting Server. See How To Set Up Website Hosting On Ubuntu. Context: Domain name: yourdomain.comHostname: bluedroplet.yourdomain.comUsername: alexSteps: Install WP-CLI (WordPress Command Line Interface) Go to your home directory.cd ~/ Download WP-CLI.curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar Check that it works.php wp-cli.phar --info You should see your current PHP version and other details. To access the command line tool by simply typing wp, move it into your PATH and ensure it has execute permissions.chmod +x wp-cli.phar sudo mv wp-cli.phar /usr/local/bin/wp You can now access the WP-CLI tool by typing wpInstall WordPressGo to the site’s public directory.cd ~/sites/yourdomain.com/public Download the latest stable version of WordPress into the working directory.wp core download Create a wp-config.php file using WP-CLI.wp core config --…

How To Set Up Website Hosting On Ubuntu

Image
Sites are also known as server blocks or virtual hosts.
PrerequisitesYou must set up the following first before following this instruction to set up your sites. A virtual server. See How To Set Up A Virtual Server On DigitalOcean.Nginx. See How To Set Up Nginx On Ubuntu.PHP. See How To Set Up PHP On Ubuntu.MariaDB / MySQL. See How To Set Up MariaDB On Ubuntu. ContextDomain name: yourdomain.comHostname: bluedroplet.yourdomain.comUsername: alexStepsConfigure DNS for the site.Buy a domain if you haven’t got one. Let’s say your domain is “yourdomain.com”.Update your domain’s DNS settings.If your hosting provider is DigitalOcean, go to your DigitalOcean account page → Networking → Domains → Select your domain.Set up as in the picture below.


Configure the nameservers through your domain registrar's web sites. See this guide from DigitalOcean.

Note: DNS changes can take up to 72 hours to propagate. If you visit the domain shortly after making any changes, you will probably see an error or s…

How To Set Up MariaDB on Ubuntu

MariaDB offers more features and speed improvements over MySQL. It’s also fully open source and has been adopted by a number of large companies.PrerequisitesYou must set up the following first.A virtual server. See How To Set Up A Virtual Server On DigitalOcean.ContextDomain name: yourdomain.comHostname: bluedroplet.yourdomain.comUsername: alexSetting Up MariaDBSSH into your serverssh alex@bluedroplet.yourdomain.comInstall MariaDBAdd the repository containing the mainline version.sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 sudo add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirror.sax.uk.as61049.net/mariadb/repo/10.1/ubuntu xenial main' -yUpdate the package lists.sudo apt-get updateInstall the package.sudo apt-get install mariadb-server -yYou’ll be prompted to enter a root password.Configure MariaDB/MySQLSetup the default system tables.sudo mysql_install_dbNote: If you get some error when running this command, check if th…

How To Set Up PHP on Ubuntu

Image
PrerequisitesYou must set up the following first before following this instruction. A virtual server.  See How To Set Up A Virtual Server On DigitalOcean.Setting Up PHP on a serverSSH into your serverssh alex@bluedroplet.yourdomain.com Install PHPAdd the repository containing the mainline version.sudo add-apt-repository ppa:ondrej/php -y Update the package lists.sudo apt-get update Install the package.sudo apt-get install php7.1-fpm php7.1-common php7.1-mysqlnd php7.1-xmlrpc php7.1-curl php7.1-gd php7.1-imagick php7.1-cli php-pear php7.1-dev php7.1-imap php7.1-mcrypt -y Confirm that PHP has been installed.Check version. php-fpm7.1 -v Configure PHPWe’ll run a single PHP pool under your user account. Edit the default pool configuration file.sudo nano /etc/php/7.1/fpm/pool.d/www.conf Set the following settings to your username, e.g. alex user = alex group = alex listen.owner = alex listen.group = alex Edit the php.ini file.sudo nano /etc/php/7.1/fpm/php.ini Change the following lines to match the v…

How To Set Up The Nginx Web Server On Ubuntu

Image
PrerequisitesYou must set up the following first. A virtual server. See How To Set Up A Virtual Server On DigitalOcean.ContextDomain name: yourdomain.comHostname: bluedroplet.yourdomain.comUsername: alex StepsSSH into your serverssh alex@bluedroplet.yourdomain.comInstall NginxAdd the repository containing the mainline versionsudo add-apt-repository ppa:nginx/development -yUpdate the package listssudo apt-get updateInstall the packagesudo apt-get install nginx -yConfirm that Nginx has been installedCheck versionnginx -vOpen a browser and type in your host name or public IP address in the address bar, you should see an Nginx welcome page. E.g. Go to http://bluedroplet.yourdomain.com or http://312.231.23.12 Configure NginxEnter the following commands and make note of the output.grep processor /proc/cpuinfo | wc -lulimit -nEdit the Nginx configuration file in /etc/nginx/nginx.conf.sudo nano /etc/nginx/nginx.confChange the following settings in the config file: For single user access servers,…