{"id":389,"date":"2009-11-14T06:14:02","date_gmt":"2009-11-13T23:14:02","guid":{"rendered":"http:\/\/www.icez.net\/blog\/?p=389"},"modified":"2009-11-14T06:20:38","modified_gmt":"2009-11-13T23:20:38","slug":"directadmin-mod_fcgid-php-fastcgi","status":"publish","type":"post","link":"https:\/\/www.icez.net\/blog\/389\/directadmin-mod_fcgid-php-fastcgi","title":{"rendered":"0085 | DirectAdmin + mod_fcgid + php fastcgi"},"content":{"rendered":"<p>\u0e01\u0e48\u0e2d\u0e19\u0e2d\u0e37\u0e48\u0e19 copy &#038; paste \u0e15\u0e32\u0e21\u0e2a\u0e39\u0e15\u0e23<\/p>\n<pre lang=\"bash\">\r\ncd \/usr\/local\/src\r\nwget http:\/\/mirrors.issp.co.th\/apache\/httpd\/mod_fcgid\/mod_fcgid-2.3.4.tar.bz2\r\ntar jxf mod_fcgid-2.3.4.tar.bz2\r\ncd mod_fcgid-2.3.4\r\nAPXS=\/usr\/sbin\/apxs .\/configure.apxs && make && make install\r\nchmod 755 -R \/var\/lib\/httpd\r\nmkdir \/fcgi\r\n<\/pre>\n<p>\u0e44\u0e1b\u0e17\u0e35\u0e48 \/usr\/local\/directadmin\/custombuild\/<br \/>\n\u0e40\u0e1b\u0e34\u0e14\u0e44\u0e1f\u0e25\u0e4c options.conf \u0e41\u0e01\u0e49 php5_cgi=yes \u0e2a\u0e48\u0e27\u0e19 php \u0e2d\u0e31\u0e19\u0e2d\u0e37\u0e48\u0e19 no \u0e43\u0e2b\u0e49\u0e2b\u0e21\u0e14<br \/>\n\u0e41\u0e25\u0e49\u0e27\u0e2a\u0e31\u0e48\u0e07 .\/build php \u0e08\u0e19\u0e40\u0e2a\u0e23\u0e47\u0e08<\/p>\n<p>\u0e41\u0e25\u0e49\u0e27\u0e40\u0e1b\u0e34\u0e14\u0e44\u0e1f\u0e25\u0e4c \/etc\/httpd\/conf\/extra\/httpd-info.conf<br \/>\n\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e44\u0e2d\u0e49\u0e19\u0e35\u0e48\u0e15\u0e48\u0e2d\u0e17\u0e49\u0e32\u0e22<\/p>\n<pre lang=\"apache\">\r\nLoadModule fcgid_module \/usr\/lib\/apache\/mod_fcgid.so\r\n\r\nSharememPath \/var\/run\/fcgid_shm\r\nSocketPath \/var\/lib\/httpd\/fcgid\/sock\r\n\r\n\r\n\r\n<IfModule mod_fcgid.c>\r\n  IdleTimeout 3600\r\n  ProcessLifeTime 7200\r\n  MaxProcessCount 128\r\n  DefaultMaxClassProcessCount 4\r\n  IPCConnectTimeout 60\r\n  IPCCommTimeout 90\r\n  DefaultInitEnv RAILS_ENV production\r\n#  DefaultInitEnv PHP_FCGI_CHILDREN 4\r\n#  MaxRequestsPerProcess 500\r\n<\/IfModule>\r\n\r\n<Directory \"\/home\">\r\n        AllowOverride All\r\n        Options SymLinksIfOwnerMatch\r\n        Order allow,deny\r\n        Allow from all\r\n        <IfModule sapi_apache2.c>\r\n        php_admin_flag engine off\r\n        <\/IfModule>\r\n        <IfModule mod_php5.c>\r\n        php_admin_flag engine off\r\n        <\/IfModule>\r\n<\/Directory>\r\n<\/pre>\n<p>\u0e40\u0e2a\u0e23\u0e47\u0e08\u0e41\u0e25\u0e49\u0e27\u0e40\u0e02\u0e49\u0e32\u0e44\u0e1b folder \/usr\/local\/directadmin\/data\/templates<br \/>\n\u0e40\u0e1b\u0e34\u0e14\u0e44\u0e1f\u0e25\u0e4c\u0e17\u0e35\u0e48\u0e02\u0e36\u0e49\u0e19\u0e15\u0e49\u0e19\u0e14\u0e49\u0e27\u0e22 virtual_host2*.conf (\u0e21\u0e35\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14 4 \u0e44\u0e1f\u0e25\u0e4c)<br \/>\n\u0e43\u0e19 section \u0e40\u0e14\u0e34\u0e21\u0e17\u0e35\u0e48\u0e40\u0e1b\u0e47\u0e19 PHP \u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14 \u0e43\u0e2b\u0e49 comment \u0e44\u0e27\u0e49 \u0e08\u0e30\u0e44\u0e14\u0e49\u0e1b\u0e23\u0e30\u0e21\u0e32\u0e13\u0e19\u0e35\u0e49<\/p>\n<pre lang=\"apache\">\r\n|*if CLI=\"1\"|\r\n#               php_admin_flag engine |PHP|\r\n#               <IfModule !mod_php6.c>\r\n#                       php_admin_flag safe_mode |SAFE_MODE|\r\n#               <\/IfModule>\r\n#               php_admin_value sendmail_path '\/usr\/sbin\/sendmail -t -i -f |USER|@|DOMAIN|'\r\n|*endif|\r\n|*if OPEN_BASEDIR=\"ON\"|\r\n#               php_admin_value open_basedir |OPEN_BASEDIR_PATH|\r\n|*endif|\r\n|*if SUPHP=\"1\"|\r\n#                suPHP_Engine |PHP|\r\n#               suPHP_UserGroup |USER| |GROUP|\r\n|*endif|\r\n<\/pre>\n<p>\u0e41\u0e25\u0e49\u0e27\u0e41\u0e17\u0e23\u0e01\u0e44\u0e2d\u0e49\u0e19\u0e35\u0e48\u0e40\u0e02\u0e49\u0e32\u0e44\u0e1b\u0e14\u0e49\u0e32\u0e19\u0e1a\u0e19\u0e02\u0e2d\u0e07\u0e44\u0e2d\u0e49\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e01\u0e35\u0e49<\/p>\n<pre lang=\"apache\">\r\n\t<IfModule mod_fcgid.c>\r\n\t\t<Files ~ (\\.fcgi)>\r\n\t\t\tSetHandler fcgid-script\r\n\t\t\tOptions +FollowSymLinks +ExecCGI\r\n\t\t<\/Files>\r\n\t<\/IfModule>\r\n\t<IfModule mod_fcgid.c>\r\n\t<Files ~ (\\.php)>\r\n\t\tSetHandler fcgid-script\r\n\t\tFCGIWrapper \"\/fcgi\/|USER|\/public_html\/fcgid.sh\" .php\r\n\t\tOptions +ExecCGI\r\n\t\tallow from all\r\n\t<\/Files>\r\n\t<\/IfModule>\r\n<\/pre>\n<p>\u0e41\u0e25\u0e49\u0e27\u0e40\u0e02\u0e49\u0e32\u0e44\u0e1b folder \/usr\/local\/directadmin\/scripts\/custom\/<br \/>\n\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e44\u0e1f\u0e25\u0e4c\u0e0a\u0e37\u0e48\u0e2d fcgid.sh \u0e43\u0e2a\u0e48\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e15\u0e32\u0e21\u0e19\u0e35\u0e49<\/p>\n<pre lang=\"bash\">\r\n#!\/bin\/sh\r\nexport PHP_FCGI_MAX_REQUESTS=0\r\nexec \/usr\/local\/php5\/bin\/php-cgi\r\n<\/pre>\n<p>\u0e43\u0e19 folder \u0e40\u0e14\u0e35\u0e22\u0e27\u0e01\u0e31\u0e19 \u0e2a\u0e23\u0e49\u0e32\u0e07\u0e44\u0e1f\u0e25\u0e4c\u0e0a\u0e37\u0e48\u0e2d domain_create_post.sh \u0e43\u0e2a\u0e48\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e15\u0e32\u0e21\u0e19\u0e35\u0e49<\/p>\n<pre lang=\"bash\">\r\n#!\/bin\/sh\r\n\r\nmkdir -p \/fcgi\/${username}\/public_html\r\ncp \/usr\/local\/directadmin\/scripts\/custom\/fcgid.sh \/fcgi\/${username}\/public_html\/fcgid.sh && chmod 0700 \/fcgi\/${username}\/public_html\/fcgid.sh\r\ncp \/usr\/local\/directadmin\/scripts\/custom\/php.ini \/fcgi\/${username}\/public_html\/php.ini\r\nperl -pi -w -e \"s\/PHPCFG_BASEDIR\/\\\/home\\\/${username}\\\/\/g;\" \/fcgi\/${username}\/public_html\/php.ini\r\nchown -R ${username}:${username} \/fcgi\/${username}\r\necho \"`date`  ${domain} created  \" >> \/var\/log\/directadmin\/domain_create.log\r\n<\/pre>\n<p>\u0e41\u0e25\u0e49\u0e27\u0e2a\u0e31\u0e48\u0e07 copy file php.ini \u0e21\u0e32\u0e43\u0e2a\u0e48\u0e44\u0e27\u0e49\u0e43\u0e19 \/usr\/local\/directadmin\/scripts\/custom\/php.ini<br \/>\n\u0e40\u0e1b\u0e34\u0e14\u0e44\u0e1f\u0e25\u0e4c \/usr\/local\/directadmin\/scripts\/custom\/php.ini \u0e17\u0e35\u0e48\u0e01\u0e4a\u0e2d\u0e1b\u0e21\u0e32\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e01\u0e35\u0e49 \u0e41\u0e25\u0e49\u0e27\u0e2b\u0e32 open_basedir<br \/>\n\u0e0b\u0e36\u0e48\u0e07\u0e1b\u0e01\u0e15\u0e34\u0e21\u0e31\u0e19\u0e08\u0e30 comment \u0e44\u0e27\u0e49 \u0e43\u0e2b\u0e49\u0e41\u0e01\u0e49\u0e40\u0e1b\u0e47\u0e19\u0e1b\u0e23\u0e30\u0e21\u0e32\u0e13\u0e19\u0e35\u0e49<\/p>\n<pre lang=\"php\">\r\nopen_basedir = PHPCFG_BASEDIR:\/tmp:\/var\/tmp\r\n<\/pre>\n<p>\u0e40\u0e2a\u0e23\u0e47\u0e08\u0e41\u0e25\u0e49\u0e27\u0e2a\u0e31\u0e48\u0e07 chmod a+x \/usr\/local\/directadmin\/scripts\/custom\/*.sh<\/p>\n<p>*** \u0e27\u0e34\u0e18\u0e35\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14\u0e44\u0e21\u0e48\u0e23\u0e31\u0e1a\u0e1b\u0e23\u0e30\u0e01\u0e31\u0e19\u0e1c\u0e25 \u0e41\u0e25\u0e30\u0e04\u0e27\u0e23\u0e43\u0e0a\u0e49\u0e01\u0e31\u0e1a\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e40\u0e1e\u0e34\u0e48\u0e07\u0e25\u0e07\u0e43\u0e2b\u0e21\u0e48\u0e40\u0e17\u0e48\u0e32\u0e19\u0e31\u0e49\u0e19<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0e01\u0e48\u0e2d\u0e19\u0e2d\u0e37\u0e48\u0e19 copy &#038; paste \u0e15\u0e32\u0e21\u0e2a\u0e39\u0e15\u0e23 cd \/usr\/local\/src wget http:\/\/mirrors.issp.co.th\/apache\/httpd\/mod_fcgid\/mod_fcgid-2.3.4.tar.bz2 tar jxf mod_fcgid-2.3.4.tar.bz2 cd mod_fcgid-2.3.4 APXS=\/usr\/sbin\/apxs .\/configure.apxs &#038;&#038; make &#038;&#038; make install chmod 755 -R \/var\/lib\/httpd mkdir \/fcgi \u0e44\u0e1b\u0e17\u0e35\u0e48 \/usr\/local\/directadmin\/custombuild\/ \u0e40\u0e1b\u0e34\u0e14\u0e44\u0e1f\u0e25\u0e4c options.conf \u0e41\u0e01\u0e49 php5_cgi=yes \u0e2a\u0e48\u0e27\u0e19 php \u0e2d\u0e31\u0e19\u0e2d\u0e37\u0e48\u0e19 no \u0e43\u0e2b\u0e49\u0e2b\u0e21\u0e14 \u0e41\u0e25\u0e49\u0e27\u0e2a\u0e31\u0e48\u0e07 .\/build php \u0e08\u0e19\u0e40\u0e2a\u0e23\u0e47\u0e08 \u0e41\u0e25\u0e49\u0e27\u0e40\u0e1b\u0e34\u0e14\u0e44\u0e1f\u0e25\u0e4c \/etc\/httpd\/conf\/extra\/httpd-info.conf \u0e40\u0e1e\u0e34\u0e48\u0e21\u0e44\u0e2d\u0e49\u0e19\u0e35\u0e48\u0e15\u0e48\u0e2d\u0e17\u0e49\u0e32\u0e22 LoadModule fcgid_module \/usr\/lib\/apache\/mod_fcgid.so SharememPath \/var\/run\/fcgid_shm SocketPath \/var\/lib\/httpd\/fcgid\/sock IdleTimeout 3600 ProcessLifeTime [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[50,3],"tags":[103,104,48,5901],"class_list":["post-389","post","type-post","status-publish","format-standard","hentry","category-linux","category-webserver","tag-directadmin","tag-fastcgi","tag-install","tag-php"],"_links":{"self":[{"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/posts\/389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/comments?post=389"}],"version-history":[{"count":6,"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/posts\/389\/revisions"}],"predecessor-version":[{"id":395,"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/posts\/389\/revisions\/395"}],"wp:attachment":[{"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/media?parent=389"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/categories?post=389"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.icez.net\/blog\/wp-json\/wp\/v2\/tags?post=389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}