{"id":163,"date":"2010-06-18T15:54:19","date_gmt":"2010-06-18T12:54:19","guid":{"rendered":"http:\/\/skeletor.org.ua\/wordpress\/?p=163"},"modified":"2012-07-05T16:54:25","modified_gmt":"2012-07-05T13:54:25","slug":"apachephpperlmysql","status":"publish","type":"post","link":"https:\/\/skeletor.org.ua\/?p=163","title":{"rendered":"Apache+PHP+Perl+MySQL"},"content":{"rendered":"<p><strong><span style=\"color: #ff0000;\">1) \u0421\u0442\u0430\u0432\u0438\u043c mysql.<\/span><\/strong><\/p>\n<p><code>#cd \/usr\/ports\/database\/mysql51-server &amp;&amp; make install clean<\/code><\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0431\u0430\u0437\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c \u0435\u0451 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e:<\/p>\n<p><code>#mysql_install_db<br \/>\n#chown -R mysql:mysql \/var\/db\/mysql<br \/>\n<\/code><br \/>\n<!--more--><\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u00a0<strong>\/etc\/rc.conf<\/strong> \u0441\u0442\u0440\u043e\u043a\u0443 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c:<\/p>\n<p><code>#echo 'mysql_enable=\"YES\"' &gt;&gt; \/etc\/rc.conf<br \/>\n#\/usr\/local\/etc\/rc.d\/mysql-server start<br \/>\n<\/code><br \/>\n<strong><span style=\"color: #ff0000;\">2) \u0421\u0442\u0430\u0432\u0438\u043c Apache<\/span><\/strong><\/p>\n<p><code>#cd \/usr\/ports\/www\/apache22 &amp;&amp; make install clean<\/code><\/p>\n<p>\u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u043f\u0446\u0438\u0438, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 &#8211; \u043d\u0430 \u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435 (\u043a\u0441\u0442\u0430\u0442\u0438,\u00a0<strong>perl<\/strong> \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043e\u043c, \u043a\u0430\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439 \u043f\u0430\u043a\u0435\u0442):<\/p>\n<p><code>WITH_MYSQL=true<br \/>\nWITH_CGI=true<br \/>\nWITH_DBD=true<br \/>\nWITH_SSL=true<\/code><\/p>\n<p>\u0421\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u043c\u0435\u043d\u0438\u043c \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u043f\u0430\u043f\u043a\u0438 Web-\u0441\u0435\u0440\u0432\u0435\u0440\u0430:<\/p>\n<p><code>#chown -R www:www \/usr\/local\/www<\/code><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433 \u0430\u043f\u0430\u0447\u0430 (<strong>\/usr\/local\/etc\/apache22\/httpd.conf<\/strong>). \u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0434\u043d\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:<\/p>\n<p><code>ServerName srv-test.domain.tld:80<\/code><\/p>\n<p>\u0414\u043b\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f\u00a0<strong>cgi<\/strong>-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433 (\u043f\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u0443 \u043e\u043d\u0430 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0430). \u041f\u0440\u0438\u0432\u0435\u0434\u0451\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e:<\/p>\n<p><code>&lt;Directory \"\/usr\/local\/www\/apache22\/cgi-bin\"&gt;<br \/>\nAllowOverride None<br \/>\nOptions ExecCGI<br \/>\nOrder allow,deny<br \/>\nAllow from all<br \/>\n&lt;\/Directory&gt;<\/code><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u00a0<strong>\/usr\/local\/www\/apache22\/cgi-bin<\/strong> \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0432\u0441\u0435\u043c \u0444\u0430\u0439\u043b\u0430\u043c\u00a0<strong>chmod +x<\/strong> \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u044b \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c. \u0414\u0430 \u0438 \u0432\u043e\u043e\u0431\u0449\u0435, \u0434\u043b\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0432 \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0444\u0430\u0439\u043b\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c 755.<\/p>\n<p><code>#echo 'apache22_enable=\"YES\"' &gt;&gt; \/etc\/rc.conf<br \/>\n#\/usr\/local\/etc\/rc.d\/apache start<\/code><\/p>\n<p><strong><span style=\"color: #ff0000;\">3) \u0421\u0442\u0430\u0432\u0438\u043c PHP<\/span><\/strong><\/p>\n<p><code>#cd \/usr\/ports\/lang\/php5 &amp;&amp; make install clean<\/code><\/p>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u043f\u0446\u0438\u0438:<\/p>\n<p><code>WITH_CGI=true<br \/>\nWITH_APACHE=true<br \/>\nWITH_FASTCGI=true<br \/>\n<\/code><br \/>\n\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0432\u00a0<strong>\/usr\/local\/etc\/apache22\/httpd.conf<\/strong> (\u043f\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u0443 \u043e\u043d\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u043d\u043e \u043b\u0443\u0447\u0448\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \ud83d\ude42 ):<\/p>\n<p><code>LoadModule php5_module\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 libexec\/apache22\/libphp5.so<\/code><\/p>\n<p>\u0430 \u0442\u0430\u043a \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u0430\u043a\u043e\u0435<\/p>\n<p><code>&lt;IfModule mod_php5.c&gt;<br \/>\nAddType application\/x-httpd-php .php<br \/>\nAddType application\/x-httpd-php-source .phps<br \/>\n&lt;\/IfModule&gt;<\/code><\/p>\n<p>\u0438 \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043c\u0435\u043d\u044f\u0435\u043c \u0432\u0441\u0435\u00a0<strong>DirectoryIndex index.html<\/strong> \u043d\u0430 \u0442\u0430\u043a\u0438\u0435\u00a0<strong>DirectoryIndex index.php index.html<\/strong>, \u0442\u043e \u0435\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u00a0<strong>index.php<\/strong>, \u0447\u0442\u043e \u0431\u044b\u00a0<strong>php<\/strong> \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u00a0<strong>php<\/strong> \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u043b\u0430\u0441\u044c \u0440\u0430\u043d\u044c\u0448\u0435, \u0447\u0435\u043c<strong>html<\/strong><\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433 \u0430\u043f\u0430\u0447\u0430:<\/p>\n<p><code>#\/usr\/local\/etc\/rc.d\/apache22 reload<\/code><\/p>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430, \u043d\u0443\u0436\u043d\u043e \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443\u00a0<strong>&lt;IfModule mime_module&gt;<\/strong> \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u0447\u0442\u043e \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u043b\u0438 \u0432<strong>&lt;IfModule mod_php5.c&gt;<\/strong>, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e<\/p>\n<p><code>AddType application\/x-httpd-php .php<br \/>\nAddType application\/x-httpd-php-source .phps<\/code><\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443 \u0432\u043d\u0435\u0441\u0442\u0438 \u0442\u0430\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 <strong>php.ini<\/strong> (\u044d\u0442\u043e \u043f\u043e\u0432\u044b\u0441\u0438\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0432\u0430\u0448\u0435\u0433\u043e <strong>Web<\/strong>-\u0441\u0435\u0440\u0432\u0435\u0440\u0430):<\/p>\n<p><code>disable_functions = phpinfo, system, mail, exec<br \/>\nmax_execution_time = 30<br \/>\nmax_input_time = 60<br \/>\nmemory_limit = 8M<br \/>\npost_max_size = 8M<br \/>\nupload_max_filesize = 2M<br \/>\ndisplay_errors = Off<br \/>\nsafe_mode = On<br \/>\nsql.safe_mode = On<br \/>\nsafe_mode_exec_dir = \/path\/to\/secure\/dir<br \/>\nexpose_php = Off<br \/>\nlog_errors = On<br \/>\nallow_url_fopen = Off<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1) \u0421\u0442\u0430\u0432\u0438\u043c mysql. #cd \/usr\/ports\/database\/mysql51-server &amp;&amp; make install clean \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0431\u0430\u0437\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c \u0435\u0451 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e: #mysql_install_db #chown -R mysql:mysql \/var\/db\/mysql<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,15],"tags":[],"class_list":["post-163","post","type-post","status-publish","format-standard","hentry","category-freebsd","category-www"],"_links":{"self":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/163","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=163"}],"version-history":[{"count":4,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/163\/revisions"}],"predecessor-version":[{"id":595,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=\/wp\/v2\/posts\/163\/revisions\/595"}],"wp:attachment":[{"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/skeletor.org.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}