I was helping with a WordPress project and had to install MySQL, Apache 2.4 and PHP.
It is not as straightforward as expected.
1. On the server, I needed to remove mysql:
2. MySQL library was still used by postfix, therefore, I had to remove postfi:
3. Then, I could remove mysql lib:
Code: Select all
rpm -qa | grep -i mysql
mysql-libs-5.1.73-5.el6_6.x86_64
4. Then, I can install MySQL client and server packages:
Code: Select all
rpm -i MySQL-client-5.6.28-1.el6.x86_64.rpm
rpm -i MySQL-server-5.6.28-1.el6.x86_64.rpm
5. In order to compile and install Apache 2.4.18, I had to compile and install APR, APR-UTIL,APR-ICONV and PCRE:
Code: Select all
Apache Portable Runtime (APR) 1.5.2
./configure
make
make test
make install
Code: Select all
Apache Portable Runtime iconv (APR iconv) 1.2.1
./configure --with-apr=/usr/local/apr
make
make install
NOTICE: I encountered an error on Solairs when trying to compile ccs/ folder:
Code: Select all
make: Fatal error: Don't know how to make target `iso-8859-1.la'
I searched on the internet and found it is the 'make' program that Solaris uses that was causing the issue. Once I switched to gmake, it was working fine.
Code: Select all
./configure --with-apr=/usr/local/apr
gmake
gmake install
Code: Select all
Apache Portable Runtime Util (APR-util) 1.5.4
./configure --with-apr=/usr/local/apr --with-iconv=/usr/local CFLAGS=-std=gnu99
make
make test
make install
When specifying "--with-berkeley-db=/usr/local/BerkeleyDB.6.2" or "--with-berkeley-db=/usr/local/BerkeleyDB.4.7", the configure still said Berkeley DB was not found.
When using only "--with-berkeley-db", it didn't complain about no Berkeley DB. However, it didn't seem to help subversion configuration.
Also, "--with-iconv=/usr/local" will help Apache to link libiconv.so.2 in httpd
Code: Select all
PCRE 2.10.21 ---> caused version issue (version 2 has different filenames and Apache
couldn't find needed files)
PCRE 8.38
./configure
make
make check
make install
6. Then, I could compile and install Apache 2.4.18:
Code: Select all
./configure --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr --with-mysql --enable-cgi --enable-so --with-pcre=/usr/local --with-proxy --enable-dav --enable-modules=all
make
make install
NOTICE: Depends on what thread mode Apache is compiled with, cgi may not be enabled.
Code: Select all
--enable-cgid CGI scripts. Enabled by default with threaded MPMs
--enable-cgi CGI scripts. Enabled by default with non-threaded
7. Then, I could ocmpile and install PHP 5.6.17:
Code: Select all
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql
make
make test
make install
Then, the fun part came.
Apache 2.4 has a lot of changes in configurations. I had to load multiple modules before I can get the web site to work the way it used to.
Code: Select all
LoadModule php5_module modules/libphp5.so ==> Added by PHP installation
LoadModule unixd_module modules/mod_unixd.so ==> Fix "invalid command 'User'"
LoadModule access_compat_module modules/mod_access_compat.so ==> Fix "Invalid command 'Order',"
LoadModule authn_core_module modules/mod_authn_core.so ==> Fix "couldn't check user"
LoadModule authz_core_module modules/mod_authz_core.so ==> Fix "Authentication not configured"
LoadModule dir_module modules/mod_dir.so ==> Read DirectoryIndexand pickup index.html (and others)
LoadModule autoindex_module modules/mod_autoindex.so ==> to create file list in web page (not a must)
LoadModule authz_host_module modules/mod_authz_host.so ==> not sure if this is needed
It depends on how Apache 2.4 was configured. 22 modules (after php installation) may be included as the default:
Code: Select all
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule reqtimeout_module modules/mod_reqtimeout.so
LoadModule filter_module modules/mod_filter.so
LoadModule mime_module modules/mod_mime.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule env_module modules/mod_env.so
LoadModule headers_module modules/mod_headers.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule version_module modules/mod_version.so
LoadModule unixd_module modules/mod_unixd.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule dir_module modules/mod_dir.so
LoadModule alias_module modules/mod_alias.so
LoadModule php5_module modules/libphp5.so
Also, don't forget to add the following section in httpd.conf so that php works:
Code: Select all
# For PHP
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
Also, some configuration changes between 2.2 and 2.4:
Code: Select all
2.2
Order deny,allow
Deny from all
Code: Select all
2.2
Order deny,allow
Allow from all