![]() ![]() You probably didn't install a web server just to see "It works!" in your browser. ![]() Launch Firefox and navigate to localhost:80 to see the Apache web server's default confirmation page. Test the serverįirst, test the server with a browser. You may need to adjust the zone value, depending on your distribution. $ sudo firewall-cmd -list-all -zone=public I'll assume you're using firewalld, so type the following commands to permit HTTP traffic into the server: $ sudo firewall-cmd -permanent -zone=public -add-service=http Now that the site is configured (and in a real-world situation, secured), it's time to open the firewall. To make your web server start automatically after a reboot, use the enable subcommand: $ sudo systemctl enable -now httpd Open port 80 Starting a service doesn't mean it will start automatically from now on. Use the systemctl command to start and enable the httpd service: $ sudo systemctl start httpd You've installed a web server, but you haven't started running it yet. In this case, use the standard port 80 for HTTP. The Listen directive simply indicates which port the service listens on. This article uses the standard location at /var/www/html. You may need to uncomment the DocumentRoot stanza. Use the search function in your editor to find the appropriate stanzas. These two values may already be set in that file, but confirm them to be sure: DocumentRoot /var/www/html Using your text editor of choice (mine is Vim, but Nano or others work just as well), open /etc/httpd/conf/nf. If your Linux distribution doesn't already include Apache, run the following command to install the package: $ sudo dnf install httpdĪdjust the command accordingly if you use a different package manager. To be production-ready, you must configure firewalls and audit your server settings. It's not suitable for internet-facing web servers. Note that this is a very basic test deployment. I'll begin with installation, then continue with editing a basic configuration file, creating a few documents, setting the firewall, and finally, testing the service. The steps below cover how to do that using the venerable Apache HTTP Server. How well do you know Linux? Take a quiz and get a badge.Linux system administration skills assessment.A guide to installing applications on Linux.Download RHEL 9 at no charge through the Red Hat Developer program.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |