A Linux server was recently configured with the Ubuntu 12.04.5 LTS version.
Move the web site that was previously placed on Windows Server 2003 to the current server, and give me the feeling in a word: real JB, come on!
Web page opened instantly, almost dull! Although the configuration above is more complex than Windows Server 2003, but see the site open so fast,
This is what it is ~ OK, below I want to put some common commands and configuration process encountered problems recorded, convenient for their later search,
If you are fortunate enough to help you, it will merit perfection.
All of the following commands are valid in Ubuntu 12.04.5 LTS test
--------------------Common Ubuntu Commands-----------------------------------
VI File name = Open File
: w= Save current file does not exit
: wq= Save current file and exit and: X same meaning
: q= exit VI without modification of the case
: q!= does not save the file and exits
ls-a = view all files including hidden files
MV old file name new file name = Change file name
RM-RF folder name = delete all Files under folder
chmod 777 folder name =777 permissions
Apt-get Install rar= installation rar
Apt-get Remove rar= unload rar
Apt-get Install unrar= installation Unrar
Apt-get Remove unrar= Uninstall Unrar
Unrar x diguo.rar= extract all files by filename
RAR a Diguo.rar diguo= package Diguo folder as a Diguo.rar
Find/-name filename = Locate file path
/var/lib/mysql = where the database log files are located
-----------restart Apache or MySQL-----------------------------
/etc/init.d/apache2 restart= re-launch Apache
/etc/init.d/mysql restart= Restart MySQL
-----------------------------------------------------------
-------------------Disk usage Commands--------------
df-h = Disk Usage
Du-sh/* = View all directory files the larger
du-sh/var/* = view var below all directories the larger
-------------------------------------------------
------------------Port---------------------------
Firewall: UFW
-------------------------------------------------
-----------------Symbolic Links------------------------
ls-l = The symbolic link under the view directory points to that file
Making Symbolic Links ln-s
-------------------------------------------------
------------------301 Redirect----------------------
Create a new. htaccess file under the Web site root directory
Rewriteengine on
Rewritebase/
Rewritecond%{http_host} ^abc.com$ [NC]
Rewriterule ^ (. *) $ http://www.abc.com$1 [l,r=301]
-------------------------------------------------
------------------CP Command Operation---------------------
CP source file name new file name = Copy source file name create new files
-------------------------------------------------
================ Server ========================
huluping.*&^%$#@!~520 huluping
================================================
Server is now stopped
A. Removed the symbolic link for Xpfuli
B. Domain name stop resolution
Restore site
A. Server Open cd/etc/apache2/sites-enabled/
To create a symbolic link name: Xpfuli---; /sites-available/xpfuli
Make symbolic links (copy commands) Ln-s Xpfuli. /sites-available/xpfuli
B. Resolving domain Names
================================================
===================dz2.5 pseudo-Static =====================
Create a new. htaccess file under the Web site root directory
Rewriteengine on
Rewritebase/
Rewritecond%{query_string} ^ (. *) $
Rewriterule ^topic-(. +) \.html$ portal.php?mod=topic&topic=$1&%1
Rewritecond%{query_string} ^ (. *) $
Rewriterule ^article-([0-9]+)-([0-9]+) \.html$ portal.php?mod=view&aid=$1&page=$2&%1
Rewritecond%{query_string} ^ (. *) $
Rewriterule ^forum-(\w+)-([0-9]+) \.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
Rewritecond%{query_string} ^ (. *) $
Rewriterule ^thread-([0-9]+)-([0-9]+)-([0-9]+] \.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3d$3 &page=$2&%1
Rewritecond%{query_string} ^ (. *) $
Rewriterule ^group-([0-9]+)-([0-9]+) \.html$ forum.php?mod=group&fid=$1&page=$2&%1
Rewritecond%{query_string} ^ (. *) $
Rewriterule ^space-(Username|uid)-(. +) \.html$ home.php?mod=space&$1=$2&%1
Rewritecond%{query_string} ^ (. *) $
Rewriterule ^ ([a-z]+)-(. +) \.html$ $1.php?rewrite=$2&%1
================================================
Some common commands for Ubuntu, beta version: Ubuntu 12.04.5 LTS