root /var/www/wordpress; index index.html index.htm index.php; # Make site accessible from http://localhost/ server_name blog.ely.me;
location / { # First attempt to serve request as file, then # as directory, then fall back to index.html try_files $uri $uri/ /index.html; # Uncomment to enable naxsi on this location # include /etc/nginx/naxsi.rules if (-f $request_filename/index.html){ rewrite (.*) $1/index.html break; }
if (-f $request_filename/index.php){ rewrite (.*) $1/index.php; }
if (!-f $request_filename){ rewrite (.*) /index.php; } }
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; # # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini # # # With php5-cgi alone: fastcgi_pass 127.0.0.1:9000; # # With php5-fpm: # fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; } }
16. 配置环境变量
$ vi ~/.zshrc
ALL_IP=$(ifconfig | grep inet | grep -v 127.0.0.1 | grep -v inet6 | awk '{print $2}' | tr -d "addr:")
cat logo
echo "公网:$ALL_IP 内网:xxx.xxx.xxx.xxx "
echo "-------------------------------------------------------------------------------------------"
alias -s java=vi
alias -s go=vi
alias -s html=vi
alias -s js=vi
alias -s css=vi
alias -s gz='tar -xzvf'
alias -s tgz='tar -xzvf'
alias -s bz2='tar -xjvf'
alias -s zip='unzip'
alias -s rar='unrar x'
# Java
export JAVA_HOME=/usr/lib/jvm/java-7-oracle
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib
export PATH=$JAVA_HOME/bin:$PATH
# Gradle
export GRADLE_HOME=/root/sdk/gradle-2.3
export PATH=$GRADLE_HOME/bin:$PATH
# Tomcat
export TOMCAT_HOME=/root/sdk/apache-tomcat-6.0.43
19. 服务器安全设置
19.1 SSH 默认端口更改(修改完端口后,客户端需要配置ssh的config文件,指明端口)
$ vi /etc/ssh/sshd_config
Port XXXX (将端口修改为自己想要的)
$ service ssh restart