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.gz
in/home/my_username
directory, obtaininghttpd-2.4.51
directory- Placed
apr-1.7.0.tar.gz
,apr-iconv-1.2.2.tar.gz
andapr-util-1.6.1.tar.gz
underhttpd-2.4.51/srclib/
andtar -xzvf
all of them - Renamed these unpacked APR directories by omitting their versions, e.g.
apr-util-1.6.1
toapr-util
withmv apr-util-1.6.1 apr-util
tar -xzvf pcre-8.45.tar.gz
in/home/my_username
directory, obtainingpcre-8.45
directorycd pcre-8.45
and./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.
/var/log/apache
directory? If so, the error log should have a detailed description for why it can’t start. Alternatively,/var/log/syslog
may have some details. If AppArmor is running on the VM, you’ll want to ensure the Apache directories you’re using are available to the service. – matigo Nov 03 '21 at 04:11