Results 1 to 1 of 1
-
3rd Mar 2012, 04:15 AM #1OPMember
A script for Basic apache and php compile might be useful
Hi Guys,
see the script that I found.
let me know if it worked for you.
- Script is for CentOS 6 and tested on CentOS6. it should work on CentOS 5 as long as you change the EPEL RPM.
- No need to disable SElinux
It worked for me.
wget http://iesucks.net/linux/scripts/ApachePHP.sh
chmod +x ApachePHP.sh
./ApachePHP.sh
#!/bin/bash
#Welcome Message
echo
echo Welcome to the Installer script.
echo
echo This script will install Apache, PHP, MySQL, ProFTPD, and PHPMyAdmin
echo
echo WARNING!!! This script will overwrite any existing Apache, PHP, ProFTPD or MySQL install.
echo
echo If you have already have a working install of this push Ctrl+C Now!!!
echo
echo Starting install in 30 seconds!
sleep 30
#Check if OS is CentOS/RHEL
if [ -f /etc/redhat-release ];
then
echo "Found CentOS/RHEL"
else
echo "This OS Is NOT CentOS/RHEL. This setup script will not work with this os."
exit
fi
#Check if yum exists
if [ -f /usr/bin/yum ];
then
echo "Found Yum!"
else
echo "Yum is not installed. Yum MUST be installed for this script to work!"
exit
fi
#Remove Exiting Apache/PHP install if exists
yum -y remove httpd* php*
#Setup EPEL
rpm -ivh http://download.fedora.redhat.com/pu...6-5.noarch.rpm
#Install packages using yum
yum -y install kernel-headers kernel-devel gcc gd gd-devel curl curl-devel mysql mysql-server mysql-devel apr apr-devel libxml2 libxml2-devel libmcrypt libmcrypt-devel proftpd
#Grab packages
cd /usr/local/src/
wget http://mirror.olnevhost.net/pub/apac...-2.2.21.tar.gz
wget http://us2.php.net/get/php-5.3.8.tar...om/this/mirror
wget "http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.4.6/phpMyAdmin-3.4.6-all-languages.tar.gz*****&ts=1319286902&use_mirror=sup erb-sea2"
#Extract packages
tar zxvf httpd-2.2.21.tar.gz
tar xvf php-5.3.8.tar.bz2
tar zxvf phpMyAdmin-3.4.6-all-languages.tar.gz
#Compile Apache and PHP
cd /usr/local/src/httpd-2.2.21
./configure --prefix=/usr/local/apache --enable-mods-shared=all --enable-ssl --enable-unique-id --with-ssl --with-zlib --with-mpm=worker --enable-proxy --with-mpm=prefork --enable-suexec --with-suexec-bin --with-included-apr && make && make install
cd /usr/local/src/php-5.3.8
./configure --prefix=/usr/local/php --with-gd --with-mhash --with-libxml-dir --with-mcrypt --with-jpeg-dir=/usr --with-mysql=/ --with-curl --with-mysqli --with-pdo-mysql=mysqlnd --with-kerberos --enable-mbstring --with-apxs2=/usr/local/apache/bin/apxs && make && make install
#Setup config files and services
echo "#Added by Install script" >> /usr/local/apache/conf/httpd.conf
echo "#" >> /usr/local/apache/conf/httpd.conf
echo "AddType application/x-httpd-php .php" >> /usr/local/apache/conf/httpd.conf
echo "#" >> /usr/local/apache/conf/httpd.conf
echo "<IfModule dir_module>" >> /usr/local/apache/conf/httpd.conf
echo "DirectoryIndex index.php" >> /usr/local/apache/conf/httpd.conf
echo "</IfModule>" >> /usr/local/apache/conf/httpd.conf
echo "#" >> /usr/local/apache/conf/httpd.conf
echo "HostnameLookups On" >> /usr/local/apache/conf/httpd.conf
echo "#" >> /usr/local/apache/conf/httpd.conf
#Secure Apache with PCI complance.
echo "ServerTokens ProductOnly" >> /usr/local/apache/conf/httpd.conf
echo "#End of added by Install script" >> /usr/local/apache/conf/httpd.conf
cp /usr/local/src/php-5.3.8/php.ini-production /usr/local/php/lib/php.ini
wget http://iesucks.net/linux/script-configs/httpd -O /etc/init.d/httpd
chmod +x /etc/init.d/httpd
ln -s /usr/local/php/bin/php /bin/php
#Make sure services start on boot
chkconfig httpd on
chkconfig mysqld on
chkconfig proftpd on
#Temp Disable SElinux
setenforce 0
#Disable SElinux
sed -i "7s/enforcing/disabled/" /etc/selinux/config
#Setup hosts file for Apache
echo 127.0.0.1 $HOSTNAME >> /etc/hosts
#Flush firewall
iptables -F
#Start services
service httpd start
service mysqld start
service proftpd start
#Setup phpMyAdmin
cd /usr/local/src
cp -R /usr/local/src/phpMyAdmin-3.4.6-all-languages /usr/local/apache/htdocs/phpMyAdmin
#Prevent Apache and PHP form being installed via yum.
echo "exclude=httpd* php*" >> /etc/yum.conf
#Set MySQL root password.
echo
read -p "Enter a MySQL root passowrd: " mysqlrootpassword
mysqladmin -u root password $mysqlrootpassword
echo
echo "The MySQL root password has been set to: $mysqlrootpassword"
echo
#Finished and echo information
echo If you received no errors then your webserver should be working.
echo
echo If you need to edit apache the config file it is located at /usr/local/apache/conf/httpd.conf
echo
echo If you need to edit the PHP config file it is located at /usr/local/php/lib/php.ini
echo
echo The MySQL root password was set to: $mysqlrootpassword
echo
echo You may access phpMyAdmin at $HOSTNAME/phpMyAdmin or via your ServerIP/phpMyAdmin
echo
echo Install Complete!
echoNovaroot Reviewed by Novaroot on . A script for Basic apache and php compile might be useful Hi Guys, see the script that I found. let me know if it worked for you. Script is for CentOS 6 and tested on CentOS6. it should work on CentOS 5 as long as you change the EPEL RPM. No need to disable SElinux Rating: 5
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
ProFTPd compile error
By feronso in forum Server ManagementReplies: 10Last Post: 31st May 2012, 03:03 PM -
[C++] someone to compile this code asap
By jokerhacker in forum Web Development AreaReplies: 8Last Post: 8th Sep 2011, 06:15 PM -
How to install sborg or other script on new VPS without getting apache error?
By desibreaker in forum Tutorials and GuidesReplies: 4Last Post: 9th Jul 2011, 01:40 PM -
How do I compile Suhosin using VC6 (and php 5.2.14 source)?
By NewEraCracker in forum Technical Help Desk SupportReplies: 2Last Post: 21st Feb 2011, 11:47 PM -
Basic Security script
By jayfella in forum Technical and Security TutorialsReplies: 5Last Post: 10th Mar 2010, 04:04 PM
themaCreator - create posts from...
Version 3.23 released. Open older version (or...