Score:0

Can't Start Apache After Manual Installation on Ubuntu 20.04

cn flag
NiC

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.

in flag
Do you have a `/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.
gb flag
are you using sudo at the beginning of each command? in other words, are the commands running as super user? ex: sudo systemctl start apache2
N0rbert avatar
zw flag
Does this answer your question? [How can I install software or packages without Internet (offline)?](https://askubuntu.com/questions/974/how-can-i-install-software-or-packages-without-internet-offline)
Score:0
us flag

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
Score:0
in flag

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

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

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.