• Home
  • The Song
  • The Avatar
  • The Cat
  • Contact the Cat

Gyp the Cat dot Com

How to Install WordPress with SSH and Nginx
internet

How to Install WordPress with SSH and Nginx

It feels like I’m installing a WordPress site just about every week, and I’ve put the following together to help me remember how to do it!  If it comes in useful to anyone else then I’m happy too.  We’ll assume you’re using Ubuntu 11.10 for this How To and running a LEMP server, although tailoring for Apache should be easy enough too using this method.

Logon to your server with your favourite SSH client:

ssh [email protected]

We’ll install unzip to player with the files:

apt-get install unzip

Lets get to the home directory:

cd /root

Download WordPress:

wget http://wordpress.org/latest.zip

Unzip:

unzip latest.zip

Create the destination folder:

mkdir /var/companya.com/httpdocs

Copy the files:

cp -rf ./wordpress/* /path/to/your/directory

For instance something like this:

cp -rf ./wordpress/* /var/companya.com/httpdocss

Lets make sure that the WordPress permissions are comfortable.

chown -hR 33:33 /var/companya.com/httpdocs

(If that doesn’t work for you see my post here.)

Now lets set up the database:

mysql -u[root] -p[password]

(Where [root] is your MySQL username and [password] is your MySQL password.)

create database database_name_you_want;

grant usage on database_name_you_picked.* to username_you_want@localhost identified by ‘password’;

(Where password is the password you want to use.)

grant all privileges on database_name_you_picked.* to ‘username_you_picked’@localhost;

exit

Now lets set up the Nginx virtual host.  Type in:

nano /etc/nginx/sites-enabled/companya.com

And now fill in that file with something like the following (obviously paying attention to your specifics I’ve highlighted in bold) use this as an Nginx template if you like:

server {
root /var/companya.com/httpdocs/;
index index.php index.html index.htm;
access_log /var/companya.com/logs/access.log combined;
server_name www.companya.com companya.com;

location /doc/ {
alias /usr/share/doc/;
autoindex on;
allow 127.0.0.1;
deny all;
}

location / {
try_files $uri $uri/ /index.php?$args;
}

location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 1w;
log_not_found off;
}

location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
}
}

[ctrl]+o to save, then [ctrl]+x to close Nano.

Now lets restart Nginx

service nginx restart

Now open your website, for example www.gypthecat.com and you should be all good to install using the details you picked here.

Related

Written by gyp - May 1, 2012 - 3796 Views
Tags | linux, nginx, wordpress

You Might Also Like

Strongswan IPSec (Including Cryptomap) to Microsoft Azure Virtual Network Gateway

March 15, 2019

Useful SSH Commands (Including Mac OSX)

June 20, 2013

Setting up Nginx with Cloudflare

September 19, 2013

1 Comment

  • WordPress Security Tips from an Expert .. WordPress Insider | The WordPress Tip Center May 4, 2012 at 2:40 am

    […] It feels like I'm installing a WordPress site just about every week, and I've put the following together to help me remember how to do it! If it comes in useful to …www.gypthecat.com/how-to-install-wordpress-with-ssh-and-n… […]

    Reply
  • Please Post Your Comments & Reviews
    Cancel reply

    Your email address will not be published. Required fields are marked *

    Previous Post
    Next Post

    Latest Posts

    • How to Convert CSV to Parquet Easily with Python on Linux Shell
    • Kusto Geolocation IP Lookup
    • Monitoring Tor Usage in Azure Sentinel, ASC, MDATP and ALA
    • HTTP to HTTPS Redirect on Azure CDN
    • Strongswan IPSec (Including Cryptomap) to Microsoft Azure Virtual Network Gateway
    • Black Ops 3 NAT Type Strict & PS4 NAT Type 3 with pfSense Fixed!
    • Sorry for the lack of posts
    • How to Block Internet Access with Group Policy (GPO)
    • Enforcing Microsoft Office 365 and Azure Tennancy with McAfee Web Gateway (MWG)
    • Scanning Subnet for Issuing Certificate Authority with OpenSSL

    Top Posts & Pages

    • How to Block Internet Access with Group Policy (GPO)
      How to Block Internet Access with Group Policy (GPO)
    • How to Configure Windows 2012 NPS for Radius Authentication with Ubiquiti Unifi
      How to Configure Windows 2012 NPS for Radius Authentication with Ubiquiti Unifi
    • Kusto Geolocation IP Lookup
      Kusto Geolocation IP Lookup
    • Tinyproxy A Quick and Easy Proxy Server on Ubuntu
      Tinyproxy A Quick and Easy Proxy Server on Ubuntu
    • Monitoring Tor Usage in Azure Sentinel, ASC, MDATP and ALA
      Monitoring Tor Usage in Azure Sentinel, ASC, MDATP and ALA
    • How to DNSPerf on Ubuntu 14.04 with Installation and Quick Start
      How to DNSPerf on Ubuntu 14.04 with Installation and Quick Start
    • How to Add Different Disclaimers using alterMIME and Postfix based on Domain
      How to Add Different Disclaimers using alterMIME and Postfix based on Domain
    • Blocking Countries on Nginx without the GeoIP Module
      Blocking Countries on Nginx without the GeoIP Module
    • How to Enable Squid Anonymous Stealth Mode
      How to Enable Squid Anonymous Stealth Mode
    • Configuring Suite B, VPN-A and VPN-B in IPSec with Strongswan
      Configuring Suite B, VPN-A and VPN-B in IPSec with Strongswan

    Tags

    apache2 azure azure log analytics blops business centos cheating cissp cloudflare cryptography dns game google gyp internet iphone ipsec isc linux mac marketing microsoft mw2 mx mysql nginx pfsense postfix proxy ps3 qualification radius revision security seo smtp socks squid ssh strongswan tinyproxy ubuntu windows 2012 wordpress xdecrypt.com
    Gyp the Cat dot Com

    Some rights retained Gyp the Cat Dot Com