how to install apache, PHP and MySQL on Linux 2
how to install apache, PHP and MySQL on Linux
This tutorial explains the installation of Apache web server, bundled
with PHP and MySQL server on a Linux machine. The tutorial is primarily for SuSE
9.2, 9.3, 10.0 & 10.1, but most of the steps ought to be valid for all
Linux-like operating systems.
Contents:
MySQL 5 Installation
Apache 2 Installation
Prerequisites
Download Source
Unpack, Configure, Compile
Edit httpd.conf
Set up Access Privileges
Start and Stop Apache Server
Automatic Startup
PHP 5 Installation
apache 2 installation
prerequisites
Before you begin, it is highly recommended (though not inevitable) to create
a system user and user group under which your Apache server will be
running.
# groupadd www
# useradd -g www apache2
What is it good for? All actions performed by Apache (for instance your PHP
scripts execution) will be restricted by this user's privileges. Thus you can
explicitly rule which directories your PHP scripts may read or change. Also all
files created by Apache (e.g. as a result of executing your PHP scripts) will be
owned by this user (apache2 in my case), and affiliated with this user group
(www in my case).
download source
Get the source from http://httpd.apache.org/download.cgi
( httpd-2.2.4.tar.gz
). These instructions are known
to work with all 2.x.x Apache versions.
unpack, configure, compile
Go to the directory with the downloaded file and enter:
# tar -xzf
httpd-2.2.4.tar.gz
# cd httpd-2.2.4
# ./configure
--prefix=/usr/local/apache2 --enable-so --with-included-apr
The configure options deserve a little bit more of detail here. The most
important --prefix
option specifies the location
where Apache is to be installed. Another commonly used option --enable-so
turns on the DSO
support, i.e. available modules
compiled as shared objects can be loaded or unloaded at runtime. Very handy.
To compile some modules statically (they are
相关文档:
1. Linux 脚本编写基础
1.1 语法基本介绍
1.1.1 开头
程序必须以下面的行开始(必须方在文件的第一行):
#!/bin/sh
符号#!用来告诉系统它后面的参数是用来执行该文件的程序。在这个例子中我们使用/bin/sh来执行程序。
当编辑好脚本时,如果要执行该脚本,还必须使其可执行。
要使脚本可执行:
编译 ......
linux 小技巧
前言:因为用Linux的时间越来越长,所需要做的事也越来越多,效率成了我必需突破的瓶颈。在此总结一下这段时间用过的一些好的Linux技巧。以后时常补充这样自己要用的时候就很方便了。 Author:Ajian[文本处理]1、 ...
前言:因为用Linux的时间越来越长,所需要做的事也越来越多,效率成了我必需突破的瓶颈。 ......
bool RemoveNode(string& szFileName)
{
TiXmlDocument myDocument(szFileName);
bool loadOkay = myDocument.LoadFile();
if(loadOkay == false)
return false;
//获得根元素
TiXmlElement *rootElemen ......
how to install apache, PHP and MySQL on Linux
This tutorial explains the installation of Apache web server, bundled with PHP and MySQL server on a Linux machine. The tutorial is primarily for SuSE 9.2, 9.3, 10.0 & 10.1 operating systems, but most of the steps ought to be valid for all Linux-lik ......