Results 1 to 2 of 2

Thread: HowTo - Install a basic LAMP box

  1. #1
    mega's Avatar
    mega is offline Newbie Net Builder
    Join Date
    May 2009
    Location
    Hell , Wanna Come ??
    Posts
    62
    Thanks
    0
    Thanked 10 Times in 4 Posts

    Red face

    Ok, so you have a new VPS. Now what do you do with it?

    For many users, a box with a Lamp setup, Linux Apache Mysql and Perl/Php/Python is a good point to start building their server.


    Setting up a Lamp box is really quite simple, thanks to the popular Yum package manager that comes with Redhat based distros like Centos or Fedora.

    In this howto, we will create a Centos 4.3 based box with Apache/Mysql/Php,
    as well as Webmail, and Vsftp.

    Lets start with the first step.

    * Install a new stock Centos distro via your hosting providers control panel.
    * After your distro installs and the system boots up, login via ssh.
    * Type the following:

    yum install httpd mysql mysql-server php php-mysql sendmail dovecot squirrelmail vsftpd

    * A large amount of text will scroll by as Yum resolves its dependancies for the above software. Answer Y to the following question.

    Transaction Summary
    Install 18 Package(s)
    Update 0 Package(s)
    Remove 0 Package(s)
    Total download size: 22 M
    Is this ok [y/N]:

    * Yum will download the packages, and install them happily as you instructed it to do so.
    * When its done, you will be returned to the command prompt. Your software has been installed, lets make sure its running. Type the following to start your daemons up.

    service httpd start
    service vsftpd start
    service mysqld start...

    Timeout error occurred trying to start MySQL Daemon.
    Starting MySQL: [FAILED]

    * Oops!!! What happened with Mysql? Rpm based distros have an unfortunate bug associated with them. A few steps will be needed before mysql will start correctly. You will need to edit /etc/my.cnf

    It looks like this:

    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    # Default to using old password format for compatibility with mysql 3.x
    # clients (those using the mysqlclient10 compatibility package).
    old_passwords=1

    [mysql.server]
    user=mysql
    basedir=/var/lib

    [mysqld_safe]
    err-log=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid

    Make it look like this:

    [mysqld]
    datadir=/var/lib/mysql
    socket=/var/lib/mysql/mysql.sock
    # Default to using old password format for compatibility with mysql 3.x
    # clients (those using the mysqlclient10 compatibility package).
    old_passwords=1
    skip-innodb
    skip-bdb

    [mysql.server]
    user=mysql
    basedir=/var/lib

    [mysqld_safe]
    err-log=/var/log/mysqld.log
    pid-file=/var/run/mysqld/mysqld.pid

    Then, type:

    service mysqld start
    Starting MySQL: [ OK ]

    * There we go. Now, we need to make a few changes to dovecot to make it run both imap and pop3.

    edit /etc/dovecot.conf

    Turn this:

    # Protocols we want to be serving:
    # imap imaps pop3 pop3s
    #protocols = imap imaps

    into this:

    # Protocols we want to be serving:
    # imap imaps pop3 pop3s
    protocols = imap imaps pop3

    Then start dovecot up.

    service dovecot start
    Starting Dovecot Imap: [ OK ]

    * Thats it, you have installed an Linux/Apache/Mysql/Php server, with webmail too boot!

    * Oh, where is the webmail on the system?

    Just put your vps's IP in a browser like this:

    http://my.ip.add.ress/webmail/

    * Lets make sure these daemons start up when then vm boots:

    chkconfig --levels 3 httpd on
    chkconfig --levels 3 mysqld on
    chkconfig --levels 3 vsftpd on
    chkconfig --levels 3 dovecot on


    Thats it! You now have a basic LAMP server up and running.
    This could be improved apon by installing an open source control panel like Webmin.
    Never argue with an idiot; First he takes you down to his level and then he beats you with experience.

  2. #2
    Eyes's Avatar
    Eyes is offline Newbie Net Builder
    Join Date
    May 2009
    Location
    In a Party
    Posts
    83
    Thanks
    0
    Thanked 1 Time in 1 Post
    thanks for this

    do you have this for lighttp

Similar Threads

  1. LAMP File Permissions
    By Andy101 in forum Building
    Replies: 5
    Last Post: 16 May, 2010, 09:58 AM
  2. [Free] Install my Firefox Add-on and WIN $10!
    By stickycarrots in forum Contests
    Replies: 0
    Last Post: 3 May, 2010, 00:44 AM
  3. Wordpress install
    By JOSHMONGAN in forum Wordpress
    Replies: 7
    Last Post: 30 August, 2009, 06:17 AM
  4. Replies: 13
    Last Post: 3 June, 2009, 00:37 AM
  5. Basic SQL Tutorial (DML)
    By A12Alex in forum Databases
    Replies: 0
    Last Post: 13 February, 2009, 07:05 AM

Tags for this Thread

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
  •