{"id":2834,"date":"2019-05-06T21:04:57","date_gmt":"2019-05-06T18:04:57","guid":{"rendered":"https:\/\/kifarunix.com\/?p=2834"},"modified":"2019-05-06T21:08:24","modified_gmt":"2019-05-06T18:08:24","slug":"install-nginx-web-server-on-fedora-30","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-nginx-web-server-on-fedora-30\/","title":{"rendered":"Install Nginx Web Server on Fedora 30"},"content":{"rendered":"\n
In this guide, we are going to discuss how to install Nginx web server on Fedora 30. Nginx<\/a>, commonly pronounced as Engin<\/strong>e ex<\/strong>, is an open-source, high-performance HTTP server. It can also function as a load balancer, reverse proxy, as well as an IMAP\/POP3 proxy server. <\/p>\n\n\n\n Nginx is available on the default Fedora repositories and hence can be installed directly using the DNF package manager.<\/p>\n\n\n\n Well, once the installation of Nginx is done, it is time to start it. However, if you have Apache installed and running on the same server, you need to stop and disable it from running so that you can use Nginx instead.<\/p>\n\n\n\n Nginx can be started by executing the command;<\/p>\n\n\n\n If you need your Nginx HTTP server to run by default every time your server reboots, then you need to run this command;<\/p>\n\n\n\n Check the status of Nginx<\/p>\n\n\n\n If you are running firewalld (running by default on Fedora 30) you need to allow Nginx through it to make accessible from outside the localhost.<\/p>\n\n\n\n Next, navigate to the web browser and test if you can access Nginx web server via the http:\/\/<hostname-or-server-IP-address><\/strong>. If all is well, this will land you on Fedora Nginx test page.<\/p>\n\n\n\n Well, you are good to go. You can now perform any web server configurations to suit your needs. Cheers.<\/p>\n\n\n\n You can also check our previous guide on installing Apache web server on Fedora 30.<\/p>\n\n\n\nInstall Nginx Web Server on Fedora 30<\/h2>\n\n\n\n
dnf install nginx<\/code><\/pre>\n\n\n\n
Last metadata expiration check: 0:00:30 ago on Mon 06 May 2019 06:36:34 PM EAT.\nDependencies resolved.\n=======================================================================================================================================================\n Package Architecture Version Repository Size\n=======================================================================================================================================================\nInstalling:\n nginx x86_64 1:1.16.0-1.fc30 updates 551 k\nUpgrading:\n nginx-filesystem noarch 1:1.16.0-1.fc30 updates 10 k\nInstalling dependencies:\n gperftools-libs x86_64 2.7-5.fc30 fedora 287 k\n libunwind x86_64 1.3.1-2.fc30 fedora 63 k\n nginx-mimetypes noarch 2.1.48-5.fc30 fedora 20 k\n\nTransaction Summary\n=======================================================================================================================================================\nInstall 4 Packages\nUpgrade 1 Package\n\nTotal download size: 931 k\nIs this ok [y\/N]: y<\/code><\/pre>\n\n\n\n
Running Nginx<\/h2>\n\n\n\n
Disable Apache (if installed)<\/h3>\n\n\n\n
systemctl stop httpd
systemctl disable httpd<\/code><\/pre>\n\n\n\nStart Nginx <\/h3>\n\n\n\n
systemctl start nginx<\/code><\/pre>\n\n\n\n
Enable Nginx to run on system boot.<\/h3>\n\n\n\n
systemctl enable nginx<\/code><\/pre>\n\n\n\n
systemctl status nginx<\/code><\/pre>\n\n\n\n
\u25cf nginx.service - The nginx HTTP and reverse proxy server\n Loaded: loaded (\/usr\/lib\/systemd\/system\/nginx.service; enabled; vendor preset: disabled)\n Drop-In: \/usr\/lib\/systemd\/system\/nginx.service.d\n \u2514\u2500php-fpm.conf\n Active: active (running) since Mon 2019-05-06 18:45:25 EAT; 2min 13s ago\n Main PID: 25811 (nginx)\n Tasks: 2 (limit: 1144)\n Memory: 2.5M\n CGroup: \/system.slice\/nginx.service\n \u251c\u250025811 nginx: master process \/usr\/sbin\/nginx\n \u2514\u250025812 nginx: worker process\n\nMay 06 18:45:24 fedora30.example.com systemd[1]: Starting The nginx HTTP and reverse proxy server...\nMay 06 18:45:25 fedora30.example.com nginx[25809]: nginx: [warn] could not build optimal types_hash, you should increase either types_hash_max_size: 2>\nMay 06 18:45:25 fedora30.example.com nginx[25809]: nginx: the configuration file \/etc\/nginx\/nginx.conf syntax is ok\nMay 06 18:45:25 fedora30.example.com nginx[25809]: nginx: configuration file \/etc\/nginx\/nginx.conf test is successful\nMay 06 18:45:25 fedora30.example.com nginx[25810]: nginx: [warn] could not build optimal types_hash, you should increase either types_hash_max_size: 2>\nMay 06 18:45:25 fedora30.example.com systemd[1]: nginx.service: Failed to parse PID from file \/run\/nginx.pid: Invalid argument\nMay 06 18:45:25 fedora30.example.com systemd[1]: Started The nginx HTTP and reverse proxy server.<\/code><\/pre>\n\n\n\n
Allow Nginx on Firewalld<\/h3>\n\n\n\n
firewall-cmd --add-service={http,https} --permanent
firewall-cmd --reload<\/code><\/pre>\n\n\n\nTesting Nginx<\/h3>\n\n\n\n
<\/a><\/figure>\n\n\n\n