Unable to build in arm64

#1
I have a machine on arm processor.

Code:
root@awp-1:~/prebuild/openlitespeed# uname -s
Linux
root@awp-1:~/prebuild/openlitespeed# uname -m
aarch64
root@awp-1:~/prebuild/openlitespeed# cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
root@awp-1:~/prebuild/openlitespeed#
I've followed the build.sh instruction to install ols: https://openlitespeed.org/kb/install-openlitespeed-from-source-with-build-script/

After build, I do not see bin openlitespeed getting generated.

Code:
root@awp-1:~/openlitespeed-1.7.14/dist/bin# ls
lswsctrl
So obviously openlitespeed will also be missing in serverroot/bin after running install.sh

Code:
root@awp-1:~# cd /usr/local/lsws/bin/
root@awp-1:/usr/local/lsws/bin# ls
litespeed  lshttpd  lsws_env  lswsctrl  lswsctrl.open
This is the error I see after executing build.sh

Code:
[ 59%] Built target lsquic
In file included from /root/openlitespeed-1.7.14/src/http/clientinfo.cpp:21:
/root/openlitespeed-1.7.14/src/http/iptoloc.h:28:10: fatal error: IP2Location.h: No such file or directory
   28 | #include "IP2Location.h"
      |          ^~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [src/http/CMakeFiles/http.dir/build.make:401: src/http/CMakeFiles/http.dir/clientinfo.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1080: src/http/CMakeFiles/http.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 61%] Built target lsiapi
make: *** [Makefile:130: all] Error 2
cp: cannot stat 'build/src/openlitespeed': No such file or directory
cp: cannot stat 'build/src/modules/modreqparser/*.so': No such file or directory
cp: cannot stat 'build/src/modules/modinspector/*.so': No such file or directory
cp: cannot stat 'build/src/modules/uploadprogress/*.so': No such file or directory
Start to pack files.
mv: cannot stat 'dist/install.sh': No such file or directory
Building finished, please run ./install.sh for installation.
You may want to update the ols.conf to change the settings before installation.
Enjoy.
Can we fix this compile issue in build.sh?
Also what is the alternative method to install ols in arm processor?

Thanks.
 
Last edited:

Cold-Egg

Administrator
#2
Looks ip2location does not compile properly. Maybe you can try to run the build script again.
Code:
/root/third-party/script/build_ip2loc.sh
Please try to fix the failure if any.
 
#4
And now running into problem with install.sh

Code:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package lsphp74
E: Unable to locate package lsphp74-mysql
E: Unable to locate package lsphp74-imap
E: Unable to locate package lsphp74-common
E: Unable to locate package lsphp74-curl
E: Unable to locate package lsphp74-json
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package lsphp74
E: Unable to locate package lsphp74-mysql
E: Unable to locate package lsphp74-imap
E: Unable to locate package lsphp74-common
E: Unable to locate package lsphp74-curl
E: Unable to locate package lsphp74-json
./_in.sh: 1: /usr/local/lsws/admin/fcgi-bin/admin_php: Exec format error
Generating key pair for web console login page, please wait ...
Generating RSA private key, 512 bit long modulus (2 primes)
.....................+++++++++++++++++++++++++++
.......+++++++++++++++++++++++++++
e is 65537 (0x010001)
/usr/local/lsws/admin/misc/create_admin_keypair.sh: 11: ../fcgi-bin/admin_php: Exec format error
chown: cannot access '/usr/local/lsws/admin/conf/jcryption_keypair': No such file or directory
chmod: cannot access '/usr/local/lsws/admin/conf/jcryption_keypair': No such file or directory
[OK] lshttpd.service has been successfully installed!
-e Updating webcache manager, please waiting ...
Downloading latest shared code tar file...
Checking tar file md5...
Removing existing shared code directory...
Extracting downloaded shared code...
Removing local shared code tar file...
Updating lscmctl script...
Done!

-e Installation finished, Enjoy!
Not being able to find lsphp is fine. Package does not exist for arm. I've flagged this here: https://forum.openlitespeed.org/threads/lsphp-for-arm.5074/

Exec format error is raised by admin_php. I am thinking this is compiled in x86 so complaining on arm machine.
 
#7
I believe admin_php is just a php binary executable compiled on x86 with a basic set of options. You can run ./admin_php -i to view the required configure options. Then you should probably be able to build one for ARM using these instructions to get you going.

Here's my output of ./admin_php -i

Code:
phpinfo()

PHP Version => 5.6.36

System => Linux 2a5060fc1c4e 5.10.47-linuxkit #1 SMP PREEMPT Sat Jul 3 21:50:16 UTC 2021 x86_64

Build Date => Jul 17 2018 18:38:48

Configure Command =>  './configure'  '--with-config-file-path=../conf' '--disable-all' '--with-litespeed' '--enable-session' '--enable-posix' '--enable-xml' '--with-libexpat-dir=../' '--with-zlib=../' '--enable-sockets' '--enable-bcmath' '--enable-json'
 
Top