Hero Image

Install Apache HTTP Server on Gentoo Linux

Install Apache HTTP Server on Gentoo Linux

Step 1 – Install Apache

emerge --sync
emerge --ask www-servers/apache

Step 2 – Start and enable the service

rc-update add apache2 default && rc-service apache2 start

Step 3 – Open firewall ports

iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 443 -j ACCEPT

Step 4 – Verify

curl -I http://localhost

The main configuration file is /etc/apache2/httpd.conf and virtual-host definitions belong in /etc/apache2/vhosts.d/.

Apache version

apachectl -v