![]() ![]() We can install Nginx and the PHP packages with apt-get: ![]() On Ubuntu 12.04 LTS and later, we won’t need to add any repositories to install Nginx, because Nginx is a supported package. $ sudo service apache2 stop $ sudo update-rc.d apache2 disable Installing Nginx on Ubuntuįirst, let’s stop Apache if it’s running and set it to not start at boot: Once the service is started, you should be able to point a Web browser to the IP address of your system and see the default “Welcome to Nginx!” page. That’s normal and won’t impact Nginx.Īfter installation, we can start Nginx and make sure it’s running: This will install everything we need including Apache updates due to some dependencies. # yum -enablerepo=remi,remi-test install nginx php-fpm php-common php-mysqlnd Thus, for Fedora 20, you would run the following: Now, substitute your release in the following line for : The above command will install everything we need to run PHP through Nginx including the PHP-FPM CGI handler. # yum -enablerepo=remi install nginx php-fpm php-common If you want to enable the Remi repository globally, edit /etc//remi.repo and set enabled=1 for the repository. Now, we enable the Remi repository for this installation only, and install the packages we need. To do this, we need to install the EPEL (Extra Packages for Enterprise Linux) and Remi repositories for our release version and architecture. # systemctl stop rvice # disable rviceĮither way, these commands will stop Apache if it’s running and prevent it from starting during a reboot. Those commands should work on all Fedora and CentOS releases, but on later releases using system, you should use the systemd commands: # service httpd stop # chkconfig httpd off Now let’s stop Apache and make sure it doesn’t start at boot: We do that on most Fedora and CentOS installations via the following commands, run as root or with sudo: So let’s make sure Apache isn’t running or set to run at startup. Nginx can run even while Apache is installed on the same system, but we need to make sure Apache is not running at the same time, or at least on the same ports. In addition, we’ll install PHP-FPM to handle dynamic PHP content. In this how-to, we’ll show you how to get started with Nginx on Fedora, CentOS, and Ubuntu Linux distributions. It's used to serve content for many extremely large-volume websites. Both versatile and extremely fast, Nginx generally performs faster than Apache right out of the box, especially when serving static content or acting as a reverse proxy server. Although the most popular Web server in the world is still Apache, Nginx is cutting into that market share in a very significant way. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |