LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Best way to install Apache on Centos 6 (https://www.linuxquestions.org/questions/linux-newbie-8/best-way-to-install-apache-on-centos-6-a-4175466409/)

NotionCommotion 06-17-2013 05:05 PM

Best way to install Apache on Centos 6
 
I am installing MySQL, Apache, and PHP on a new Centos 6.4 server.

For MySQL, you have three choices. Using "yum install mysql" along with Centos's repository is the simplest, but installs a very old version. Or you can go with "official" documentation at MySQL.com, but it has a few gotchas. The following seems like the best of both worlds.
Code:

# yum install MySQL-shared-5.6.11-2.el6.x86_64.rpm
# yum install MySQL-shared-compat-5.6.11-2.el6.x86_64.rpm
# yum install MySQL-server-5.6.11-2.el6.x86_64.rpm
# yum install MySQL-client-5.6.11-2.el.x86_64.rpm

As for PHP, I think compiling from source is the way to go as it allows for flexibility.

In regards to Apache, I would like your opinions which way would be best, and why:
  1. Use yum along with Cento's repository.
  2. Install using rmp. If so, will the way I did MySQL work?
  3. Install by source.

Thanks

bigrigdriver 06-17-2013 05:36 PM

Quote:

As for PHP, I think compiling from source is the way to go as it allows for flexibility.
Be advised that neither rpm nor yum will be able to update PHP if you install from source. The same applies to any package installed from source on an rpm based system.

Quote:

In regards to Apache, I would like your opinions which way would be best, and why:
1. Use yum along with Cento's repository.
2. Install using rmp. If so, will the way I did MySQL work?
3. Install by source.
Use yum to install from the CentOS repo. If you want to upgrade to a later version, which is also in the repo, you can specify the version number in your yum command.

This example for MySQL also applies to Apache:
Quote:

Use yum to upgrade to the version number you want.

yum upgrade mysql-14.14

Check the dependencies list before hitting Y. You might need to add other packages to the upgrade list

NotionCommotion 06-17-2013 05:51 PM

Thanks bigrigdriver,

The problem as I see it is Centos is not very diligent on upgrading their servers. It appears that the latest versions are PHP 5.3.3.22, MySQL 5.1.69, and Apache 2.2.155. I suppose I can start seaching for other repos, but don't know if I am confortable doing so.

Am I missing something?

Code:

[root@centosBox Downloads]# yum list available | grep httpd
httpd-devel.i686                          2.2.15-28.el6.centos        updates
httpd-manual.noarch                        2.2.15-28.el6.centos        updates
lighttpd.x86_64                            1.4.28-2.el6.rf              rpmforge
lighttpd-fastcgi.x86_64                    1.4.28-2.el6.rf              rpmforge
lighttpd-mod_mysql_vhost.x86_64            1.4.28-2.el6.rf              rpmforge
[root@centosBox Downloads]# yum list available | grep mysql
apr-util-mysql.x86_64                      1.3.9-3.el6_0.1              base   
bacula-director-mysql.x86_64              5.0.0-12.el6                base   
bacula-storage-mysql.x86_64                5.0.0-12.el6                base   
dovecot-mysql.x86_64                      1:2.0.9-5.el6                base   
freeradius-mysql.x86_64                    2.1.12-4.el6_3              base   
icinga-idoutils-libdbi-mysql.x86_64        1.8.4-4.el6.rf              rpmforge
libdbi-dbd-mysql.x86_64                    0.8.3-5.1.el6                base   
lighttpd-mod_mysql_vhost.x86_64            1.4.28-2.el6.rf              rpmforge
mod_auth_mysql.x86_64                      1:3.0.0-11.el6_0.1          base   
mysql.x86_64                              5.1.69-1.el6_4              updates
mysql-bench.x86_64                        5.1.69-1.el6_4              updates
mysql-connector-java.noarch                1:5.1.17-6.el6              base   
mysql-connector-odbc.x86_64                5.1.5r1144-7.el6            base   
mysql-devel.i686                          5.1.69-1.el6_4              updates
mysql-devel.x86_64                        5.1.69-1.el6_4              updates
mysql-embedded.i686                        5.1.69-1.el6_4              updates
mysql-embedded.x86_64                      5.1.69-1.el6_4              updates
mysql-embedded-devel.i686                  5.1.69-1.el6_4              updates
mysql-embedded-devel.x86_64                5.1.69-1.el6_4              updates
mysql-libs.i686                            5.1.69-1.el6_4              updates
mysql-libs.x86_64                          5.1.69-1.el6_4              updates
mysql-server.x86_64                        5.1.69-1.el6_4              updates
mysql-test.x86_64                          5.1.69-1.el6_4              updates
perl-Class-DBI-mysql.noarch                1.00-1.el6.rf                rpmforge
php-mysql.x86_64                          5.3.3-22.el6                base   
php-pecl-session_mysql.x86_64              1.9-2.el6.rf                rpmforge
proftpd-mysql.x86_64                      1.3.4a-1.el6.rf              rpmforge
qt-mysql.i686                              1:4.6.2-26.el6_4            updates
qt-mysql.x86_64                            1:4.6.2-26.el6_4            updates
rsyslog-mysql.x86_64                      5.8.10-6.el6                base   
[root@centosBox Downloads]# yum list available | grep php
cups-php.x86_64                            1:1.4.2-50.el6_4.4          updates
graphviz-php.x86_64                        2.26.0-10.el6                base   
mod_suphp.x86_64                          0.7.1-1.el6.rf              rpmforge
php.x86_64                                5.3.3-22.el6                base   
php-acid.noarch                            0.9.6b22-1.2.el6.rf          rpmforge
php-adodb.noarch                          4.81-1.el6.rf                rpmforge
php-bcmath.x86_64                          5.3.3-22.el6                base   
php-cli.x86_64                            5.3.3-22.el6                base   
php-common.x86_64                          5.3.3-22.el6                base   
php-dba.x86_64                            5.3.3-22.el6                base   
php-devel.x86_64                          5.3.3-22.el6                base   
php-embedded.x86_64                        5.3.3-22.el6                base   
php-enchant.x86_64                        5.3.3-22.el6                base   
php-fpm.x86_64                            5.3.3-22.el6                base   
php-gd.x86_64                              5.3.3-22.el6                base   
php-imap.x86_64                            5.3.3-22.el6                base   
php-intl.x86_64                            5.3.3-22.el6                base   
php-jpgraph.noarch                        1.19-1.2.el6.rf              rpmforge
php-jpgraph-docs.noarch                    1.19-1.2.el6.rf              rpmforge
php-ldap.x86_64                            5.3.3-22.el6                base   
php-mbstring.x86_64                        5.3.3-22.el6                base   
php-mcrypt.x86_64                          5.3.3-1.el6.rf              rpmforge
php-mysql.x86_64                          5.3.3-22.el6                base   
php-odbc.x86_64                            5.3.3-22.el6                base   
php-pdo.x86_64                            5.3.3-22.el6                base   
php-pear.noarch                            1:1.9.4-4.el6                base   
php-pear-db.noarch                        1.7.13-2.el6.rf              rpmforge
php-pecl-apc.x86_64                        3.1.9-2.el6                  base   
php-pecl-apc-devel.x86_64                  3.1.9-2.el6                  base   
php-pecl-fileinfo.x86_64                  1.0.4-2.el6.rf              rpmforge
php-pecl-http.x86_64                      1.6.5-2.el6.rf              rpmforge
php-pecl-mailparse.x86_64                  2.1.5-2.el6.rf              rpmforge
php-pecl-memcache.x86_64                  3.0.5-4.el6                  base   
php-pecl-session_mysql.x86_64              1.9-2.el6.rf                rpmforge
php-pgsql.x86_64                          5.3.3-22.el6                base   
php-process.x86_64                        5.3.3-22.el6                base   
php-pspell.x86_64                          5.3.3-22.el6                base   
php-recode.x86_64                          5.3.3-22.el6                base   
php-snmp.x86_64                            5.3.3-22.el6                base   
php-soap.x86_64                            5.3.3-22.el6                base   
php-tidy.x86_64                            5.3.3-22.el6                base   
php-xcache.x86_64                          1.3.2-1.el6.rf              rpmforge
php-xml.x86_64                            5.3.3-22.el6                base   
php-xmlrpc.x86_64                          5.3.3-22.el6                base   
php-zts.x86_64                            5.3.3-22.el6                base   
phpMyAdmin.noarch                          3.5.7-1.el6.rf              rpmforge
phpmyadmin.noarch                          2.11.11.3-2.el6.rf          rpmforge
rrdtool-php.x86_64                        1.3.8-6.el6                  base   
uuid-php.x86_64                            1.6.1-10.el6                base   
[root@centosBox Downloads]#


chrism01 06-17-2013 06:17 PM

Unless you NEED (not want) the absolute latest, go with the Centos repo versions.
Otherwise you risk breaking dependencies & other issues.
Note that RedHat (Centos is a free rebuild) does actually backport fixes from newer versions, hence the long version strings.
You can always check the release notes if you absolutely require something you think isn't there in the base version.

NotionCommotion 06-17-2013 06:36 PM

Thanks chrism01,

Sometimes with PHP I need some new feature. As for the other two, I don't necessarily need the latest, but don't want any security holes either.

Apache httpd 2.2.15 was released on 2010-03-07 15:08. There appears to be a whole string of patches to address security concerns. I am new to all this, but have some concerns of using such an old platform. Should I not be?

As for MySQL, does my use of yum on the rpm package not protect against breaking dependencies & other issues? Probably not, but you can't blame for for hoping!

Also, back to Apache, will creating an RPM as described below and using yum to install provide any advantages?

Thanks

Quote:

While many distributions make Apache httpd available as operating system supported packages, it can sometimes be desirable to install and use the canonical version of Apache httpd on these systems, replacing the natively provided versions of the packages.

While the Apache httpd project does not currently create binary RPMs for the various distributions out there, it is easy to build your own binary RPMs from the canonical Apache httpd tarball.

This document explains how to build, install, configure and run Apache httpd 2.4 under Unix systems supporting the RPM packaging format.
Source:http://httpd.apache.org/docs/2.4/platform/rpm.html

szboardstretcher 06-18-2013 11:03 AM

Ah. The thing here is that all those security fixes you mentioned are backported to the latest EL httpd package. So, if you have 2.2.15 from RHEL, SL or CENTOS you will find it already has those patches in it.

Proof:

Code:

rpm -q --changelog httpd|head

DavidMcCann 06-18-2013 11:41 AM

Quote:

Originally Posted by NotionCommotion (Post 4973765)
The problem as I see it is Centos is not very diligent on upgrading their servers. It appears that the latest versions are PHP 5.3.3.22, MySQL 5.1.69, and Apache 2.2.155. I suppose I can start seaching for other repos, but don't know if I am confortable doing so.

Am I missing something?

Yes! The whole point of Red Hat (and hence CentOS) is stability. It's not lack of diligence, but deliberate policy: let other people (millions of them) use the software first to make sure it's sound.

John VV 06-18-2013 02:07 PM

CentOS is a rebuild of RHEL

the major version numbers of programs will NEVER change in the lifetime of RHEL6

NOW red hat is VERY diligent on installing backported SECURITY fixes to updates

though the version of MySQL and Apache and Php might be a bit old ,they DO have the current security and bug fixes applied to them .

Also these versions are VERY well tested !!!
in over 5 years i have only had ONE crash on rhel/cent/sl
and that was 100% MY FAULT !

NotionCommotion 06-18-2013 10:39 PM

Thanks szboardstretcher, I did find it odd how Apache was such an old version. I am curious on who takes the time applying fixes to older software versions (I assume that is what backported means?), but will take your word on it.

Thanks DavidMcCann and John VV, I was not saying CentOS is not concerned about security, only my limited view (which is undoubtedly wrong) implied they were.

evo2 06-18-2013 10:47 PM

Hi,
Quote:

Originally Posted by NotionCommotion (Post 4974532)
I am curious on who takes the time applying fixes to older software versions

RedHat does for RHEL, and the packages then end up in CentOS. The Debian devs do the same thing for Debian stable.
Quote:

(I assume that is what backported means?),
Yes!
Quote:

but will take your word on it.
No need to: you can read the change logs as shown by szboardstretcher.

If you really do need to use newer versions on some things (eg php), it is worth checking the 3rd party repositories listed at
http://wiki.centos.org/AdditionalResources/Repositories

Cheers,

Evo2.


All times are GMT -5. The time now is 09:31 PM.