Results 1 to 9 of 9

Thread: HOW TO: Use Ubuntu as a LLMP Web Server with Cacti (part 4/4)

  1. #1
    Join Date
    Feb 2007
    Beans
    Hidden!

    HOW TO: Use Ubuntu as a LLMP Web Server with Cacti

    This guide will show you (yes show, it has pictures) how to configure a standard Ubuntu 7.10 install to act as a LLMP (Linux Lighttpd MySQL PHP) server. I will also show you how to install the Cacti statistics and server status software package.

    Right away, open up a terminal (Applications > Accessories > Terminal) as everything we do will be in the terminal

    First, make sure you have set the password to your root account. If you have not, do:
    Code:
    $ sudo passwd root
    You will be asked to type in a root password, so come up with a password for the 'root' account and press enter. Confirm the password, press enter again, and your set.

    Now that your root password is set, do:
    Code:
    $ su -
    Password
    And you should be at a prompt that looks something like this (note the # sign):


    Now we will want to update our apt-get packages. Apt-get is the Ubuntu/Debian Package Delivery System for installing new packages from remote servers onto your system. Run:
    Code:
    # apt-get update
    And you should see output similar to below:


    Installing the Lighttpd Web Server

    Your output may be more elaborate if you have never run apt-get update before but it will be relatively the same. Now that we are all up to date, we will install the Lighttpd web server. Follow the steps (what I typed is displayed after the # sign, remember that):


    Press Y at the prompt below:


    Once it is done installing you should see something similar to (note the Starting web server lighttpd [ OK ]):


    At this point the web server is installed, and working. Going to a web browser and going to the URL: http://localhost/ SHOULD give you this page:


    If you do not see a page like the one above, and get something like this, you encountered a problem:


    Now that we have Lighttpd working, here are a few commands to control it:


    The first command: killall lighttpd will kill the server (stop lighttpd from running). Thus, when you go to localhost you get the server problem page. To start the server up again you use lighttpd -f /etc/lighttpd/lighttpd.conf which forces the server to start using the config file found in /etc/lighttpd. It really is that easy.

  2. #2
    Join Date
    Feb 2007
    Beans
    Hidden!

    HOW TO: Use Ubuntu as a LLMP Web Server with Cacti (part 2/4)

    Installing PHP

    PHP is what almost every server has running. PHP is an engine that processes PHP code into browser-readable content. Because PHP is so powerful, we will be installing it onto our server. Lets get started. Perhaps you can guess what the command is, if not:


    Then:


    And:


    And:


    Now we have PHP installed, with CGI mode, MySQL, and CLI supported. Now we need to enable fastcgi mode in lighttpd:


    And restart lighttpd (like the direction in the terminal says) using # /etc/init.d/lighttpd force-reload and we should see:


    (Notice the 2 [ OK ]'s, thats good). Now we can test and make sure PHP is working. Lets move into the www folder where our webpages will be stored:
    Code:
    # cd /var/www
    And type: # pico test.php and you should get a blank editor window. Fill it in like shown below:


    Then press Control O to save it and Control X to exit. Now go to your web browser and go to the URL http://localhost/test.php and you should see something similar to:


    If you see something similar to the image above, you are doing great so far! The wording will be different but it should in general look similar. Congrats, you now have PHP and Lighttpd running together. The final step is getting MySQL going.

  3. #3
    Join Date
    Feb 2007
    Beans
    Hidden!

    HOW TO: Use Ubuntu as a LLMP Web Server with Cacti (part 3/4)

    Installing MySQL

    Much like how we installed PHP and Lighttpd, do:


    It is going to download ~33MB of data so be patient as apt-get works its magic. You are going to want to setup a root password as well. After it is complete, you should see something similar to:


    Note that if you were never prompted to set your mysql password you can use the command (if you have set the password, skip this set):
    Code:
    # sudo mysqladmin -u root password "YourPasswordGoesHere"
    To check your mysql server, type (# mysql -u root -p):


    If you get something like the image above, it works. \q will exit mysql. Now we will make a new database called trial:


    To make sure the database was created we can try to delete it:


    So we are able to create and delete databases! Yay. Now lets install phpmyadmin so we can easily manage our databases. Type:
    Code:
    # apt-get install phpmyadmin
    You will get a screen like below, just go to OK, do not check any boxes:


    Once it is done installing, we will need to move it to /var/www:


    Now restart lighttpd (the commands are above), and in your browser try to go to http://localhost/phpmyadmin The output should look similar to the one below:


    Wow, we have accomplished a lot so far. MySQL, PHP, and Lighttpd all working with phpmyadmin to manage databases. Whats left? Well, nothing really, However if you want to install cacti (server status and statistics) follow the steps below.

  4. #4
    Join Date
    Feb 2007
    Beans
    Hidden!

    HOW TO: Use Ubuntu as a LLMP Web Server with Cacti (part 4/4)

    Installing Cacti

    Cacti is a complete network graphing solution designed to harness the power of RRDTool's data storage and graphing functionality. Cacti provides a fast poller, advanced graph templating, multiple data acquisition methods, and user management features out of the box. All of this is wrapped in an intuitive, easy to use interface that makes sense for LAN-sized installations up to complex networks with hundreds of devices
    .

    Start with the following command:


    When you reach the screen below, select 'None':


    At the screen below select 'Yes':


    At the screen below type in your MySQL root password (which you set above) and select 'Ok':


    At the screen below, enter the same password as your MySQL root password and select 'Ok':


    Then confirm the password:


    Now we need to link the cacti folder to our web directory folder:


    We can now go to http://localhost/cacti/site/ in our web browser and you should see a screen like below:


    Follow the promps and you will get to the login screen. The username and password are both admin

    Once you are logged in, you can manage the graphs. I will not go in depth about that as you can read the manual.

    We are now done! Congrats, you have a WORKING Linux server running Lighttpd, MySQL 5, PHP 5 with phpmyadmin and Cacti installed! It really is that simple, all of that can be completed in under 30 minutes!

    If you enjoy this tutorial, please say thank you and do not rip it off, I spent quite a bit of time going through the steps, checking my work, and making sure it was easy to follow by taking many screenshots and would like to receive a little credit. Enjoy the tutorial and the new server!

    Thank me if you enjoy the guide.

  5. #5
    Join Date
    Oct 2005
    Location
    California
    Beans
    572
    Distro
    Kubuntu 9.04 Jaunty Jackalope

    Re: HOW TO: Use Ubuntu as a LLMP Web Server with Cacti (part 4/4)

    awsum guide, I needed the phpmyadmin part, but all I did was make a symbolic link to it in /var/www/ instead of moving it. It's better that way in case of updates:

    Code:
    $ sudo ln -s /usr/share/phpmyadmin /var/www/phpmyadmin
    aka anime4christ (I'm a guy, btw.)
    My personal boring website ^_^
    Jesus has changed your life. Save changes? (Y/N)

  6. #6
    Join Date
    Mar 2007
    Location
    /usr/sbin/mysqld
    Beans
    89
    Distro
    Ubuntu 10.04 Lucid Lynx

    Talking Re: HOW TO: Use Ubuntu as a LLMP Web Server with Cacti (part 4/4)

    actualy is 37.2MB for mysql-server and client

    like you said apt-get is magic
    Last edited by cybernet; March 18th, 2008 at 10:26 AM.
    xList Tracker
    made on Ubuntu Lucid Lynx

  7. #7
    Join Date
    Feb 2008
    Beans
    7

    Re: HOW TO: Use Ubuntu as a LLMP Web Server with Cacti (part 4/4)

    Excellent! Thanks!
    Don't use
    Code:
    apt-get install mysql
    to install the mysql server, it does not match anything, use
    Code:
    apt-get install mysql-server
    instead.
    Last edited by plmday; April 2nd, 2008 at 04:02 PM.

  8. #8
    Join Date
    Nov 2006
    Beans
    66

    Re: HOW TO: Use Ubuntu as a LLMP Web Server with Cacti (part 4/4)

    thnx

  9. #9
    Join Date
    Jul 2009
    Beans
    68

    Re: HOW TO: Use Ubuntu as a LLMP Web Server with Cacti (part 4/4)

    Thanks very much, sir!
    Slowwwwwwwubuntupoke.

    My GPG key.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •