apacheÔõôɾ³ý¶àÓÚµÄЧÀÍÆ÷Ãû
Òª´Ó apache ÖÐɾ³ý¶àÓàµÄ servername Ö¸Á¿ÉÒÔ½ÓÄÉÒÔÏ°취£ºÊ¶±ð²¢É¾³ý¶àÓàµÄ servername Ö¸Áî¡£ÖØÐÂÆô¶¯ apache ʹ¸ü¸ÄÉúЧ¡£¼ì²éÉèÖÃÎļþÑéÖ¤¸ü¸Ä¡£²âÊÔЧÀÍÆ÷È·±£ÎÊÌâÒѽâ¾ö¡£
ÔõÑù´Ó Apache ÖÐɾ³ý¶àÓàµÄ ServerName Ö¸Áî
Apache ÖеĶàÓà ServerName Ö¸Áî¿ÉÄܻᵼÖÂЧÀÍÆ÷¹ýʧ»òÉèÖÃÎÊÌ⡣Ҫɾ³ýÕâЩ¶àÓàµÄÖ¸ÁÇëƾ֤ÒÔÏ°취²Ù×÷£º
1. ʶ±ð¶àÓàµÄ ServerName Ö¸Áî
·¿ª Apache ÉèÖÃÎļþ£¨Í¨³£ÊÇ /etc/apache2/apache2.conf »ò /etc/httpd/conf/httpd.conf£©¡£ËÑË÷ ServerName Ö¸Á²¢È·¶¨ÒªÉ¾³ýµÄ¶àÓàÖ¸Áî¡£
2. ɾ³ý¶àÓàµÄÖ¸Áî
ʹÓÃÎı¾±à¼Æ÷»òÏÂÁîÐй¤¾ßɾ³ý¶àÓàµÄ ServerName Ö¸Áȷ±£Ö»É¾³ý¶àÓàµÄÖ¸Á²»È»¿ÉÄÜ»áÓ°ÏìЧÀÍÆ÷µÄÕý³£ÔËÐС£
3. ÖØÐÂÆô¶¯ Apache
¶ÔÉèÖþÙÐиü¸Äºó£¬±ØÐèÖØÐÂÆô¶¯ Apache ÒÔʹ¸ü¸ÄÉúЧ¡£Ê¹ÓÃÒÔÏÂÏÂÁîÖØÐÂÆô¶¯ Apache£º
Ubuntu/Debian£ºsudo systemctl restart apache2
CentOS/Red Hat£ºsudo systemctl restart httpd
macOS£ºsudo apachectl restart
4. ÑéÖ¤¸ü¸Ä
ÖØÐÂÆô¶¯ Apache ºó£¬Ê¹ÓÃÒÔÏÂÏÂÁî¼ì²éÉèÖÃÎļþÖеĸü¸Ä£º
grep -i "servername" /etc/apache2/apache2.conf
µÇ¼ºó¸´ÖÆ
ÕâÓ¦½öÏÔʾĿ½ñʹÓÃµÄ ServerName Ö¸Áî¡£
5. ²âÊÔЧÀÍÆ÷
»á¼ûÍøÕ¾ÒÔ²âÊÔ¸ü¸Ä¡£ÈôÊÇÄú֮ǰÓöµ½Ð§ÀÍÆ÷¹ýʧ»òÉèÖÃÎÊÌ⣬ÕâЩÎÊÌâÏÖÔÚÓ¦¸ÃÒѽâ¾ö¡£
ÒÔÉϾÍÊÇapacheÔõôɾ³ý¶àÓÚµÄЧÀÍÆ÷ÃûµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡