{"id":439,"date":"2015-12-22T18:11:08","date_gmt":"2015-12-22T12:11:08","guid":{"rendered":"https:\/\/workit.kz\/?p=439"},"modified":"2015-12-22T18:19:37","modified_gmt":"2015-12-22T12:19:37","slug":"ent-server-ubuntu-14-server-p2","status":"publish","type":"post","link":"https:\/\/workit.kz\/?p=439","title":{"rendered":"\u0421\u0435\u0440\u0432\u0435\u0440 \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u044f\u0442\u0438\u044f Ubuntu 14.04 Server (part 2)"},"content":{"rendered":"<p>&#160;\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0432\u044f\u0437\u043a\u0438 Nginx+Apache \u0441 PHP5, MySQL<\/p>\r\n<!--more-->\r\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Apache MPM ITK:<\/p>\r\n<pre>\r\napt-get install apache2-mpm-itk make<\/pre>\r\n<pre>\r\n* Starting web server apache2 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message\r\n*\r\nSetting up libapache2-mpm-itk (2.4.6-01-1) ...\r\ndpkg: error processing package libapache2-mpm-itk (--configure):\r\nsubprocess installed post-installation script returned error exit status 1\r\nSetting up make (3.81-8.2ubuntu3) ...\r\nSetting up ssl-cert (1.0.33) ...\r\ndpkg: dependency problems prevent configuration of apache2-mpm-itk:\r\napache2-mpm-itk depends on libapache2-mpm-itk; however:\r\nPackage libapache2-mpm-itk is not configured yet.\r\n\r\ndpkg: error processing package apache2-mpm-itk (--configure):\r\ndependency problems - leaving unconfigured\r\nNo apport report written because the error message indicates its a followup error from a previous failure.\r\n<\/pre>\r\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u0444\u0430\u0439\u043b&#160;\/etc\/apache2\/apache2.conf<\/p>\r\n<pre>\r\nServerName localhost<\/pre>\r\n<p>\u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u043f\u043e\u0440\u0442 \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/apache2\/ports.conf<\/p>\r\n<pre>\r\nListen 8080<\/pre>\r\n<p>\u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c Apach2, \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0438 \u043c\u0435\u043d\u044f\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/apache2\/conf-available\/security.conf:<\/p>\r\n<pre>\r\nServerTokens Prod\r\nServerSignature Off<\/pre>\r\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043d\u0438\u0436\u0435\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\r\n<pre>\r\n# a2dismod mpm_event<\/pre>\r\n<p>Module mpm_event disabled.<br \/>\r\nTo activate the new configuration, you need to run:<br \/>\r\nservice apache2 restart<\/p>\r\n<pre>\r\n# service apache2 restart<\/pre>\r\n<p>* Restarting web server apache2 [fail]<br \/>\r\n* The apache2 configtest failed.<br \/>\r\nOutput of config test was:<br \/>\r\nAH00534: apache2: Configuration error: No MPM loaded.<br \/>\r\nAction 'configtest' failed.<br \/>\r\nThe Apache error log may have more information.<\/p>\r\n<pre>\r\n# apt-get install apache2-mpm-itk<\/pre>\r\n<pre>\r\n# a2enmod rewrite\r\n# service apache2 restart<\/pre>\r\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 MySQL:<\/p>\r\n<pre>\r\n# apt-get install mysql-server mysql-client<\/pre>\r\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f:<\/p>\r\n<p>[Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.<\/p>\r\n<p>\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435&#160;\/etc\/mysql\/my.cnf<\/p>\r\n<pre>\r\nkey_buffer \u043d\u0430 key_buffer_size\r\nmyisam-recover \u043d\u0430 myisam-recover-options\r\n# service mysql restart<\/pre>\r\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 PHP (\u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438):<\/p>\r\n<pre>\r\n# apt-get install php5 libapache2-mod-php5 php5-cli php5-mysql php5-snmp php5-gd php5-memcache php5-imagick php5-recode php5-xmlrpc php5-xsl php5-mcrypt php5-curl php-pear php5-imap<\/pre>\r\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 Nginx:<\/p>\r\n<pre>\r\n# apt-get install libpcre3-dev libcurl4-openssl-dev gcc nginx<\/pre>\r\n<p>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Nginx \/etc\/nginx\/sites-available\/default \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u0432\u0441\u044e \u0441\u0435\u043a\u0446\u0438\u044e server:<\/p>\r\n<pre>\r\nserver {\r\nlisten *:80;\r\nserver_name example example.local;\r\naccess_log \/var\/log\/nginx\/access.log;\r\nerror_log \/var\/log\/nginx\/error.log;\r\n\r\nlocation ~* \\.(jpg|jpeg|gif|png|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tar|wav|bmp|rtf|swf|ico|flv|txt|docx|xlsx)$ {\r\nroot \/var\/www\/html\/;\r\nindex index.html index.php;\r\naccess_log off;\r\nexpires 30d;\r\n}\r\n\r\nlocation ~ \/\\.ht {\r\ndeny all;\r\n}\r\n\r\nlocation \/ {\r\nproxy_pass http:\/\/127.0.0.1:8080\/;\r\nproxy_set_header Host $host;\r\nproxy_set_header X-Real-IP $remote_addr;\r\nproxy_set_header X-Forwarded-For $remote_addr;\r\n\r\nproxy_connect_timeout 60;\r\nproxy_send_timeout 90;\r\nproxy_read_timeout 90;\r\nproxy_redirect off;\r\nproxy_set_header Connection close;\r\nproxy_pass_header Content-Type;\r\nproxy_pass_header Content-Disposition;\r\nproxy_pass_header Content-Length;\r\n}\r\n}<\/pre>\r\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/nginx\/nginx.conf \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0441\u0436\u0430\u0442\u0438\u0435:<\/p>\r\n<pre>\r\ngzip on;\r\ngzip_disable \"msie6\";\r\ngzip_proxied any;\r\ngzip_comp_level 4;\r\ngzip_buffers 4 8k;\r\ngzip_http_version 1.1;\r\ngzip_types text\/plain text\/css application\/json application\/x-javascript text\/xml application\/xml application\/xml+rss text\/javascript;<\/pre>\r\n<p>\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c Nginx \u0438 Apache2:<\/p>\r\n<pre>\r\n# service apache2 restart\r\n# service nginx restart<br type=\"_moz\" \/><\/pre>\r\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043d\u0430 \u043d\u0430\u0448 http:\/\/192.168.0.5\/<\/p>\r\n<p><a href=\"http:\/\/howitmake.ru\/blog\/ubuntu\/42.html\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438<\/a><br type=\"_moz\" \/>\r\n&#160;<\/p>","protected":false},"excerpt":{"rendered":"<p>&#160;\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0432\u044f\u0437\u043a\u0438 Nginx+Apache \u0441 PHP5, MySQL<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,30,1],"tags":[19,31],"class_list":["post-439","post","type-post","status-publish","format-standard","hentry","category-linux","category-ubuntu","category-blog","tag-linux","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/workit.kz\/index.php?rest_route=\/wp\/v2\/posts\/439","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/workit.kz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/workit.kz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/workit.kz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/workit.kz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=439"}],"version-history":[{"count":32,"href":"https:\/\/workit.kz\/index.php?rest_route=\/wp\/v2\/posts\/439\/revisions"}],"predecessor-version":[{"id":480,"href":"https:\/\/workit.kz\/index.php?rest_route=\/wp\/v2\/posts\/439\/revisions\/480"}],"wp:attachment":[{"href":"https:\/\/workit.kz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/workit.kz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/workit.kz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}