Aug 24 2008

[Linux] Installing latest Apache, PHP and MySQL from sources

Category: Articles,Linux administrationFractalizeR @ 12:48 am

Installing MySQL

First we need to do some steps on creating MySQL Server user account:

  • groupadd mysql
  • useradd -g mysql mysql

Now let’s download and install latest MySQL:

  • cd /usr/local/fractal
  • wget http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.67.tar.gz/from/http://mysql.mix.su/
  • tar -zxvf mysql-5.0.67.tar.gzcd mysql-5.0.67
  • CFLAGS=”-O3 -mpentiumpro”
  • CXXFLAGS=”-O3 -mpentiumpro -felide-constructors -fno-exceptions -fno-rtti”
  • ./configure –prefix=/usr/local/mysql –enable-assembler –with-extra-charsets=all –without-debug \ –without-geometry –without-ndb-debug –with-big-tables –enable-thread-safe-client –with-mysqld-user=mysql –enable-embedded-mysqli=shared
  • make
  • make install

Now creating MySQL service:

  • cp support-files/my-medium.cnf /etc/my.cnf
  • cp support-files/mysql.server /etc/init.d/mysql
  • chmod 0777 /etc/init.d/mysql
  • chkconfig –add mysql
  • chkconfig mysql on

Setting file permissions for MySQL Server and creating initial MySQL tables.

  • cd /usr/local/mysql
  • chown -R mysql .
  • chgrp -R mysql .
  • bin/mysql_install_db –user=mysql
  • chown -R root .
  • chown -R mysql var
  • bin/mysqld_safe –user=mysql &

Now we need to execute post-install operations:

  • /usr/local/mysql/bin/mysql_secure_installation

By this you will set root password for mysql server and execute other security-related operations. Just answer the wizard’s questions.

Now let’s install PHP… See next page for instructions.

Tags: , , , , ,

Leave a Reply

You must be logged in to post a comment. Login now.