URLOS use notes
after the move is successful, the following two places need to be modified IP intranet for new servers IP, then click "deploy all services" in "cluster management", and open the url to access the website.
fill in the following content: website— Nginx configuration— server block extension content
error_page 403 https://linji.cn/1.html;
error_page 404 https://linji.cn/1.html;
error_page 502 https://linji.cn/1.html;
error_page 503 https://linji.cn/1.html;
error_page 504 https://linji.cn/1.html;
if (-d $request_filename) {
rewrite ^/(.*)([^/])$ https://$host/$1$2/ permanent;
}
if ($host != 'wdlu.cn' ) {
rewrite ^/(.*)$ https://wdlu.cn/$1 permanent;
}
move quickly
cd /var
tar czf - script | ssh root@106.187.44.236 tar xzf - -C /var
cd /usr/local/LuNamp/cmd
tar czf - crontab_cmd.sh | ssh root@106.187.44.236 tar xzf - -C /usr/local/LuNamp/cmd
cd /home/ftp/1520/linji-20110301020806-XfQmgJ
tar czf - backups | ssh root@106.187.44.236 tar xzf - -C /home/ftp/1520/linji-20110301020806-XfQmgJ
先停掉各种服务lu-stop
在本地终端拷贝到远程VPS
tar czf - web | ssh root@106.187.44.236 tar xzf - -C /home/ftp/1520/linji-20110301020806-XfQmgJ
在本地终端向远程拷贝回来
ssh root@106.187.44.236 tar czf - /home/ftp/1520/linji-20110301020806-XfQmgJ/web | tar xzf - -C /
--------------------------------
cd /home
ssh root@199.30.54.60 tar czf - /home/mysql_data | tar xzf - -C /
cd /home/ftp/1520/linji-20110301020806-XfQmgJ
ssh root@199.30.54.60 tar czf - /home/ftp/1520/linji-20110301020806-XfQmgJ/web | tar xzf - -C /
tar czvf – ftp 意思是把ftp打包压缩 输出在stdout
| 的意思是把std转成下个命令的stdin
ssh那句就是让远程执行 tar命令 把stdin的数据解压到/home
change file or directory properties
cd /home/mounts/linji/data/
chmod -R 777 /home/mounts
replace text in the database
update wp_posts set post_content = replace(post_content, ‘http://linji.cn/’http://127.0.0.1/w/);
https://www.jinshare.cn/2017/09/https/
https://www.zhujib.com/wordpressbokeqiyonghttpschajian-yijianqiyongqi.html
log in phpMyAdmin enter the server when ip address, username, password
https://blog.csdn.net/china_skag/article/details/52490771
根目录
config.inc.php
$cfg[‘AllowArbitraryServer’] = true;
将默认值false修改为true;
how to Linux copy a directory below
https://www.cnblogs.com/hechunhua/p/4550221.html
cp -af www/. www1/
WordPress NGINX pseudostatic
try_files $uri $uri/ /index.php?$args;
# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
will bring www automatic domain name transfer
Nginx配置——server块扩展内容,填写
server_name www.linji.org;
return 301 $scheme://linji.org$request_uri;
server_name www.wdlu.cn;
return 301 $scheme://wdlu.cn$request_uri;
server_name www.linji.cn;
return 301 $scheme://linji.cn$request_uri;
Nginx method of automatically adding slashes after directory
Nginx配置——server块扩展内容,填写
if (-d $request_filename){
rewrite ^/(.*)([^/])$ https://$host/$1$2/ permanent;
}
if the port is not 80, use the following statement (not to use)
https://www.geekzu.cn/archives/nginx-directory.html
if (-d $request_filename)
{
rewrite ^/(.*)([^/])$ https://$http_host/$1$2/ permanent;
}
introduced PHP document
<?php
require_once(TEMPLATEPATH . '/addfun.php');
?>
URLOS installation requirements
minimum hardware configuration: 1 core CPU,1G memory (1 +1)tip: if you have many applications and the host node has low hardware configuration, it is recommended to enable virtual virtual memory when deploying nodes;
recommended to use 2 in production environment G or above memory;
recommended installation system: Ubuntu-16.04、CentOS7.X、Debian8X、Debian9X a pure 64-bit operating system;
URLOS installation method
install URLOS please confirm whether the operating system version meets the installation requirements before. please check it for details. URLOS installation requirements
1. log in to the operating system: use ssh client tool login to the system, if the login user is not root, then execute sudo -s command to switch to root user;
2. download the installation script and execute the installation command:
curl -SO https://www.urlos.com/install && chmod 544 install && ./install
or
curl -O https://www.urlos.com/iu && sh iu
note: if there is no curl the tool needs to be executed first apt-get install -y curl || yum -y install curl” install curl
3. select the number of the area where the server is located: select 1 in china, select 2 or 3 if 1 cannot be installed, and select 4 if the server is overseas (if the download process is slow, please change other numbers), and press enter;
4. choose Docker data storage directory: /data/docker choose 1, /home/docker choose 2, /var/lib/docker select 3 and press enter;
5. the installation is successful and the server is restarted: the server may be automatically restarted after the installation is completed. the restart process usually takes about 1 minute;
6. access and use URLOS: please open port 9966,9967,9968,9969 (inbound rules) and port 8866 (outbound rules) in the firewall (or security group) and access " https://your server IP:9966” or" http://your server IP:9968” access URLOS;
username: urlos, password: urlos( now it's randomly generated)
note: it is recommended to use https agreement login URLOS, relatively safer!
URLOS upgrade method
please make backups of relevant data before upgrading. if your cloud host has disk snapshot function, it is recommended that you take disk snapshots first and then perform them. ULROS upgrade.
1. log in to the operating system: use ssh client tool login to the system, if the login user is not root, then execute sudo -s command to switch to root user
2. download the upgrade script and execute the upgrade command:
curl -SO https://www.urlos.com/update && chmod 544 update && ./update
note: if the upgrade cannot be stopped MySQL program, please use forced upgrade:
curl -SO https://www.urlos.com/update && chmod 544 update && ./update latest force
3. select the server area.
4. choose Docker data storage directory: must be set to old docker storage directory (if you forget, please execute cat /etc/docker/daemon.json check! )
5. access and use URLOS: after the installation is complete, please use your browser to access " https://your server IP:9966” or" http://your server IP:9968” access UrlOS
note: since the algorithm for storing passwords has changed, when from 0.3. x upgrade to 0.4. x when you upgrade, please log in URLOS modify all database services: you need to refill in your password and force deployment!
URLOS methods for binding authorization code:
1、bind in the service center IP。 log in to the service center (https://www.urlos.com/),find "purchased software" in the menu on the left > bind authorization", click "modify" after the authorization code that needs to be bound, and in the authorization IP fill in the external network of the server IP address.
2、revise URLOS configuration file. use SSH the tool connects to the server and enter the following command to update URLOS authorization code information in the configuration file:
docker exec urlos /usr/local/urlos/bin/common/tools.sh updateLicenseKey BBBBBB
in BBBBBB represents the authorization code to be bound.
3、access in a browser URLOS management platform, log in to check whether the authorized version has been updated.
time code
/** 夜深了! 2019年04月02日 22:08:31 星期二 **/
<center style="margin-top: -20px;"><script type="text/javascript">
today=new Date();
var day; var date; var hello;
hour=new Date().getHours()
if(hour < 6)hello=' 凌晨好! '
else if(hour < 9)hello=' 早上好! '
else if(hour < 12)hello=' 上午好! '
else if(hour < 14)hello=' 中午好! '
else if(hour < 17)hello=' 下午好! '
else if(hour < 19)hello=' 傍晚好! '
else if(hour < 22)hello=' 晚上好! '
else {hello='夜深了! '}
var webUrl = webUrl;
document.write(' '+hello);
</script>
<span id=localtime style="text-align-last: center;">
<script type="text/javascript">
function showLocale(objD)
{
var str,colorhead,colorfoot;
var yy = objD.getYear();
if(yy<1900) yy = yy+1900;
var MM = objD.getMonth()+1;
if(MM<10) MM = '0' + MM;
var dd = objD.getDate();
if(dd<10) dd = '0' + dd;
var hh = objD.getHours();
if(hh<10) hh = '0' + hh;
var mm = objD.getMinutes();
if(mm<10) mm = '0' + mm;
var ss = objD.getSeconds();
if(ss<10) ss = '0' + ss;
var ww = objD.getDay();
if ( ww==0 ) colorhead="<font color=\"#000\">";
if ( ww > 0 && ww < 6 ) colorhead="<font color=\"#000\">";
if ( ww==6 ) colorhead="<font color=\"#000\">";
if (ww==0) ww="星期日";
if (ww==1) ww="星期一";
if (ww==2) ww="星期二";
if (ww==3) ww="星期三";
if (ww==4) ww="星期四";
if (ww==5) ww="星期五";
if (ww==6) ww="星期六";
colorfoot="</font>"
str = colorhead + yy + "年" + MM + "月" + dd + "日 " + hh + ":" + mm + ":" + ss + " " + ww + colorfoot;
return(str);
}
function tick()
{
var today;
today = new Date();
document.getElementById("localtime").innerHTML = showLocale(today);
window.setTimeout("tick()", 1000);
}
tick();
</script></span>
server anti-crawler guide Nginx some are prohibited User Agent crawl the website
#禁止Scrapy等工具的抓取
if ($http_user_agent ~* (Scrapy|Curl|HttpClient)) {
return 403;
}
#禁止指定UA及UA为空的访问
if ($http_user_agent ~* "qihoobot|Baiduspider|Googlebot|Googlebot-Mobile|Googlebot-Image|Mediapartners-Google|Adsbot-Google|Feedfetcher-Google|Yahoo! Slurp|Yahoo! Slurp China|YoudaoBot|Sosospider|Sogou spider|Sogou web spider|MSNBot|ia_archiver|Tomato Bot") {
return 403;
}
#禁止非GET|HEAD|POST方式的抓取
if ($request_method !~ ^(GET|HEAD|POST)$) {
return 403;
}
#禁止指定UA及UA为空的访问
if ($http_user_agent ~* "FeedDemon|Indy Library|Alexa Toolbar|AskTbFXTV|AhrefsBot|CrawlDaddy|CoolpadWebkit|Java|Feedly|UniversalFeedParser|ApacheBench|Microsoft URL Control|Swiftbot|ZmEu|oBot|jaunty|Python-urllib|lightDeckReports Bot|YYSpider|DigExt|HttpClient|MJ12bot|heritrix|EasouSpider|Ezooms|^$" ) {
return 403;
}
#禁止指定UA及UA为空的访问
if ($http_user_agent ~ "WinHttp|WebZIP|FetchURL|node-superagent|java/|FeedDemon|Jullo|JikeSpider|Indy Library|Alexa Toolbar|AskTbFXTV|AhrefsBot|CrawlDaddy|Java|Feedly|Apache-HttpAsyncClient|UniversalFeedParser|ApacheBench|Microsoft URL Control|Swiftbot|ZmEu|oBot|jaunty|Python-urllib|lightDeckReports Bot|YYSpider|DigExt|HttpClient|MJ12bot|heritrix|EasouSpider|Ezooms|BOT/0.1|YandexBot|FlightDeckReports|Linguee Bot|^$" ) {
return 403;
}
#禁止指定UA及UA为空的访问
if ($http_user_agent ~ "LMAO|Hakai|Gemini|Wappalyzer|masscan|crawler4j|Mappy|Center|eright|aiohttp|MauiBot|Crawler|researchscan|Dispatch|AlphaBot|Census|ips-agent|NetcraftSurveyAgent|ToutiaoSpider|EasyHttp|Iframely|sysscan|fasthttp|muhstik|DeuSu|mstshash|HTTP_Request|ExtLinksBot|package|SafeDNSBot|CPython|SiteExplorer|SSH|python-requests|MegaIndex|BUbiNG|CCBot|NetTrack|Digincore|aiHitBot|SurdotlyBot|null|SemrushBot|Test|Copied|ltx71|Nmap|DotBot|AdsBot|InetURL|Pcore-HTTP|PocketParser|Wotbox|newspaper|DnyzBot|redback|PiplBot|SMTBot|WinHTTP|Auto Spider 1.0|GrabNet|TurnitinBot|Go-Ahead-Got-It|Download Demon|Go!Zilla|GetWeb!|GetRight|libwww-perl|Cliqzbot|MailChimp|SMTBot|Dataprovider|XoviBot|linkdexbot|SeznamBot|Qwantify|spbot|evc-batch|zgrab|Go-http-client|FeedDemon|JikeSpider|Indy Library|Alexa Toolbar|AskTbFXTV|AhrefsBot|CrawlDaddy|CoolpadWebkit|Java|UniversalFeedParser|ApacheBench|Microsoft URL Control|Swiftbot|ZmEu|jaunty|Python-urllib|lightDeckReports Bot|YYSpider|DigExt|YisouSpider|HttpClient|MJ12bot|EasouSpider|LinkpadBot|Ezooms|^$" ) {
return 403;
}
information technology 2019-04-06 23:50:10 via the web browse (6790) print
there are 0 comments in total!