ÔõÑùʹÓÃLinux¾ÙÐÐϵͳЧÀÍÖÎÀíºÍÓÅ»¯
ÔõÑùʹÓÃlinux¾ÙÐÐϵͳЧÀÍÖÎÀíºÍÓÅ»¯
ÔÚ´ó´ó¶¼Ð§ÀÍÆ÷ÇéÐÎÖУ¬LinuxÊÇÊ×Ñ¡µÄ²Ù×÷ϵͳ¡£ËüµÄ¿É¿¿ÐÔ¡¢ÎÞаÐÔºÍÇå¾²ÐÔʹÆä³ÉΪ¿ª·¢Ö°Ô±ºÍϵͳÖÎÀíÔ±µÄÊ×Ñ¡¡£Ò»¸öºÃµÄϵͳÖÎÀíÔ±ÐèÒªÏàʶÔõÑùÖÎÀíºÍÓÅ»¯LinuxϵͳµÄЧÀÍ£¬ÒÔÈ·±£Ð§ÀÍÆ÷µÄÎȹÌÔËÐк͸ßЧÐÔÄÜ¡£±¾ÎĽ«ÏÈÈÝÔõÑùʹÓÃlinux¾ÙÐÐϵͳЧÀÍÖÎÀíºÍÓÅ»¯£¬²¢ÌṩÏà¹Ø´úÂëʾÀý¡£
Ò»¡¢ÏµÍ³Ð§ÀÍÖÎÀí
Æô¶¯ºÍ×èֹЧÀÍ
ÔÚLinuxÖУ¬ÎÒÃÇʹÓÃsystemctlÏÂÁîÀ´Æô¶¯¡¢×èÖ¹ºÍÖØÆôϵͳЧÀÍ¡£ÏÂÃæÊÇһЩ³£ÓõÄÏÂÁîʾÀý£º
Æô¶¯Ð§ÀÍ£ºsudo systemctl start ЧÀÍÃû³Æ
×èֹЧÀÍ£ºsudo systemctl stop ЧÀÍÃû³Æ
ÖØÆôЧÀÍ£ºsudo systemctl restart ЧÀÍÃû³Æ
ÀýÈ磬ҪÆô¶¯Apache WebЧÀÍÆ÷£¬ÎÒÃÇ¿ÉÒÔÔËÐÐÒÔÏÂÏÂÁ
sudo systemctl start apache2
ÉèÖÃЧÀÍ¿ª»ú×ÔÆô¶¯
ÈôÊÇÄúÏ£Íûij¸öЧÀÍÔÚϵͳÆô¶¯Ê±×Ô¶¯Æô¶¯£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁÆäÉèÖÃΪ¿ª»ú×ÔÆô¶¯£º
sudo systemctl enable ЧÀÍÃû³Æ
ÀýÈ磬ҪÉèÖÃApache WebЧÀÍÆ÷ÔÚϵͳÆô¶¯Ê±×Ô¶¯Æô¶¯£¬ÎÒÃÇ¿ÉÒÔÔËÐÐÒÔÏÂÏÂÁ
sudo systemctl enable apache2
Éó²éЧÀÍ״̬
ÒªÉó²éЧÀ͵ÄÔËÐÐ״̬£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ
sudo systemctl status ЧÀÍÃû³Æ
ÀýÈ磬ҪÉó²éApache WebЧÀÍÆ÷µÄÔËÐÐ״̬£¬ÎÒÃÇ¿ÉÒÔÔËÐÐÒÔÏÂÏÂÁ
sudo systemctl status apache2
¶þ¡¢ÏµÍ³Ð§ÀÍÓÅ»¯
×ÊÔ´ÏÞÖÆ
ΪÁË°ü¹ÜЧÀÍÆ÷µÄÎȹÌÐÔºÍÐÔÄÜ£¬ÎÒÃÇ¿ÉÒÔ¶ÔϵͳЧÀ;ÙÐÐ×ÊÔ´ÏÞÖÆ¡£LinuxÌṩÁËulimitÏÂÁîÀ´ÉèÖÃ×ÊÔ´ÏÞÖÆ¡£ÒÔÏÂÊÇһЩ³£ÓõÄ×ÊÔ´ÏÞÖÆʾÀý£º
ÉèÖÃCPUʹÓÃÏÞÖÆ£ºulimit -u 1000£¨ÏÞÖƵ½1000¸öÀú³Ì£©
ÉèÖÃÄÚ´æÏÞÖÆ£ºulimit -v 1000000£¨ÏÞÖƵ½1000000KB£©
ÉèÖÃÎļþ·¿ªÏÞÖÆ£ºulimit -n 10000£¨ÏÞÖƵ½10000¸öÎļþ£©
µ÷½âЧÀÍÉèÖÃ
´ó´ó¶¼Ð§ÀͶ¼ÓÐ×Ô¼ºµÄÉèÖÃÎļþ£¬ÎÒÃÇ¿ÉÒÔƾ֤ÐèÒª¾ÙÐе÷½âÀ´ÓÅ»¯Ð§À͵ÄÐÔÄÜ¡£ÀýÈ磬¹ØÓÚApache WebЧÀÍÆ÷£¬¿ÉÒÔ±à¼ÆäÉèÖÃÎļþ£¨Ò»Ñùƽ³£Î»ÓÚ/etc/apache2/apache2.conf»ò/etc/httpd/conf/httpd.conf£©À´ÐÞ¸ÄһЩ²ÎÊý£¬ÀýÈç×î´óÅþÁ¬Êý¡¢×î´óÇëÇó¾ÞϸµÈ¡£
ÒÔÏÂÊÇÒ»¸öʾÀý£¬½«Apache WebЧÀÍÆ÷µÄ×î´óÅþÁ¬Êý´ÓĬÈϵÄ150µ÷½âΪ200£º
sudo nano /etc/apache2/apache2.conf
ÕÒµ½ÒÔÏÂÐУº
MaxClients 150
½«ÆäÐÞ¸ÄΪ£º
MaxClients 200
ÉúÑIJ¢Í˳öÎļþ£¬È»ºóÖØÐÂÆô¶¯Apache WebЧÀÍÆ÷ÒÔʹÉèÖÃÉúЧ£º
sudo systemctl restart apache2
ʹÓûº´æ
ÔÚijЩÇéÐÎÏ£¬Ê¹Óûº´æ¿ÉÒÔÏÔÖøÌá¸ßЧÀ͵ÄÐÔÄÜ¡£ÀýÈ磬¹ØÓÚMySQLÊý¾Ý¿âЧÀÍÆ÷£¬ÎÒÃÇ¿ÉÒÔÆôÓÃÅÌÎÊ»º´æÀ´»º´æ³£ÓõÄÅÌÎÊЧ¹û£¬´Ó¶øïÔÌÊý¾Ý¿âµÄ¸ºÔØ¡£
ÒÔÏÂÊÇÒ»¸öʾÀý£¬ÎÒÃÇ¿ÉÒÔ±à¼MySQLµÄÉèÖÃÎļþ£¨Ò»Ñùƽ³£Î»ÓÚ/etc/mysql/my.cnf£©À´ÆôÓÃÅÌÎÊ»º´æ£º
sudo nano /etc/mysql/my.cnf
ÕÒµ½ÒÔÏÂÐУº
query_cache_size = 0
½«ÆäÐÞ¸ÄΪ£º
query_cache_size = 128M
ÉúÑIJ¢Í˳öÎļþ£¬È»ºóÖØÐÂÆô¶¯MySQLЧÀÍÒÔʹÉèÖÃÉúЧ£º
sudo systemctl restart mysql
½áÂÛ
±¾ÎÄÏÈÈÝÁËÔõÑùʹÓÃlinux¾ÙÐÐϵͳЧÀÍÖÎÀíºÍÓÅ»¯¡£Í¨¹ýÊìÁ·ÕÆÎÕÆô¶¯ºÍ×èֹЧÀÍ¡¢ÉèÖÃЧÀÍ¿ª»ú×ÔÆô¶¯¡¢Éó²éЧÀÍ״̬µÈ»ù±¾²Ù×÷£¬ÒÔ¼°Í¨¹ý×ÊÔ´ÏÞÖÆ¡¢µ÷½âЧÀÍÉèÖúÍʹÓûº´æµÈÓÅ»¯ÊֶΣ¬¿ÉÒÔ¸üºÃµØÖÎÀíºÍÓÅ»¯LinuxϵͳµÄЧÀÍ£¬Ìá¸ßЧÀÍÆ÷µÄÎȹÌÐÔºÍÐÔÄÜ¡£
Ï£Íû±¾ÎÄÄܶÔÕýÔÚѧϰ»òʹÓÃLinux¾ÙÐÐϵͳЧÀÍÖÎÀíºÍÓÅ»¯µÄ¶ÁÕßÃÇÓÐËù×ÊÖú¡£×£ÄúÖÎÀíºÍÓÅ»¯LinuxϵͳµÄЧÀÍ˳Ë죡
ÒÔÉϾÍÊÇÔõÑùʹÓÃLinux¾ÙÐÐϵͳЧÀÍÖÎÀíºÍÓÅ»¯µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡