.

Cheatsheet Přidat další Domény s Nginx - VPS ADMIN # 1

English Angličtina (změnit)
  • Digg
  • Twitter
  • Technorati
  • del.icio.us
  • Facebook
  • MySpace
  • Reddit
  • StumbleUpon
  • LinkedIn
  • email

Zachovat Unmanaged VPS - Část 1: Přidání webů Nginx Cheatsheet

website souborovou strukturu obrazu

Vytvářet další weby a blogy rychle a snadno. Po vytvoření DNS záznamů, přidejte vhost soubor, její symbolický odkaz, restartujte Nginx a jít hrát.

OK. Tak jsem to udělal již průvodce, už! Ale jak to je jedna z hlavních věcí, které lidé dělat s VPS - přidáním dalších oborů - Myslel jsem, že by neškodilo poskytnout zástupce Cheatsheet taky minus lichocení.

Tento návod předpokládá, jste si již nastavili stránky nebo blog s VPS Bible, a proto již povoleny FastCGI a pro WordPress, požadované FURL & kešování skriptů. Pokud ne, podívejte se na VPS Bible index. V opačném případě pouze nahradit "mydomain.com" pro your_domain.tld celém tomto how-to.

Pokud si chcete detail, proč to, kde je, pročež je, pak se můžete podívat na podrobný návod zde.

Nastavit Unmanaged VPS (4 newbies) .. VPS Bible

V 20 kopírovat / vložit kroky .. od nuly k hrdinovi, prázdné políčko cute-Linux jako server.

Přejděte dolů na celé řady indexu.

Tak, hej, bouda sdílené virtuální & viva! Doufám, že to pomůže. The_guv

Vytvořit DNS záznamů

Přidejte DNS nastavení, jak je vysvětleno zde.

Přidat stránky Adresářová struktura

V terminálu zadejte: --

sudo mkdir -p /home/public_html/mydomain.com/{public,private,log,backup}

Create a Temporary Homepage (optional)

You don't have to bother with this, but I guess some folks will find it handy.

Type:-

sudo nano /home/public_html/mydomain.com/public/index.html

.. hit return and paste:-

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My New Nginx-Powered Site</title>
</head>
<body>
<p>It works!</p>
</body>
</html>

Add Virtual Host (vhost) with FastCGI, FURL Support & Optional WordPress Caching

Type this:-

sudo nano /usr/local/nginx/sites-available/mydomain.com

Return and paste this:-

server {
            listen   80;
            server_name  www.mydomain.com;
            rewrite ^/(.*) http://mydomain.com/$1 permanent;
       }

server {

            listen   80;
            server_name mydomain.com;

            access_log /home/public_html/mydomain.com/log/access.log;
            error_log /home/public_html/mydomain.com/log/error.log;

            location / 
            {

                root   /home/public_html/mydomain.com/public/;
                index  index.php index.html;

                # Basic version of Wordpress parameters, supporting nice permalinks.
                # include /usr/local/nginx/conf/wordpress_params.regular;
                # Advanced version of Wordpress parameters supporting nice permalinks and WP Super Cache plugin
                include /usr/local/nginx/conf/wordpress_params.super_cache;
            }

            # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
            #
            location ~ \.php$ {
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            include /usr/local/nginx/conf/fastcgi_params;
            fastcgi_param SCRIPT_FILENAME /home/public_html/mydomain.com/public/$fastcgi_script_name;
            }
      }

Option: If you don't use WordPress with this site, delete the following lines from the above:-

# Basic version of Wordpress parameters, supporting nice permalinks.
# include /usr/local/nginx/conf/wordpress_params.regular;
# Advanced version of Wordpress parameters supporting nice permalinks and WP Super Cache plugin
include /usr/local/nginx/conf/wordpress_params.super_cache;

Option: If you do want WordPress, and want both pretty permalinks and WP Super Caching support, leave the above, as is.

Option: If you do want WordPress, and want pretty permalinks but not WP Super Caching, swap this:-

# Basic version of Wordpress parameters, supporting nice permalinks.
# include /usr/local/nginx/conf/wordpress_params.regular;
# Advanced version of Wordpress parameters supporting nice permalinks and WP Super Cache plugin
include /usr/local/nginx/conf/wordpress_params.super_cache;

.. for this :-

# Basic version of Wordpress parameters, supporting nice permalinks.
include /usr/local/nginx/conf/wordpress_params.regular;
# Advanced version of Wordpress parameters supporting nice permalinks and WP Super Cache plugin
# include /usr/local/nginx/conf/wordpress_params.super_cache;

Save the file.

Create the Symlink and Restart Nginx

Paste this into the terminal:-

sudo ln -s /usr/local/nginx/sites-available/mydomain.com /usr/local/nginx/sites-enabled/mydomain.com

And reboot the web server by typing ..

sudo /etc/init.d/nginx stop && sleep 2 && sudo /etc/init.d/nginx start

.. Or if you followed Set Up Unmanaged VPS (4 Newbies) - Part 7: Edit bashrc for User-Friendly Linux, plus System Updates , just type:-

n2r

Upload your new domain's site files and go check it. If you're relocating an existing site, you should read this for a seamless move .


SETUP an Unmanaged VPS (4 Newbies) .. The V-P-S Bible

Serve multi sites & blogs on a budget .. at the fastest possible speed .. with the least downtime .. in the most secure environment .. and future-proofed for easy admin.

That's what the VPS Bible is about, stepped out in simple copy & paste guides.

From high traffic WordPress blogs to startup web hosts, here's what you need.

Set it up?   Click here for the 21 part follow-up .. V-P-S Admin

  1. Intro: Set Up an Unmanaged VPS (4 Newbies) .. The V-P-S Bible
  1. VPS (Virtual Private Server) vs Shared vs Dedicated
  2. Set Up a VPS Linux Distribution   *
  3. Set Up the Command Line Interface (CLI) using PuTTY   *
  4. Create a Linux User & Set Permissions   *
  5. Encrypt Data with OpenSSH & Auto-Login with PuTTY   *
  6. Harden the Secure Shell (SSH) & Create a Firewall   *
  7. Edit bashrc for User-Friendly Linux, plus System Updates   *
  8. PHP5, MySQL, Xcache, Subversion (for Platforms like WordPress)   *
  9. Add a Domain Zone to Your VPS   *
  10. Prepare Linux Server for Email with Postfix   *
  11. Nginx (better than Apache) Web Server   *
  12. Setup FileZilla for Secure FTP (SFTP)   *
  13. Serve Multiple Sites & Blogs with Virtual Hosts   * V terminálu zadejte: --
    sudo mkdir -p /home/public_html/mydomain.com/{public,private,log,backup}

    Create a Temporary Homepage (optional)

    You don't have to bother with this, but I guess some folks will find it handy.

    Type:-

    sudo nano /home/public_html/mydomain.com/public/index.html

    .. hit return and paste:-

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>My New Nginx-Powered Site</title>
    </head>
    <body>
    <p>It works!</p>
    </body>
    </html>
    

    Add Virtual Host (vhost) with FastCGI, FURL Support & Optional WordPress Caching

    Type this:-

    sudo nano /usr/local/nginx/sites-available/mydomain.com

    Return and paste this:-

    server {
                listen   80;
                server_name  www.mydomain.com;
                rewrite ^/(.*) http://mydomain.com/$1 permanent;
           }
    
    server {
    
                listen   80;
                server_name mydomain.com;
    
                access_log /home/public_html/mydomain.com/log/access.log;
                error_log /home/public_html/mydomain.com/log/error.log;
    
                location / 
                {
    
                    root   /home/public_html/mydomain.com/public/;
                    index  index.php index.html;
    
                    # Basic version of Wordpress parameters, supporting nice permalinks.
                    # include /usr/local/nginx/conf/wordpress_params.regular;
                    # Advanced version of Wordpress parameters supporting nice permalinks and WP Super Cache plugin
                    include /usr/local/nginx/conf/wordpress_params.super_cache;
                }
    
                # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
                #
                location ~ \.php$ {
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                include /usr/local/nginx/conf/fastcgi_params;
                fastcgi_param SCRIPT_FILENAME /home/public_html/mydomain.com/public/$fastcgi_script_name;
                }
          }
    

    Option: If you don't use WordPress with this site, delete the following lines from the above:-

    # Basic version of Wordpress parameters, supporting nice permalinks.
    # include /usr/local/nginx/conf/wordpress_params.regular;
    # Advanced version of Wordpress parameters supporting nice permalinks and WP Super Cache plugin
    include /usr/local/nginx/conf/wordpress_params.super_cache;
    

    Option: If you do want WordPress, and want both pretty permalinks and WP Super Caching support, leave the above, as is.

    Option: If you do want WordPress, and want pretty permalinks but not WP Super Caching, swap this:-

    # Basic version of Wordpress parameters, supporting nice permalinks.
    # include /usr/local/nginx/conf/wordpress_params.regular;
    # Advanced version of Wordpress parameters supporting nice permalinks and WP Super Cache plugin
    include /usr/local/nginx/conf/wordpress_params.super_cache;
    

    .. for this :-

    # Basic version of Wordpress parameters, supporting nice permalinks.
    include /usr/local/nginx/conf/wordpress_params.regular;
    # Advanced version of Wordpress parameters supporting nice permalinks and WP Super Cache plugin
    # include /usr/local/nginx/conf/wordpress_params.super_cache;
    

    Save the file.

    Create the Symlink and Restart Nginx

    Paste this into the terminal:-

    sudo ln -s /usr/local/nginx/sites-available/mydomain.com /usr/local/nginx/sites-enabled/mydomain.com

    And reboot the web server by typing ..

    sudo /etc/init.d/nginx stop && sleep 2 && sudo /etc/init.d/nginx start

    .. Or if you followed Set Up Unmanaged VPS (4 Newbies) - Part 7: Edit bashrc for User-Friendly Linux, plus System Updates , just type:-

    n2r

    Upload your new domain's site files and go check it. If you're relocating an existing site, you should read this for a seamless move .


    SETUP an Unmanaged VPS (4 Newbies) .. The V-P-S Bible

    Serve multi sites & blogs on a budget .. at the fastest possible speed .. with the least downtime .. in the most secure environment .. and future-proofed for easy admin.

    That's what the VPS Bible is about, stepped out in simple copy & paste guides.

    From high traffic WordPress blogs to startup web hosts, here's what you need.

    Set it up?   Click here for the 21 part follow-up .. V-P-S Admin

    1. * Includes video tutorial.

    2. Not linked = not published. Won't be long. Fix a feed for updates.


    If you liked that ...
    ... maybe you'll like these?

.