apache2nginx
apache2nginx copied to clipboard
Segmentation fault (core dumped)
Segmentation fault (core dumped) when running apache2nginx -f /var/apache2/conf/httpd.conf
+1 Running Mac OS X Mavericks. From what I have been reading. It would appear that the program has a bug in it. I had to compile and run it the my local hardware. I am unsure if my machine's hardware is the root of the issue or the source code itself.
Ok. Upon further investigation I was able to get this tool to work. The caveat is that it has to run on a Ubuntu server or unix server. Even then I still have to compile from source and install it in /usr/local/apache2nginx
as per the project page documentation. As a Mac OS X user, without a Ubuntu server ready, I had to leverage a local virtual Ubuntu server via Vagrant to convert my apache configurations. I know this isn't a solution to the problem above, but an alternative for others who might land here.
tl;dr
- Use Vagrant to create an Ubuntu server.
- Sync your Apache confs that you want to convert onto that same server.
- Install apache2nginx via source (Main project page provides docs to do this).
- Use
apache2nginx
to convert your confs to be nginx compliant.
Tried on a Majaro system and got a core dump. What does ubuntu have that is missing in manjaro?
also getting segfault on ubuntu
It indeed segfaults:
#0 0x00007fa44ab51676 in strlen () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x000055c4c2575a27 in apr_pstrdup (a=a@entry=0x55c4c4272128, s=0xffffffffc42728e8 <error: Cannot access memory at address 0xffffffffc42728e8>)
at strings/apr_strings.c:77
#2 0x000055c4c257a1e8 in apr_get_basedir (resolved_dir=0x7ffcf5f27ee0, filename=
I have a fork that works, updated apr and included Reeds mods
https://github.com/gaby64/apache2nginx
I have a fork that works, updated apr and included Reeds mods
@gaby64 even using your repo, I kept getting libtool generated with CRLF issues (^M).
Running a recursive dos2unix -f
got me a fixed libtool, and consequently a proper configure
stage.
However, the end result is a compiled and working binary. Thanks!
I have a fork that works, updated apr and included Reeds mods
@gaby64 even using your repo, I kept getting libtool generated with CRLF issues (^M). Running a recursive
dos2unix -f
got me a fixed libtool, and consequently a properconfigure
stage.However, the end result is a compiled and working binary. Thanks!
that might be an issue with your git config, I cloned my repo an had no issue on Ubuntu 18.10
running file -- *
shows no file with crlf endings
This is Sooo broken.
(gdb) run -f 2.conf Starting program: apache2nginx -f 2.conf [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
__strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:93
93 ../sysdeps/x86_64/multiarch/strlen-avx2.S: No such file or directory.
(gdb) bt
#0 __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:93
#1 0x0000555555634a97 in apr_pstrdup (a=a@entry=0x5555556b1378,
s=0x556b1b38 <error: Cannot access memory at address 0x556b1b38>)
at strings/apr_strings.c:77
#2 0x0000555555639097 in apr_get_basedir (resolved_dir=0x7fffffffe0a0,
filename=
Was wishing this would work, tried everything that was commented here, was able to compile and run on ubuntu, but also got Seg Fault. Might need to write my own in java, stay tuned.
I have a fork that works, updated apr and included Reeds mods
https://github.com/gaby64/apache2nginx
Hi gaby64 -- How can I build your solution? The READ.ME file on your fork is identical to the original -- so the the same files will be compiled.
Thank you
download source files from my fork ./configure make && make install
download source files from my fork ./configure make && make install
Thank you for the help .. making progress -- I am now getting the error message
bin/bash /tmp/apache2nginx/srclib/apr/libtool --silent --mode=compile gcc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/tmp/apache2nginx/srclib/apr-util/include -I/tmp/apache2nginx/srclib/apr-util/include/private -I/tmp/apache2nginx/srclib/apr/include -o xml/apr_xml.lo -c xml/apr_xml.c && touch xml/apr_xml.lo xml/apr_xml.c:35:10: fatal error: expat.h: No such file or directory #include <expat.h> ^~~~~~~~~ compilation terminated.
run buildconf
run buildconf
Okay .. I had to install libtool and buildconf ran without errors .. then I did ./configure make && make install
resulting in this error
/bin/bash /tmp/apache2nginx/srclib/apr/libtool --silent --mode=compile gcc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/tmp/apache2nginx/srclib/apr-util/include -I/tmp/apache2nginx/srclib/apr-util/include/private -I/tmp/apache2nginx/srclib/apr/include -o xml/apr_xml.lo -c xml/apr_xml.c && touch xml/apr_xml.lo xml/apr_xml.c:35:10: fatal error: expat.h: No such file or directory #include <expat.h> ^~~~~~~~~ compilation terminated. /tmp/apache2nginx/srclib/apr-util/build/rules.mk:206: recipe for target 'xml/apr_xml.lo' failed make[3]: *** [xml/apr_xml.lo] Error 1 make[3]: Leaving directory '/tmp/apache2nginx/srclib/apr-util' /tmp/apache2nginx/srclib/apr-util/build/rules.mk:118: recipe for target 'all-recursive' failed make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory '/tmp/apache2nginx/srclib/apr-util' /tmp/apache2nginx/build/rules.mk:72: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/tmp/apache2nginx/srclib' /tmp/apache2nginx/build/rules.mk:72: recipe for target 'all-recursive' failed make: *** [all-recursive] Error 1
install expat lib or package for your distro
please do the research, I only intended to provide patched code that worked for me, not compile support. it may not even work anymore, I could check tomorrow.
I got it running ... the config files of the latest apache2 server is largely unconvertable, numerous messages in the new conf file . Worse yet the .htaccess files in word press site can be enormous which presents a new conversion issue.
I am sorry for the intrusion and thank you for your help.
I am going to start from scratch --
On Sun, Nov 3, 2019 at 5:45 PM gaby64 [email protected] wrote:
install expat lib or package for your distro
please do the research, I only intended to provide patched code that worked for me, not compile support. it may not even work anymore, I could check tomorrow.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lide-reed/apache2nginx/issues/3?email_source=notifications&email_token=ABHAO5V54IUS7NLHCSQSS7LQR5A6HA5CNFSM4AO56IRKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC564HY#issuecomment-549187103, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHAO5VJP3QOVLRHSPEGKDLQR5A6HANCNFSM4AO56IRA .