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

ka lebaka laWordfence pluginLitsela tse ling tsa mabitso a marang-rang li ke ke tsa hlahlojoa ka mokhoa o sireletsehileng, kahoo e le ho thusa ho hlahloba ts'ireletso ea Wordfence plugin, hoa hlokahala hoWordpressTsela ea subdomain ea setšoantšo e hokahane le foldara e tšoanang ea lebitso la sebaka sa marang-rang sa WordPress.

VestaCP'Me lekala la eona la HestiaCP, u ka khona ho iketsetsa tsela ea tsamaiso ea foldara ea lebitso la domain.

empa,Sehlopha sa Taolo sa CWPTsela ea foldara ea lebitso la subdomain e ke ke ea etsoa ka mokhoa o ikhethileng ho tlama tsela e ka har'a foldara e tšoanang ea lebitso la domain.

joalo ka,Chen WeiliangBlog e tlameletsoe tseleng ea "subdomain" foldareng ▼

/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?

Likhahlelo tsa 1:Hlahisa foldara e ikhethileng ▼

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

Likhahlelo tsa 2:Kopitsa faele ea setšoantšo sebakeng sa foldara eo u sa tsoa e hlahisa ▼

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

Likhahlelo tsa 3:Kenya WebServers Configuration Editor, o hloka ho hlophisa file ea tlhophiso ea domain name ea Nginx vhosts 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

Likhahlelo tsa 5:Qala tšebeletso ea nginx hape ▼

systemctl restart nginx

Likhahlelo tsa 6:Kenya WebServers Configuration Editor, o hloka ho hlophisa faele ea tlhophiso ea lebitso la sebaka sa Apache 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, hlophisa faele ea tlhophiso ea sebaka sa Apache vhosts No. 2

  • /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

Likhahlelo tsa 8:Qala hape tšebeletso ea httpd▼

systemctl restart httpd

Likhahlelo tsa 9:.htaccess file ho kenyelletsa redirect ntle le molao oa directory ea foldara 

Haeba ho na leE tla itihela ho domain name ea boemo ba bobeli ntle le lebitso la domain la boemo bo holimo, o hloka ho kenya molao oa foldara ea ho se kenyeletse faeleng ea .htaccess ▼

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]

Likhahlelo tsa 10:Hlahisa sebaka sa Marang-rang ho bona hore na liphetoho li tla sebetsa?

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

Likhahlelo tsa 11:Boloka lifaele tsa tlhophiso komporong ea lehae le 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.

Likhahlelo tsa 12:sebedisaPhatlalatso e Ntle Fetola pluginetsa phetoho ea tsela

tsela ena ▼

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

nkela sebaka ka ▼

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

Likhahlelo tsa 13:Hlakola sebaka se senyenyane sa setšoantšo ▼

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

Likhahlelo tsa 14:Kamora ho netefatsa, khutlisetsa subdomain CDN

Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) e arolelanoa "CWP e etsa joang mokhoa oa ho tsamaisa foldara ea subdomain?Fetola faele ea vhosts" ho u thusa.

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

Rea u amohela ho mocha oa Telegraph oa blog ea Chen Weiliang ho fumana lintlha tsa morao-rao!

🔔 Eba oa pele oa ho fumana Tataiso ea Tšebeliso ea "ChatGPT Content Marketing AI" ea bohlokoa bukeng ea holimo ea seteishene! 🌟
📚 Tataiso ena e na le boleng bo boholo, 🌟Ona ke monyetla o sa tloaelehang, se ke oa o fetoa! ⏰⌛💨
Share le rata haeba u rata!
Ho arolelana le lintho tseo u li ratang ke khothatso ea rona e tsoelang pele!

 

Comments

Aterese ea hau ea lengolo tsoibila e ke ke ea phatlalatsoa. Ho sebelisoa masimo a hlokahalang * Letšoao

tsamaisetsa hodimo