apacheÔõôɾ³ý¶àÓàµÄЧÀÍÆ÷Ãû
Ҫɾ³ý apache ÖжàÓàµÄЧÀÍÆ÷Ãû£¬Çë±à¼ÉèÖÃÎļþ²¢É¾³ý servername Ö¸Á¶¨Î»ÉèÖÃÎļþ£¨Í¨³£Îª /etc/apache2/httpd.conf »ò /etc/apache2/apache2.conf£©¡£·¿ªÉèÖÃÎļþ²¢É¾³ý²»ÐèÒªµÄ servername Ö¸Áî¡£ÉúÑÄÉèÖÃÎļþ²¢Ê¹ÓÃÒÔÏÂÏÂÁîÖØÆô apache£ºubuntu/debian£ºsudo systemctl restart apache2£»centos/red hat£ºsudo systemctl restart httpd¡£
ÔõÑùɾ³ý Apache ÖжàÓàµÄЧÀÍÆ÷Ãû
»Ø¸²£º
Ҫɾ³ý Apache ÖжàÓàµÄЧÀÍÆ÷Ãû£¬ÄúÐèÒª±à¼ Apache ÉèÖÃÎļþ²¢É¾³ý ServerName Ö¸Áî¡£
Ïêϸ°ì·¨£º
¶¨Î»ÉèÖÃÎļþ£º
¹ØÓÚ Apache 2.4 ¼°¸üÔç°æ±¾£¬ÉèÖÃÎļþͨ³£Î»ÓÚ /etc/apache2/httpd.conf¡£
¹ØÓÚ Apache 2.4 ¼°¸ü¸ß°æ±¾£¬ÉèÖÃÎļþͨ³£Î»ÓÚ /etc/apache2/apache2.conf¡£
·¿ªÉèÖÃÎļþ£º
ʹÓÃÎı¾±à¼Æ÷£¨ÀýÈç nano¡¢vim »ò gedit£©·¿ªÉèÖÃÎļþ¡£
ɾ³ý¶àÓàµÄ ServerName Ö¸Á
ÕÒµ½ ServerName Ö¸Áî¡£¸ÃÖ¸ÁîÖ¸¶¨Ð§ÀÍÆ÷µÄÃû³Æ»ò IP µØµã¡£
ɾ³ý²»ÐèÒªµÄ ServerName Ö¸Áî¡£
ÉúÑIJ¢ÖØÆô Apache£º
ÉúÑÄÉèÖÃÎļþ¡£
ʹÓÃÒÔÏÂÏÂÁîÖØÆô Apache£º
Ubuntu/Debian£ºsudo systemctl restart apache2
CentOS/Red Hat£ºsudo systemctl restart httpd
ʾÀý£º
¼ÙÉè Apache ÉèÖÃÎļþ°üÀ¨ÒÔÏÂЧÀÍÆ÷Ãû£º
ServerName example.com ServerName example2.com
µÇ¼ºó¸´ÖÆ
Ҫɾ³ý example2.com£¬Çëɾ³ý°üÀ¨¸ÃЧÀÍÆ÷ÃûµÄÐУº
ServerName example2.com
µÇ¼ºó¸´ÖÆ
¸üкóµÄÉèÖÃÎļþ½«ÈçÏÂËùʾ£º
ServerName example.com
µÇ¼ºó¸´ÖÆ
ÒÔÉϾÍÊÇapacheÔõôɾ³ý¶àÓàµÄЧÀÍÆ÷ÃûµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡