O'Reilly logo

Learning Raspberry Pi by Samarth Shah

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Installing a web server

The first instinct may be to install Apache. However, nginx performs better on lower-end hardware. It should be noted that Apache can work just as well if the unnecessary plugins are removed and Apache is configured appropriately. For something that works fairly well out of the box, nginx is a great start.

  1. First, install nginx and php with an accelerator and a MySQL server with the following command:
    # apt-get install nginx php5-fpm php5-mysql php-apc mysql-server
    

    Note

    You will be prompted to set a password for MySQL; please make sure you remember it, as you will need it later.

  2. Then, start the nginx service:
    # service nginx start
    
  3. In order to ensure nginx is working, open up a browser and connect to the Raspberry Pi's IP. You ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required