Project httpsrv 1.0 – Script to compile, install and manage on RPM based Linux


Httpsrv 1.0 is my attempt to make it easier to compile your own LAMP STACK on Linux
This guide applies to and are tested for CentOS but will probably work on Fedora as well as Red Hat
The tutorial expects your selinux to be runing in permissive-mode and firewalls are turned off
Also update to the latest packages before doing this. Run ”yum update” Reboot the machine
(This webserver can run Magento, wordpress and more)

Video: Click here to watch on YouTube

1 Download ”httpsrv” and extract the zip archive to your desktop. Click here to download httpsrv

2 Download sources as (tar.gz) and (.rpm) Save them to the folder httpsrv/src on your desktop.
Downloadpage for php: http://php.net/downloads.php
Downloadpage for apache: http://httpd.apache.org/download.cgi
Downloadpage for mysql: http://dev.mysql.com/downloads/repo/yum
Downloadpage for phpmyadmin: https://www.phpmyadmin.net/downloads
Downloadpage for apr and apr-util: https://apr.apache.org/download.cgi

3 Rename all of the downloaded sources and archives to not include the version numbers.
Ex: php.tar.gz, httpd.tar.gz, mysql.rpm, phpMyAdmin.tar.gz, apr.tar.gz, apr-util.tar.gz

4 Upload the folder ”httpsrv” to /srv on your server e.g by using ftp =)

5 Install dependencies and recomended software (Run all steps below as root or sudo)
Copy and paste one line at a time

yum install gcc make openssl-devel nano epel-release libjpeg-devel libpng-devel lynx -y
yum install libxml2-devel libcurl-devel libmcrypt-devel readline-devel freetype-devel -y
yum install bzip2-devel libicu-devel pcre-devel gcc-c++ libxslt-devel unzip -y

6 Install MySQL repository from RPM. Install, configure and start the database.
Copy and paste one line at a time

cd /srv/httpsrv/src && rpm -Uvh mysql.rpm
yum install mysql-community-server -y && service mysqld start
grep ”temporary password” /var/log/mysqld.log
mysql_secure_installation

7 Untar tar.gz arcives into the folder /srv/httpsrv/src on your Linux server.
Copy and paste one line at a time

tar zvxf php.tar.gz && mv php-* build/php
tar zvxf httpd.tar.gz && mv httpd-* build/httpd
tar zvxf phpMyAdmin.tar.gz && mv phpMyAdmin-* ../phpmyadmin
tar zvxf apr-util.tar.gz && mv apr-util-* build/httpd/srclib/apr-util
tar zvxf apr.tar.gz -C build && mv build/apr-* build/httpd/srclib/apr

8 Edit /srv/httpsrv/src/script/init_httpsrv and change variables if you need to
httpsrv is written for CentOS and you don´t need to edit anything in this file

9 Run the script for installation and create tables for phpmyadmin
Copy and paste one line at a time

cp -f script/init_httpsrv /etc/init.d/httpsrv && chmod 775 /etc/init.d/httpsrv
/etc/init.d/httpsrv web_conf
/etc/init.d/httpsrv web_make
/etc/init.d/httpsrv php_conf
/etc/init.d/httpsrv php_make
/etc/init.d/httpsrv install
/etc/init.d/httpsrv link
mysql -u root -p < ../phpmyadmin/sql/create_tables.sql

10 Edit: /srv/httpsrv/conf/httpd.conf. Find the line that reads ”ServerRoot”
Define a new variable and call it ”root_path” on the row below the ”ServerRoot” directive.
This variable will be used in the configuration file for phpMyAdmin.

Change the path on the variable to whatever the ”ServerRoot” directive points to.

Define root_path /srv/httpsrv

11 Again Edit: /srv/httpsrv/conf/httpd.conf and add or replace to bellow.

ServerName httpsrv:80
User httpsrv
Group httpsrv
DirectoryIndex index.html index.htm index.php
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
# Add this line to the bottom of your configuration.
# Configurationfile for phpmyadmin, aliases and permissions:
Include conf/extra/phpmyadmin.conf

12 Restart httpsrv and configure autostart:
Copy and paste one line at a time

chkconfig --add httpsrv && chkconfig httpsrv on
/etc/init.d/httpsrv restart

Link to more reading and disclaimer for httpsrv

DONATE
Donation are not required but very much appreciated.
Click the below link to donate with PayPal (PayPal.Me)
Link: https://www.paypal.me/freddan88

GitHub
Link: https://github.com/freddan88