sudo apt-get install git
sudo apt-get install nginx
sudo /etc/init.d/nginx start
sudo /etc/init.d/nginx stop
sudo /etc/init.d/nginx restart
sudo service nginx configtest
sudo service nginx reload
ps -ef | grep nginx
sudo vim /etc/nginx/sites-available/default
php
server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; # 若是要支持HTTPS,修改這裏 # 可使用 https://letsencrypt.org 的免費SSL證書 #listen 443 ssl; #ssl_certificate www.example.com.crt; #ssl_certificate_key www.example.com.key; #ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #ssl_ciphers HIGH:!aNULL:!MD5; # 重定向全部HTTP到HTTPS # rewrite ^(.*)$ https://$host$1 permanent; # 網站根目錄,根據須要修改 root /usr/share/nginx/html; # 增長index.php index index.php index.html index.htm; # 假設域名是 ssl.mcxiaoke.com server_name ssl.mcxiaoke.com; #綁定域名 location / { try_files $uri $uri/ =404; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } #支持php-fpm的配置 location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
安裝: sudo apt-get install mysql-server
html
sudo apt-get install php5-fpm
sudo service php5-fpm restart
sudo apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-xcache
查看端口占用: lsof -i:80
mysql
殺死進程: kill -9 3274
linux
tar
nginx
更新源: sudo apt-get update
git
更新已安裝的包:sudo apt-get upgrade
sql
ls -al /etc/passwd /etc/shadow -rw-r–r– 1 root root 1611 2011-12-16 05:30 /etc/passwd # 保存的是帳號 -rw-r—– 1 root shadow 947 2011-12-16 05:30 /etc/shadow # 帳號的密碼等信息
root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/bin/sh bin:x:2:2:bin:/bin:/bin/sh sys:x:3:3:sys:/dev:/bin/sh
root:!:15324:0:99999:7::: daemon:*:15259:0:99999:7::: bin:*:15259:0:99999:7::: letuknowit:$1$cPf/cIvr$sCws95uSip2ljTK052DDB.:15400:5:60:7:2:15490:
以上面最後用戶letuknowit爲例(15400對應的日期爲2012年3月1日),其保護以下信息:shell
hostname
或 uname –n
,都可以查看到當前主機的主機名。hostname 新主機名
/etc/hostname
文件中修改host
文件: /etc/hosts
存放的是域名與ip的對應關係, 添加一個新主機名到127.0.0.1
.原文地址: https://blog.ihoey.com/posts/...