CWP e etsa joang mokhoa oa ho tsamaisa foldara ea subdomain?Fetola faele ea vhosts

Kaha plugin ea Wordfence e ke ke ea khona ho skena litsela tse ling tsa domain ka mokhoa o sireletsehileng, e le ho nolofatsa ho skena ka mokhoa o sireletsehileng ke plugin ea Wordfence, litsela tsa subdomain tsa setšoantšo sa WordPress li hloka ho tlamahanngoa le foldara e tšoanang ea domain ea webosaete ea WordPress.

VestaCP le fereko ea eona HestiaCP e lumella basebelisi ho iketsetsa tsela ea bukana ea foldara ea domain.

Leha ho le jwalo, tsela ya foldara ya subdomain phanele ya taolo ya CWP e ke ke ya fetolwa hore e tlangwe tseleng e ka hara foldara e le nngwe ya domain.

Mohlala, blog ea Chen Weiliang e se e tlamiloe tseleng ea foldara ea subdomain ▼

/home/用户名/public_html/chenweiliang.com

Ha o eketsa lebitso la subdomain, ha ho sebetse ho tlama tsela e ka har'a foldara e tšoanang ea lebitso la domain ▼

/home/用户名/public_html/chenweiliang.com/wp-content/img.chenweiliang.com
  • Tsela e joalo ea foldara ea mabitso a subdomain e ke ke ea eketsoa...
  • Tharollo ke ena.

CWP tloaelo subdomain lebitso la subdomain foldara foldara tshebetso ya tsela

  1. Kenya pele tsela ea foldara ea lebitso la subdomain (e behiloeng ka thoko ho lifoldara tse ling tsa mabitso a domain):
    /home/用户名/public_html/img.chenweiliang.com
  2. Ebe, ka letsoho u hlophise faele ea vhosts 'me u nkele sebaka sa directory sa foldara ena ea lebitso la domain:
    /home/用户名/public_html/img.chenweiliang.com
  3. Tlosa sebaka ka tsela e latelang ea foldara ea lebitso la domain name:
    /home/用户名/public_html/chenweiliang.com/wp-content/img.chenweiliang.com

Mokhoa oa ho hlophisa faele ea tlhophiso ea vhosts ho CWP7 le ho khutlisa tsela ea foldara ea foldara ea lebitso la domain?

Mohato oa 1: Hlahisa bukana ea foldara e ikhethileng ▼

mkdir /home/用户名/public_html/chenweiliang.com/wp-content/img.chenweiliang.com

Mohato oa 2: Kopitsa lifaele tsa setšoantšo sebakeng sa foldara ea hau eo u sa tsoa e etsa. ▼

cp -rpf -f /home/用户名/public_html/img.chenweiliang.com/* /home/用户名/public_html/chenweiliang.com/wp-content/img.chenweiliang.com

Mohato oa 3: Kenya WebServers Configuration Editor 'me u hlophise faele ea tlhophiso ea domain ea vhosts ea Nginx ka thoko.

Tobetsa "Edita" lebitso la domain name ea Nginx vhosts faele ea tlhophiso▼

  • WebServer Configuration Editor → Litlhophiso tsa WebServer → /etc/nginx/conf.d/vhosts/ → Edita

CWP e etsa joang mokhoa oa ho tsamaisa foldara ea subdomain?Fetola faele ea vhosts

  • /etc/nginx/conf.d/vhosts/img.chenweiliang.com.conf
  • /etc/nginx/conf.d/vhosts/img.chenweiliang.com.ssl.conf

Hata 4: Tlosa sebaka sena sa foldara ea lebitso la sebaka sa marang-rang ▼

/home/用户名/public_html/img.chenweiliang.com

Tlosa sebaka ka tsela e latelang ea foldara ea lebitso la domain name ▼

/home/用户名/public_html/chenweiliang.com/wp-content/img.chenweiliang.com

Mohato oa 5: Qala tšebeletso ea nginx hape ▼

systemctl restart nginx

Mohato oa 6: Kenya WebServers Configuration Editor 'me u hlophise faele ea Apache domain vhosts ka thoko.

Tobetsa "Edita"'s domain name ea Apache vhosts file ▼

  • WebServer Configuration Editor → Litlhophiso tsa WebServer → /usr/local/apache/conf.d/vhosts/ → Fetola

Kenya WebServers Configuration Editor ebe o hlophisa faele ya Apache domain vhosts configuration.

  • /usr/local/apache/conf.d/vhosts/img.chenweiliang.com.conf
  • /usr/local/apache/conf.d/vhosts/img.chenweiliang.com.ssl.conf
  • WebServer Configuration Editor → Litlhophiso tsa WebServer → /etc/nginx/conf.d/vhosts/ → Edita

Hata 7: Tlosa sebaka sena sa foldara ea lebitso la sebaka sa marang-rang ▼

/home/用户名/public_html/img.chenweiliang.com

Tlosa sebaka ka tsela e latelang ea foldara ea lebitso la domain name ▼

/home/用户名/public_html/chenweiliang.com/wp-content/img.chenweiliang.com

Mohato oa 8: Qala tšebeletso ea httpd hape ▼

systemctl restart httpd

Mohato oa 9: Kenya melao ea ho tlosa mokhoa oa ho fetisetsa lifaele faeleng ea .htaccess.

Haeba o batla ho fetisetsa basebedisi ka bohona ho subdomain ntle le domain ya boemo bo hodimo ya www , o hloka ho eketsa molao wa ho fetisetsa faeleng ya .htaccess ho ntsha dibuka tse itseng tsa difoldara. ▼

RewriteCond %{REQUEST_URI} !^/img.chenweiliang.com/.*$ [NC]

Beha khoutu ena pele ho molao oa pele oa ho fihlela mosebetsi o boletsoeng oa ho qoelisoa ▼

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/img.chenweiliang.com/.*$ [NC]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

Mohato oa 10: Nchafatsa webosaete ho bona hore na liphetoho li se li qalile.

  • Koala subdomain CDN 'me u khatholle sebaka sa marang-rang sa subdomain.

Mohato oa 11: Boloka faele ea tlhophiso khomphuteng ea hau ea lehae le ho Google Drive.

  • Haeba ho WebServers Setting → Khetha WebServer, ka mor'a ho boloka le ho tsosolosa tlhophiso, litaba tse ka holimo tse hlophisitsoeng ka letsoho li ke ke tsa sebetsa.
  • E hloka ho hlophisoa ka letsoho hape, e leng bothata haholo, kahoo kamora ho hlophisoa ka letsoho, lifaele li tlameha ho tšehetsoa ho khutlisetsa kapele lifaele tsa tlhophiso tse tšehetsoeng.

E latelang ke taelo ea ho khutlisa ka potlako faele ea tlhophiso ea vhost▼

cp -rpf -f /newbackup/backup-vhost-file/nginx-vhosts-file_modified/* /etc/nginx/conf.d/vhosts/

cp -rpf -f /newbackup/backup-vhost-file/apache-vhosts-file_modified/* /usr/local/apache/conf.d/vhosts/

Kamora ho khutlisa faele ea tlhophiso ea li-vhosts, etsa bonnete ba hore o qala hape nginx le httpd hore e sebetse ▼

systemctl restart nginx
systemctl restart httpd
  • Sena ke sa morero oa rekoto le tlhaiso-leseling feela.

Mohato oa 12: Sebelisa plugin ea Better Search Replace ho nkela tsela sebaka.

tsela ena ▼

home/用户名/public_html/img.chenweiliang.com

nkela sebaka ka ▼

/home/用户名/public_html/chenweiliang.com/wp-content/img.chenweiliang.com

Mohato oa 13: Hlakola subdomain ea setšoantšo ▼

rm -rf /home/用户名/public_html/img.chenweiliang.com

Mohato oa 14: Kamora ho netefatsa hore ntho e 'ngoe le e 'ngoe e nepahetse, khutlisetsa subdomain CDN.

Re tšepa hore sengoloa se reng "Mokhoa oa ho Etsa Litsela tsa Tsamaiso ea Foldara ea Subdomain ka CWP? Ho Hlophisa Faele ea vhosts" se arolelanoeng ho blog ea Chen Weiliang ( https://www.chenweiliang.com/ ) se tla u thusa.

Ikutloe u lokolohile ho arolelana sehokelo sa sengoloa sena: https://www.chenweiliang.com/cwl-28218.html

Ho notlolla maqheka a patiloeng🔑, rea u amohela ho kenela mocha oa rona oa Telegraph!

Share le ho rata haeba u e rata! Likabelo tsa hau le tseo u li ratileng ke khothatso ea rona e tsoelang pele!

 

Comments

您的邮箱地址不会被公开。必填项已用*标注

Scroll ho Top