AlmaLinux is a possible alternative for CentOS and is suitable with all CentOS providers and functions. AlmaLinux is a free open supply product with no licenses or restrictions and the present 8.three model is supported till 2029.
Guarantee you may have created a Linode account and Compute Occasion earlier than we begin, additionally set the timezone, configure hostname, create a restricted person account, and harden SSH entry.
Be sure to have put in AlmaLinux already to be able to proceed with the Apache set up. You may examine the GitHub web site for the directions to modify to AlmaLinux.
- To examine the present replace, use the dnf check-update If there’s any replace out there, replace the Linode. If any of the kernal elements are up to date, restart the Lionde.
sudo dnf check-update sudo dnf replace sudo reboot
- Now set up the Apache packages.
sudo dnf set up httpd httpd-tools
- After the set up, apache is not going to begin mechanically. Use the systemctl utility to begin and allow it.
sudo systemctl begin httpd sudo systemctl allow httpd
Created symlink /and many others/systemd/system/multi-user.goal.needs/httpd.service → /usr/lib/systemd/system/httpd.service.
- Examine the Apache standing through the use of systemctl standing It have to be in energetic state and show the operating states.
sudo systemctl standing httpd httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor prese> Energetic: energetic (operating) Docs: man:httpd.service(8) Important PID: 5933 (httpd) Standing: "Working, listening on: port 80"
Allow Apache connection to configure the AlmaLinux Firewall
By default, AlmaLinux comes with pre-installed and enabled firewall providers. Additional, some setup is required to allow Apache connection to cross by the firewall.
Bear in mind: You must maintain the firewall turned ON (Extremely advisable).
- Examine whether or not firewalld is already enabled or not.
sudo systemctl standing firewalld
firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor p> Energetic: energetic (operating)
- To permit Apache HTTP and HTTPS connections through the firewall, add the foundations.
sudo firewall-cmd --zone=public --add-service=http --permanent sudo firewall-cmd --zone=public --add-service=https --permanent
- Now restart firewalld to use the adjustments.
sudo firewall-cmd --reload
- Verify the registration of the appliance.
sudo firewall-cmd --list-all
public (energetic) goal: default ... providers: cockpit dhcpv6-client http https ssh ...
- sudo systemctl begin firewalld – To restart the firewall
- sudo systemctl cease firewalld – To quickly disable the firewall
- sudo systemctl disable firewalld.- To completely disable the firewall
Along with firewalld, AlmaLinux can be pre-installed with the safety software SELinux. In some circumstances, the 2 functions could not work collectively. To confirm the standing of SELinux through the use of the command – sestatus and for debugging course of, SELinux may be quickly disabled utilizing the command – sudo setenforce 0.
Examine the Apache Net Server and Host a Net Web page
- Make sure that the Apache server is working correctly and utilizing an internet browser, examine the IP deal with of Linode. You’ll get the AmlaLinux take a look at web page you probably have configured every part correctly.
- The default internet web page location for the server is /var/www/html. In case your web site has a house web page, copy index.html into the var/www/html listing.
Be aware: Create an index.html file within the /var/www/html listing if you don’t have already got one. It confirms that the online server web page is serving from this listing.
cp path-to-home-page/index.html /var/www/html
- This listing internet entry is blocked by the SELinux configuration. To replace the listing’s safety context, use the command chcon to make sure the online web page is accessible.
chcon -R -t httpd_sys_rw_content_t /var/www/html
- Once more, navigate to the IP deal with of the Linode. At this level, the content material of the house web page in your area needs to be seen.
To get extra updates you’ll be able to comply with us on Fb, Twitter, LinkedIn
Subscribe to get free weblog content material to your Inbox