{"id":443,"date":"2014-10-25T11:03:20","date_gmt":"2014-10-25T11:03:20","guid":{"rendered":"http:\/\/adrhc.go.ro\/wordpress\/?p=443"},"modified":"2017-10-07T17:26:00","modified_gmt":"2017-10-07T15:26:00","slug":"compiling-apache-2-2-29","status":"publish","type":"post","link":"https:\/\/adrhc.go.ro\/blog\/compiling-apache-2-2-29\/","title":{"rendered":"Compiling Apache 2.2.29"},"content":{"rendered":"<pre class=\"brush:bash shell; toolbar: false\">\r\n#See https:\/\/adrhc.go.ro\/wordpress\/common-commands-when-building\/ for building environment, x.sh script and other things not defined here.\r\n#Before starting you must declare the environment variables specified at the link above.\r\n\r\n#building env vars (required when rebuilding too)\r\nAPACHE_MPM=worker\r\nNEW_BUILD_NAME=apache\r\nNEW_BUILD_VER=2.2.29-$APACHE_MPM\r\nNEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER\r\nls -l \/tmp\/$NEW_BUILD_NAME-*\r\nls -l ~\/ffp_0.7_armv5\/packages\/$NEW_BUILD_NAME-*\r\nNEW_BUILD_NR=10\r\n\r\n#extract sources\r\nrm -r ~\/compile\/httpd-2.2.29-unpacked\r\ncd ~\/compile && mkdir httpd-2.2.29-unpacked\r\ntar xvzf httpd-2.2.29.tar.gz -C .\/httpd-2.2.29-unpacked\r\ncd ~\/compile\/httpd-2.2.29-unpacked\/httpd-2.2.29\r\n\r\n#If any additional problems related to libtool see below.\r\n#Modify \"configure.in\" and \"configure\" (search for: \"case $libtoolversion in\"):\r\n  case $libtoolversion in\r\n\t  *1.[45]*)\r\n\t\t  SH_LIBTOOL='$(LIBTOOL)'\r\n\t\t  SHLTCFLAGS=\"-prefer-pic\"\r\n\t\t  LTCFLAGS=\"-prefer-non-pic -static\"\r\n\t\t  ;;\r\n\t  *)\r\n\t\t  \/\/pedro: setez cumva SH_LIBTOOL\r\n\t\t  \/\/SH_LIBTOOL='$(SHELL) $(top_builddir)\/shlibtool $(LTFLAGS)' -> comenteaza (nu exista shlibtool)\r\n\t\t  SH_LIBTOOL='\/ffp\/lib\/apr-1.4.8\/build-1\/libtool $(LTFLAGS)' -> to add\r\n\t\t  SHLTCFLAGS=\"\"\r\n\t\t  LTCFLAGS=\"\"\r\n\t\t  ;;\r\n  esac\r\n\r\n#Enable NPN\r\n#https:\/\/issues.apache.org\/bugzilla\/show_bug.cgi?id=52210\r\n#http:\/\/svn.apache.org\/repos\/asf\/httpd\/httpd\/branches\/2.2.x\/\r\ncd ~\/compile\/httpd-2.2.29-unpacked\/httpd-2.2.29\r\nwget https:\/\/issues.apache.org\/bugzilla\/attachment.cgi?id=28588 -O npn.patch\r\n#Modify npn.patch:\r\n\tIndex: modules\/ssl\/ssl_engine_kernel.c\r\n\t===================================================================\r\n\t--- modules\/ssl\/ssl_engine_kernel.c\t(revision 1306012)\r\n\t+++ modules\/ssl\/ssl_engine_kernel.c\t(working copy)\r\n\t@@ -29,5 +29,6 @@\r\n\t\t\t\t\t\t\t\t\t   time I was too famous.''\r\n\t\t\t\t\t\t\t\t\t\t\t\t -- Unknown                *\/\r\n\t #include \"ssl_private.h\"\r\n\t+#include \"mod_ssl.h\"\r\n\t \r\n\t static void ssl_configure_env(request_rec *r, SSLConnRec *sslconn);\r\npatch -p0 -i npn.patch\r\n\r\n#Enable mod_fcgid\r\nrm -r ~\/compile\/mod_fcgid\r\ncd ~\/compile\/\r\nsvn checkout http:\/\/svn.apache.org\/repos\/asf\/httpd\/mod_fcgid\/trunk mod_fcgid\r\ncp -r ~\/compile\/mod_fcgid\/modules\/fcgid ~\/compile\/httpd-2.2.29-unpacked\/httpd-2.2.29\/modules\/\r\n\r\n#Enable WebSocket with mod_proxy_wstunnel\r\n#http:\/\/notmyitblog.blogspot.ro\/2014\/03\/websockets-support-for-apache-httpd.html\r\n#https:\/\/gist.github.com\/vitkin\/6661683\r\ncd ~\/compile\/httpd-2.2.29-unpacked\/httpd-2.2.29\r\nwget https:\/\/gist.github.com\/vitkin\/6661683\/raw\/873dd8b4de4ad1ff69757ffe48fc574374aedc57\/apache-2.2-wstunnel.patch -O apache-2.2-wstunnel.patch\r\npatch -p1 -i apache-2.2-wstunnel.patch\r\n#cp -r httpd-2.2.29 httpd-2.2.29-fcgid-npn-wstunnel\r\n#You may encounter some compilation error with version 2.2.22 and later similar to:\r\n#modules\/http\/.libs\/libmod_http.a(byterange_filter.o): In function `ap_set_byterange':\r\n#byterange_filter.c:(.text+0x130d): undefined reference to `apr_array_clear'\r\n#collect2: ld returned 1 exit status\r\n#This is a known bug. A workaround consist in adding --with-included-apr to the configure options.\r\n\r\n#configure new added modules (fcgid)\r\ncd ~\/compile\/httpd-2.2.29-unpacked\/httpd-2.2.29\r\n~\/x.sh ffpg\r\n.\/buildconf\r\n~\/x.sh ffpg\r\n\r\n#start from here when REBUILDING (only if not deleted ~\/compile\/httpd-2.2.29-unpacked\/httpd-2.2.29)\r\ncd ~\/compile\/httpd-2.2.29-unpacked\/httpd-2.2.29\r\nrm -r ..\/httpd-2.2.29-build\r\nmkdir ..\/httpd-2.2.29-build\r\n\r\n#CONFIGURE\r\ncd ~\/compile\/httpd-2.2.29-unpacked\/httpd-2.2.29-build\r\n..\/httpd-2.2.29\/configure --help > ..\/configure.help.txt\r\n#..\/httpd-2.2.29\/configure --prefix=\/ffp\/opt\/apache-2.2.29-$APACHE_MPM --enable-mods-shared=all --with-apr=\/ffp --with-apr-util=\/ffp --with-pcre=\/ffp --with-z=\/ffp --with-ssl=\/ffp --with-mpm=$APACHE_MPM --enable-fcgid\r\n..\/httpd-2.2.29\/configure --prefix=\/ffp\/opt\/apache-2.2.29-$APACHE_MPM --enable-modules=\"log_config mime alias autoindex headers authz_host userdir env setenvif filter authn_file ssl actions dir negotiation auth_basic authz_default authz_user rewrite proxy proxy_http proxy_ajp dav dav_svn authz_svn expires deflate info dav_fs proxy_wstunnel\" --enable-mods-shared=\"fcgid asis authn_default authz_groupfile cache cgi cgid disk_cache file_cache include mem_cache proxy_balancer proxy_connect proxy_ftp proxy_scgi status version\" --with-pcre=\/ffp --with-z=\/ffp --with-ssl=\/ffp --with-mpm=$APACHE_MPM --enable-fcgid\r\n\r\n#prepare for FFP again\r\ncd ~\/compile\/httpd-2.2.29-unpacked\/httpd-2.2.29-build\r\n~\/x.sh ffpg1\r\ncd ~\/compile\/httpd-2.2.29-unpacked\/httpd-2.2.29\r\n~\/x.sh ffpg\r\n\r\n#COMPILE\r\ncd ~\/compile\/httpd-2.2.29-unpacked\/httpd-2.2.29-build\r\nnohup \/ffp\/bin\/make -C ~\/compile\/httpd-2.2.29-unpacked\/httpd-2.2.29-build &\r\nrenice -6 `pidof cc1plus` -p `pidof make` -p `pidof as` -p `pidof ld` -p `pidof configure` -p `pidof cc1`\r\ntail -f nohup.out\r\n\r\n#INSTALL & PACKAGE\r\ncd ~\/compile\/httpd-2.2.29-unpacked\/httpd-2.2.29-build\r\nrm -r $HOME\/temp\/$NEW_BUILD_NAME_AND_VER\r\n#Running make -n install permits previewing the build process, as it prints out all \r\n#the commands that would be triggered by a make, without actually executing them.\r\nmake install DESTDIR=$HOME\/temp\/$NEW_BUILD_NAME_AND_VER\r\ncd $HOME\/temp\/$NEW_BUILD_NAME_AND_VER\r\nmakepkg $NEW_BUILD_NAME $NEW_BUILD_VER $NEW_BUILD_NR\r\ncp -v \/tmp\/$NEW_BUILD_NAME-$NEW_BUILD_VER-arm-$NEW_BUILD_NR.txz ~\/ffp_0.7_armv5\/packages\/\r\nfunpkg -q $NEW_BUILD_NAME\r\nfunpkg -i ~\/ffp_0.7_armv5\/packages\/$NEW_BUILD_NAME-$NEW_BUILD_VER-arm-$NEW_BUILD_NR.txz\r\n\r\n#copy additional modules\r\ncd $HOME\r\nsed -i s\/\"User daemon\"\/\"User nobody\"\/ \/ffp\/opt\/apache-2.2.29-$APACHE_MPM\/conf\/httpd.conf\r\nsed -i s\/\"Group daemon\"\/\"Group nobody\"\/ \/ffp\/opt\/apache-2.2.29-$APACHE_MPM\/conf\/httpd.conf\r\nmkdir \/ffp\/opt\/apache-2.2.29-$APACHE_MPM\/conf-original\r\ncp -r \/ffp\/opt\/apache-2.2.29-$APACHE_MPM\/conf\/* \/ffp\/opt\/apache-2.2.29-$APACHE_MPM\/conf-original\r\ncp -v \/ffp\/libexec\/mod_authz_svn.so \/ffp\/opt\/apache-2.2.29-$APACHE_MPM\/modules\/\r\ncp -v \/ffp\/libexec\/mod_dav_svn.so \/ffp\/opt\/apache-2.2.29-$APACHE_MPM\/modules\/\r\nls -dl ~\/NSA310-backups\/*apache-modules*\r\ncp -v ~\/NSA310-backups\/2015-02-01\\ apache-modules\\ worker\/*.so \/ffp\/opt\/apache-2.2.29-$APACHE_MPM\/modules\/\r\nls -dl ~\/NSA310-backups\/*pagespeed*\r\ncp -v ~\/NSA310-backups\/2015-01-23\\ pagespeed\\ trunk\/*.so \/ffp\/opt\/apache-2.2.29-$APACHE_MPM\/modules\/\r\n\r\n#INFO\r\n#lists configured httpd modules:\r\n#\/usr\/sbin\/httpd -M -f \/etc\/service_conf\/httpd.conf\r\n#\/ffp\/opt\/apache-2.2.29-worker\/bin\/httpd -M -f \/etc\/service_conf\/xhttpd.conf\r\n#lists built-in httpd modules:\r\n#\/usr\/sbin\/httpd -l\r\n#\/ffp\/opt\/apache-2.2.29-worker\/bin\/httpd -l\r\n\r\n#owncloud, apache, php-zts and fcgid\r\n#If fcgid is not a shared module (--enable-mods-shared) than after logging off \r\n#from owncloud you won't be able to login again (you'll have to restart apache).\r\n#Does not have this problem when using php-non-zts.\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>#See https:\/\/adrhc.go.ro\/wordpress\/common-commands-when-building\/ for building environment, x.sh script and other things not defined here. #Before starting you must declare the environment variables specified at the link above. #building env vars (required when rebuilding too) APACHE_MPM=worker NEW_BUILD_NAME=apache NEW_BUILD_VER=2.2.29-$APACHE_MPM NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER ls -l \/tmp\/$NEW_BUILD_NAME-* [&hellip;]<\/p>\n<div class=\"link-more\"><a href=\"https:\/\/adrhc.go.ro\/blog\/compiling-apache-2-2-29\/#more-443\" class=\"more-link\">Continue reading &#10142; <span class=\"screen-reader-text\">Compiling Apache 2.2.29<\/span><\/a><\/div>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,11,163],"tags":[],"class_list":["post-443","post","type-post","status-publish","format-standard","hentry","category-compiling-from-source","category-linux","category-nsa310"],"_links":{"self":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/comments?post=443"}],"version-history":[{"count":0,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/443\/revisions"}],"wp:attachment":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/media?parent=443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/categories?post=443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/tags?post=443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}