Compilar e instalar Apache, Mysql, PHP y phpMyAdmin en Linux

Para compilar e instalar Apache, Mysql, PHP y phpMyAdmin en Linux, lo he probado en una instalación Centos 6.6 minimal, necesitamos instalar:

yum install make gcc automake zlib-devel bison cmake libtool wget gcc-c++ unzip ncurses-devel openssl-devel pcre-devel libxml2-devel curl-devel gd-devel libxslt-devel

Instalamos Apache

#[APACHE]
cd /usr/local/src/
wget http://archive.apache.org/dist/httpd/httpd-2.2.27.tar.gz
tar zxvf httpd-2.2.27.tar.gz
cd httpd-2.2.27
./configure --enable-so
make
make install
ln -s /usr/local/apache2/bin/apachectl /etc/init.d/httpd
ln -s /etc/init.d/httpd /etc/rc3.d/S98httpd
sed -i 's/#ServerName .*/ServerName 127.0.0.1/' /usr/local/apache2/conf/httpd.conf
sed -i 's/    DirectoryIndex index.html.*/    DirectoryIndex index.php index.html/' /usr/local/apache2/conf/httpd.conf
service httpd start

Abrimos el puerto 80

#[IPTABLES]
iptables -I INPUT 5 -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
iptables-save > /etc/sysconfig/iptables

Instalamos MySql

#[MYSQL]
cd /usr/local/src/
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.40.tar.gz
tar zxvf mysql-5.5.40.tar.gz
cd mysql-5.5.40
groupadd mysql
useradd -g mysql mysql
cmake .
make
make install
sed -i 's/socket=.*/socket\=\/tmp\/mysql.sock/' /etc/my.cnf
cd /usr/local/mysql/
chown -R mysql:mysql .
scripts/mysql_install_db --user=mysql --datadir=/var/lib/mysql
cp support-files/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig mysqld on
service mysqld start
./bin/mysqladmin -u root password '123456'

Para PHP necesitamos LibMCrypt si no lo tienen instalado.

#[LibMCrypt]
cd /usr/local/src
curl --remote-name --location http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
tar -xzvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure --prefix=/usr/local/libmcrypt-2.5.8
make
make install
ln -s libmcrypt-2.5.8 /usr/local/libmcrypt

Instalamos PHP

#[PHP]
cd /usr/local/src/
wget http://us2.php.net/get/php-5.3.29.tar.gz/from/this/mirror -O php-5.3.29.tar.gz
tar zxvf php-5.3.29.tar.gz
cd php-5.3.29
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-curl=/usr --with-gd --with-gettext --with-jpeg-dir=/usr --with-freetype-dir=/usr --with-kerberos --with-openssl --with-mcrypt=/usr/local/libmcrypt-2.5.8 --with-mhash --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pcre-regex --with-pear --with-png-dir=/usr --with-xsl --with-zlib --with-zlib-dir=/usr --with-iconv --enable-bcmath --enable-calendar --enable-exif --enable-ftp --enable-gd-native-ttf --enable-soap --enable-sockets --enable-mbstring --enable-zip --enable-wddx
make
make install
cp php.ini-production /usr/local/lib/php.ini
sed -i 's/;date.timezone =.*/  date.timezone \= "America\/Lima"/' /usr/local/lib/php.ini
echo "<?php phpinfo();?>" > /usr/local/apache2/htdocs/index.php
echo "AddType application/x-httpd-php .php" >> /usr/local/apache2/conf/extra/httpd-php.conf
echo "Include conf/extra/httpd-php.conf" >> /usr/local/apache2/conf/httpd.conf
/etc/init.d/httpd restart

Instalamos PhpMyAdmin

#[phpMyAdmin]
cd /usr/local/src/
wget http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/4.2.12/phpMyAdmin-4.2.12-all-languages.tar.gz
tar zxvf phpMyAdmin-4.2.12-all-languages.tar.gz
mv phpMyAdmin-4.2.12-all-languages /usr/local/phpmyadmin
echo "Alias /phpmyadmin \"/usr/local/phpmyadmin/\"
<Directory \"/usr/local/phpmyadmin/\">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order Allow,Deny
    Allow from all
</Directory>" >> /usr/local/apache2/conf/extra/httpd-phpmyadmin.conf
echo "Include conf/extra/httpd-phpmyadmin.conf" >> /usr/local/apache2/conf/httpd.conf
/etc/init.d/httpd restart
(Visited 754 times, 1 visits today)
Puedes saltar al final y dejar una respuesta. Hacer ping no está permitido actualmente.