My vm is within a closed network so I cannot use apt install apache2. Instead, I installed manually by the following steps:
tar -xzvf httpd-2.4.51.tar.gzin/home/my_usernamedirectory, obtaininghttpd-2.4.51directory- Placed
apr-1.7.0.tar.gz,apr-iconv-1.2.2.tar.gzandapr-util-1.6.1.tar.gzunderhttpd-2.4.51/srclib/andtar -xzvfall of them - Renamed these unpacked APR directories by omitting their versions, e.g.
apr-util-1.6.1toapr-utilwithmv apr-util-1.6.1 apr-util tar -xzvf pcre-8.45.tar.gzin/home/my_usernamedirectory, obtainingpcre-8.45directorycd pcre-8.45and./configure --prefix=/usr/local/pcre; make; make install- Finally installed Apache by
./configure --prefix=/usr/local/apache2 --with-pcre=/usr/local/pcre; make; make install
I checked the /usr/local/apache2 folder, everything seemed fine. But when I tried to start Apache with systemctl start apache2, cmd said Failed to start apache2.service: Unit apache2.service not found.. Is it possible that the device cannot recognize Apache even after installation, or should I register Apache as Linux service something? Most solutions on the net assume using the apt install apache2 approach and the system will handle all the required stuff at the back. For my case, I believe I have missed some configuration settings so I've been stuck here. Any suggestions are welcomed.