0

My vm is within a closed network so I cannot use apt install apache2. Instead, I installed manually by the following steps:

  1. tar -xzvf httpd-2.4.51.tar.gz in /home/my_username directory, obtaining httpd-2.4.51 directory
  2. Placed apr-1.7.0.tar.gz, apr-iconv-1.2.2.tar.gz and apr-util-1.6.1.tar.gz underhttpd-2.4.51/srclib/ and tar -xzvf all of them
  3. Renamed these unpacked APR directories by omitting their versions, e.g. apr-util-1.6.1 to apr-util with mv apr-util-1.6.1 apr-util
  4. tar -xzvf pcre-8.45.tar.gz in /home/my_username directory, obtaining pcre-8.45 directory
  5. cd pcre-8.45 and ./configure --prefix=/usr/local/pcre; make; make install
  6. 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.

NiC
  • 3
  • 1
  • 2

2 Answers2

0

Try downloading the .deb package for your distro and installing it dpkg. (e.g. dpkg -i package.deb)

source: https://pkgs.org/download/apache2

0

Without internet access, it is very difficult to build apache2 with all the dependencies. Alternative option: Install Ubuntu 20.04 with internet access(you can use Ubuntu 20.04 live iso running from usb).

Run in the terminal mkdir ${HOME}/apache2 && cd apache2

Reading the answers https://askubuntu.com/search?q=recursively+list+dependencies

Download the packages to the apache2 folder
apt-get download $(apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances apache2 | grep "^\w" |grep -v "i386" | sort -u)
grep -v "i386" (To ignore the i386 ones)

Copy the apache2 folder to a vm without the Internet.

In the apache2 folder, run sudo dpkg -i *.deb in the terminal
Johan Palych
  • 1,361
  • 8
  • 9