LAMP Server

From SharedSkies
Revision as of 19:21, 24 December 2012 by WikiSysop (talk | contribs)
Jump to navigation Jump to search

The telescope computers, servers, and workstations at Moore and Mt. Kent Observatories run under Linux, typically the OpenSUSE distribution with an Xfce desktop environment. The public servers, and increasingly our internal operations, also depend on server-side technology to provide interactive computing and remote access while minimizing the need for software that depends on the end-user's computer system. To this end, we use the Linux-Apache-MySQL-PHP (LAMP) model, and add Python and SQLite for many applications.

This page provides a brief guide to installing these components.


From openSUSE using YAST:

Install the standard LAMP server package including --

Apache MySQL PHP


Install libsqlite-3-0 to provide SQLite libraries (usually by default) Install most of Python 2.7 (not yet 3.0, using modules in the list for OpenSUSE installation at the observatories)

Although we do not use the distribution's Apache and PHP software, we do use MySQL and the default installation provides internal consistency. However, after installation do not start the Apache server. For added protect, change /usr/sbin/httpd and /usr/sbin/httpd2-worker permissions so that they cannot execute. We install our own Apache and PHP in /usr/local/ so that this does not interfere with the system defaults, but can be configured for our own uses. (The OpenSUSE configuration of HTTPD is particularly arcane for small systems and individual users.)


Install the Apache server in /usr/local:

From Apache download httpd-2.4.3.tar.gz or the latest stable release and save in /usr/local/src

tar xvzf httpd-2.4.3.tar.gz

cd httpd-2.4.3

Copy or edit the following into ./config.nice:

#! /bin/sh
#
"./configure" \
"--prefix=/usr/local/apache2" \
"--enable-so" \
"$@"

Then run ./config.nice (or run the above commands directly from the command line) and

make

make install

The last command will create /usr/local/apache2 if it does not already exist, and install the software and configuration files there. You will need to edit the configuration file, and start the software using apachectl in /usr/local/apache2/bin (see below).


Install PHP in /usr/local:


From PHP download php-5.4.10.tar.gz and save in /usr/local/src/

cd php-5.4.10


Copy or edit the following into ./config.nice:

#! /bin/sh
#
# Created by configure
'./configure' \
'--prefix=/usr/local/php' \
'--with-gd' \
'--with-zlib' \
'--with-apxs2=/usr/local/apache2/bin/apxs' \
'--with-libdir=/lib64' \
"$@"


Then run ./config.nice (or run the above commands directly from the command line)

make

make install


The last command will add php support to /usr/local/apache2/conf/httpd.conf if it does not already exist, and install the library and configuration files in /usr/local/php. You should copy php.ini-development to /usr/local/lib/php.ini and edit this file as needed.