{"id":117,"date":"2014-10-14T18:13:29","date_gmt":"2014-10-14T18:13:29","guid":{"rendered":"http:\/\/adrhc.go.ro\/wordpress\/?p=117"},"modified":"2017-10-07T17:26:08","modified_gmt":"2017-10-07T15:26:08","slug":"compiling-apache-2-2-9","status":"publish","type":"post","link":"https:\/\/adrhc.go.ro\/blog\/compiling-apache-2-2-9\/","title":{"rendered":"Compiling Apache 2.2.9"},"content":{"rendered":"<pre class=\"brush:bash shell; toolbar: false\">rm -r ~\/compile\/httpd-2.2.9-unpacked\r\ncd ~\/compile &amp;&amp; mkdir httpd-2.2.9-unpacked\r\ntar xvzf httpd-2.2.9.tar.gz -C .\/httpd-2.2.9-unpacked\r\ncd ~\/compile\/httpd-2.2.9-unpacked\/httpd-2.2.9\r\n\r\nfind . -type f \\( -exec sed -i s\/\"\\\/usr\\\/bin\\\/bash\"\/\"\\\/ffp\\\/bin\\\/bash\"\/ {} \\; , -exec sed -i s\/\"\\\/usr\\\/bin\\\/sh\"\/\"\\\/ffp\\\/bin\\\/sh\"\/ {} \\; , -exec sed -i s\/\"\\\/usr\\\/bin\\\/env\"\/\"\\\/ffp\\\/bin\\\/env\"\/ {} \\; , -exec sed -i s\/\"\\\/bin\\\/bash\"\/\"\\\/ffp\\\/bin\\\/bash\"\/ {} \\; , -exec sed -i s\/\"\\\/bin\\\/sh\"\/\"\\\/ffp\\\/bin\\\/sh\"\/ {} \\; , -exec sed -i s\/\"\\\/bin\\\/env\"\/\"\\\/ffp\\\/bin\\\/env\"\/ {} \\; , -exec sed -i s\/\"\\\/ffp\\\/ffp\\\/\"\/\"\\\/ffp\\\/\"\/ {} \\; \\)\r\n.\/configure --help &gt; ..\/configure.help.txt\r\n\r\nDe modificat in \"configure.in\" si \"configure\" (cauta: 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)' -&gt; comenteaza (nu exista shlibtool)\r\n\t\t  SH_LIBTOOL='\/ffp\/lib\/apr-1.4.8\/build-1\/libtool $(LTFLAGS)' -&gt; to add\r\n\t\t  SHLTCFLAGS=\"\"\r\n\t\t  LTCFLAGS=\"\"\r\n\t\t  ;;\r\n  esac\r\n\r\n#start from here when rebuilding\r\ncd ~\/compile\/httpd-2.2.9-unpacked\/httpd-2.2.9\r\nrm -r ..\/httpd-2.2.9-build\r\nmkdir ..\/httpd-2.2.9-build\r\ncd ..\/httpd-2.2.9-build\r\n#export CFLAGS=\"-march=armv5te -mtune=xscale -mfloat-abi=soft -mfpu=vfp -mabi=aapcs-linux -lintl -Wall\"\r\nexport LDFLAGS=\"-L\/ffp\/lib -lintl\"\r\nexport CPPFLAGS=\"-I\/ffp\/include -I\/ffp\/include\/readline\"\r\nexport CXXFLAGS=\"-I\/ffp\/include -I\/ffp\/include\/readline\"\r\nexport CFLAGS=\"-march=armv5te -mtune=xscale -mfloat-abi=soft -mabi=aapcs-linux -O2 -lintl -Wall -D_APACHE_MPM_DIR=\\\"server\/mpm\/prefork\\\" -D_APR_HAS_SENDFILE -D_APR_HAS_MMAP -D_APR_HAVE_IPV6 -D_APR_USE_SYSVSEM_SERIALIZE -D_APR_USE_PTHREAD_SERIALIZE -D_SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D_APR_HAS_OTHER_CHILD -D_AP_HAVE_RELIABLE_PIPED_LOGS -D_DYNAMIC_MODULE_LIMIT=128 -D_HTTPD_ROOT=\\\"\/ffp\/opt\/apache-2.2.9\\\" -D_SUEXEC_BIN=\\\"\/ffp\/opt\/apache-2.2.9\/bin\/suexec\\\" -D_DEFAULT_PIDLOG=\\\"logs\/httpd.pid\\\" -D_DEFAULT_SCOREBOARD=\\\"logs\/apache_runtime_status\\\" -D_DEFAULT_LOCKFILE=\\\"logs\/accept.lock\\\" -D_DEFAULT_ERRORLOG=\\\"logs\/error_log\\\" -D_AP_TYPES_CONFIG_FILE=\\\"conf\/mime.types\\\" -D_SERVER_CONFIG_FILE=\\\"conf\/httpd.conf\\\"\"\r\n#export CFLAGS=\"-march=armv5te -mfloat-abi=soft -mfpu=vfp -mabi=aapcs-linux -O2 -lintl -Wall -D_APACHE_MPM_DIR=\\\"server\/mpm\/prefork\\\" -D_APR_HAS_SENDFILE -D_APR_HAS_MMAP -D_APR_HAVE_IPV6 -D_APR_USE_SYSVSEM_SERIALIZE -D_APR_USE_PTHREAD_SERIALIZE -D_SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D_APR_HAS_OTHER_CHILD -D_AP_HAVE_RELIABLE_PIPED_LOGS -D_DYNAMIC_MODULE_LIMIT=128 -D_HTTPD_ROOT=\\\"\/ffp\/opt\/apache-2.2.9\\\" -D_SUEXEC_BIN=\\\"\/ffp\/opt\/apache-2.2.9\/bin\/suexec\\\" -D_DEFAULT_PIDLOG=\\\"logs\/httpd.pid\\\" -D_DEFAULT_SCOREBOARD=\\\"logs\/apache_runtime_status\\\" -D_DEFAULT_LOCKFILE=\\\"logs\/accept.lock\\\" -D_DEFAULT_ERRORLOG=\\\"logs\/error_log\\\" -D_AP_TYPES_CONFIG_FILE=\\\"conf\/mime.types\\\" -D_SERVER_CONFIG_FILE=\\\"conf\/httpd.conf\\\"\"\r\n\r\n#firmware apache configuration + dav_svn\r\n#..\/httpd-2.2.9\/configure --prefix=\/ffp\/opt\/apache-2.2.9-prefork --with-mpm=prefork --with-ssl=\/ffp\/opt\/openssl-0.9.8y --enable-modules=\"authn_file authn_default authz_host authz_groupfile authz_user authz_default auth_basic include filter log_config env headers setenvif ssl http mime status autoindex asis cgi negotiation dir actions userdir alias\" --enable-mods-shared=\"rewrite proxy proxy_httpd dav dav_fs dav_svn\"\r\n\r\n#configuration for a lot of shared libraries\r\n..\/httpd-2.2.9\/configure --prefix=\/ffp\/opt\/apache-2.2.9 --enable-so --with-mpm=prefork --with-z=\/ffp --with-pcre=\/ffp --with-apr=\/ffp --with-apr-util=\/ffp --enable-mods-shared=all --enable-dav --enable-proxy --enable-proxy-ajp --enable-cgi --enable-rewrite --enable-ssl --with-ssl=\/ffp\/opt\/openssl-0.9.8y --enable-cache --enable-file-cache --enable-disk-cache --enable-mem-cache\r\n\r\n#nohup \/ffp\/bin\/make -C ~\/compile\/httpd-2.2.9-unpacked\/httpd-2.2.9-build V=1 &amp;\r\nnohup \/ffp\/bin\/make -C ~\/compile\/httpd-2.2.9-unpacked\/httpd-2.2.9-build &amp;\r\nrenice -14 `pidof cc1plus` -p `pidof make` -p `pidof as`\r\ntail -f nohup.out\r\n#make install DESTDIR=\/ffp\/opt\/apache-2.2.9\/\r\n#Running make -n permits previewing the build process, as it prints out all the commands that would be triggered by a make, without actually executing them.\r\n#make -n install\t\r\nrm -r \/ffp\/opt\/apache-2.2.9\r\nmake install\r\n#\/ffp\/opt\/apache-2.2.9\/bin\/apxs -q sbindir -&gt; daca afiseaza si \/ffp\/opt\/apache-2.2.9\/bin atunci e ok \r\nsed -i s\/\"User daemon\"\/\"User nobody\"\/ \/ffp\/opt\/apache-2.2.9\/conf\/httpd.conf\r\nsed -i s\/\"Group daemon\"\/\"Group nobody\"\/ \/ffp\/opt\/apache-2.2.9\/conf\/httpd.conf\r\nmkdir \/ffp\/opt\/apache-2.2.9\/conf-original\r\ncp -r \/ffp\/opt\/apache-2.2.9\/conf\/* \/ffp\/opt\/apache-2.2.9\/conf-original\r\n\r\n#diff -r -i -b -B --brief \/ffp\/opt\/apache-2.2.9-19.08.2014\/modules\/ \/ffp\/opt\/apache-2.2.9\/modules\/ &gt; diff.txt\r\ncp -v \/ffp\/opt\/svn185\/libexec\/mod_authz_svn.so \/ffp\/opt\/apache-2.2.9\/modules\/\r\ncp -v \/ffp\/opt\/svn185\/libexec\/mod_dav_svn.so \/ffp\/opt\/apache-2.2.9\/modules\/\r\nls -dl ~\/NSA310-backups\/*apache-modules*\r\ncp -v ~\/NSA310-backups\/2014-08-19\\ apache-modules\/*.so \/ffp\/opt\/apache-2.2.9\/modules\/\r\ncp -v ~\/NSA310-backups\/2014-08-19\\ apache-modules\/passwords \/ffp\/opt\/apache-2.2.9\/\r\nls -dl ~\/NSA310-backups\/*pagespeed*\r\ncp -v ~\/NSA310-backups\/2014-10-15\\ pagespeed\\ trunk\/*.so \/ffp\/opt\/apache-2.2.9\/modules\/\r\n\r\n#tar cfJv apache-2.2.9.txz \/ffp\/opt\/apache-2.2.9 -&gt; simply archive\r\nrm -r ~\/temp\/apache-2.2.9\r\nmkdir -p ~\/temp\/apache-2.2.9\/ffp\/opt\/\r\ncp -r \/ffp\/opt\/apache-2.2.9 ~\/temp\/apache-2.2.9\/ffp\/opt\/\r\nrm ~\/temp\/apache-2.2.9\/ffp\/opt\/apache-2.2.9\/passwords\r\ncd ~\/temp\/apache-2.2.9\r\n#makepkg apache version buildnumber\r\n#package as ffp package\r\nmakepkg apache 2.2.9 1\r\ncp -v \/tmp\/apache-2.2.9-arm-1.txz ~\/ffp_0.7_armv5\r\n\r\n#How does it work ?\r\n#For example in order to make SVN to work you'll need to start firmware-apache-httpd (instead of the newly compiled httpd) with a similar configuration:\r\n#SVN (dav) modules order is important: dav_svn_module before authz_svn_module.\r\nLoadFile\t\/ffp\/lib\/ld-uClibc.so.0\r\nLoadFile\t\/ffp\/lib\/libc.so.0\r\nLoadModule\tdav_module \t\t\t\/ffp\/opt\/apache-2.2.9-prefork\/modules\/mod_dav.so\r\nLoadFile\t\/ffp\/lib\/libapr-1.so.0\r\nLoadFile\t\/ffp\/lib\/libintl.so.8\r\n#I have no idea why libmagic.so.1 is required by mod_dav_svn.so.\r\nLoadFile\t\/ffp\/lib\/libmagic.so.1\r\nLoadFile\t\/ffp\/lib\/libsqlite3-3.7.17.so.0\r\nLoadFile\t\/ffp\/lib\/libcrypt.so.0\r\nLoadFile\t\/ffp\/lib\/libm.so.0\r\nLoadFile\t\/ffp\/lib\/libdl.so.0\r\nLoadFile\t\/ffp\/lib\/librt.so.0\r\nLoadModule\tdav_svn_module \t\t\/ffp\/opt\/subversion-1.8.5\/libexec\/mod_dav_svn.so\r\nLoadModule\tauthz_svn_module \t\/ffp\/opt\/subversion-1.8.5\/libexec\/mod_authz_svn.so\r\n#The main idea is to find which libraries are needed at runtime and then to include them whith LoadFile directive.\r\n#In order to find required libraries you'll use:\r\n#\tldd -d \/ffp\/opt\/apache-2.2.9-prefork\/modules\/mod_dav.so\r\n#or\r\n#\treadelf -d \/ffp\/opt\/apache-2.2.9-prefork\/modules\/mod_dav.so\r\n\r\n#For other modules you'll have to follow the approach above in order to find the required libraries.\r\n\r\n#The SVN + firmware-apache configuration:\r\n#You'll need to have \"AuthZyxelSkipPattern \/svnrepository ...\" in \/etc\/service_conf\/httpd.conf.\r\n#Append the below configuration before &lt;\/VirtualHost> in \/etc\/service_conf\/http_zld.conf.\r\n#Create \/ffp\/etc\/svnrepository-auth.htpasswd and \/ffp\/etc\/svnrepository-authz files (read subversion documentation).\r\n&lt;Location \/svnrepository>\r\n\tHeader set X-UA-Compatible \"IE=edge\"\r\n\tDAV svn\r\n\tSVNParentPath \/e-data\/SVNRepoLinux\r\n\tSVNListParentPath on\r\n\tAuthName \"Subversion repository\"\r\n\tAuthType Basic\r\n\tAuthUserFile \/ffp\/etc\/svnrepository-auth.htpasswd\r\n\tRequire valid-user\r\n\tSVNPathAuthz on\r\n\tAuthzSVNAccessFile \/ffp\/etc\/svnrepository-authz\r\n&lt;\/Location>\r\n#Browse to https:\/\/your-firmware-apache-host\/svnrepository\/ in order to see your SVN repositories.\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>rm -r ~\/compile\/httpd-2.2.9-unpacked cd ~\/compile &amp;&amp; mkdir httpd-2.2.9-unpacked tar xvzf httpd-2.2.9.tar.gz -C .\/httpd-2.2.9-unpacked cd ~\/compile\/httpd-2.2.9-unpacked\/httpd-2.2.9 find . -type f \\( -exec sed -i s\/&#8221;\\\/usr\\\/bin\\\/bash&#8221;\/&#8221;\\\/ffp\\\/bin\\\/bash&#8221;\/ {} \\; , -exec sed -i s\/&#8221;\\\/usr\\\/bin\\\/sh&#8221;\/&#8221;\\\/ffp\\\/bin\\\/sh&#8221;\/ {} \\; , -exec sed -i s\/&#8221;\\\/usr\\\/bin\\\/env&#8221;\/&#8221;\\\/ffp\\\/bin\\\/env&#8221;\/ {} \\; [&hellip;]<\/p>\n<div class=\"link-more\"><a href=\"https:\/\/adrhc.go.ro\/blog\/compiling-apache-2-2-9\/#more-117\" class=\"more-link\">Continue reading &#10142; <span class=\"screen-reader-text\">Compiling Apache 2.2.9<\/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-117","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\/117","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=117"}],"version-history":[{"count":0,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/117\/revisions"}],"wp:attachment":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/media?parent=117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/categories?post=117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/tags?post=117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}