Home php教程 php手册 Redhat Linux AS4下的LAMP与Discuz安装

Redhat Linux AS4下的LAMP与Discuz安装

Jun 13, 2016 am 10:29 AM
discuz lamp linux redhat and thing Do Install of this Configuration

LAMP最简单的配置

做这个东西,刚开始觉得挺难的,不想试,后来朋友说弄个论坛试试,所以就先试了。本来想先学iptables的。现在先学基础的LAMP.

看了网上介绍以及鸟哥的东西,安装过程基本如下:

软件如下:

Mysql: mysql-4.0.21.tar.gz (刚开始装的是rpm的,可是找不到配置的文件之类的,所以就自己编译了)

Php:php-4.4.2.tar.gz

Apache:httpd-2.2.0.tar.bz2

Discuz!_4.1.0_SC_GBK.zip (都在CU上下载的)

一、先安装Mysql

mkdir /usr/local/mysql
 groupadd mysql
 useradd -g mysql mysql
 tar -zxvf mysql4.0.21.tar.gz -C /usr/local/src
 cd /usr/local/src/mysql4.0.21
 ./configure --prefix=/usr/local/mysql --with-charset=gbk

#这里后来看到很多相关的,在安装Discuz!的时候会出现gbk错误,加上--with-charset=gbk就可以

make

make install

cp support-files/my-medium.cnf /etc/my.cnf

#(这个文件夹是原来编译的目录下的)询问你是否要覆盖时,输入"y"

cd /usr/local/mysql

cd bin

./mysql_install_db --user=mysql

#这儿的user一定是mysql

chown -R root .

chown -R mysql var

chown -R mysql .

bin/mysqld_safe --user=mysql &

#也要用mysql用户运行

#如果这里没什么问题的话,应该是可以了,安装好了。

再把mysql加入启动:

#鸟哥是这样讲的:

開機後立即啟動!

# vi /etc/rc.d/rc.local

# 將底下這一行加入這個檔案的最後面一行喔!

cd /usr/local/mysql; /usr/local/mysql/bin/safe_mysqld --user=mysql &

# 這樣一來,每次開機就可以自動的啟動 MySQL 囉!

進階設定內容:

vi ~/.bashrc 加入

export PATH=“$PATH: /usr/local/mysql/bin“ //把mysqlin下的命令都加入到系统PATH里

#这个加入到setup那个系统服务里。

cp /usr/local/mysql/share/mysql/mysql.server /etc/rc.d/init.d/mysql //复制mysql服务启动项文件。

chmod +x /etc/rc.d/init.d/mysql //执行权限

useradd mysql //建mysql用户

chown -R mysql /usr/local/mysql

chown -R mysql /etc/rc.d/init.d/mysql //给mysql用户权限

/sbin/chkconfig --del mysql

/sbin/chkconfig --add mysql //把mysql放到启动项列表里

到这里应该是ok了,再作的话可以把接下来论坛的数据库"bbs"建立好。并为mysql的root用户加密码

#mysqladmin -u root password 123456

#mysql -u root -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or g.

Your MySQL connection id is 476 to server version: 4.1.20-log

Type help; or h for help. Type c to clear the buffer.

mysql> create database bbs;

要查看的话可以

mysql>show databases; 应该是出现三个数据库

二、安装Apache

mkdir /usr/local/apache

tar -jxvf Apache:httpd-2.2.0.tar.bz2 -C /usr/local/src

./configure --prefix=/usr/localapache --enable-module=most --enable-shared=max --enable-so

#--enable-so这个特别重要

make

make install

#启动文件为 /usr/local/apache/bin/apachectl start (那个httpd -k start一样的)

vi conf/httpd.conf

#修改默认启动页

DirectoryIndex index.html index.htm default.htm default.html index.php index.php3 index.jsp

加入启动:

将/usr/local/apache2/bin/apachectl start (我用的是/usr/local/apache2/bin/httpd -k start)

放在 /etc/rc.d/rc.local里

#鸟哥上是这样讲的:

/etc/rc.d/rc.local里加,使mysql和apache启动

cd /usr/local/mysql;/usr/local/mysql/bin/safe_mysql --user=mysql &

/usr/local/apache/bin/httpd -k start &

三、安装PHP

mkdir /usr/local/php4

tar -zxvf php-4.4.2.tar.gz -C /usr/local/src

cd /usr/local/src

./configure --prefix=/usr/local/php4 --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/

bin/apxs --with-config-file-path=/usr/local/php4

make

make install

cp php.ini-dist /usr/local/php4/php.ini

vi /usr/local/apache/config/httpd.conf

#启动Apache中的php选项,找到下面两行

LoadModule php4_module modules/libphp4.so

AddType application/x-httpd-php .php

测试PHP

重起下Apache: /usr/local/apache/bin/apachectl stop/start
cd /usr/local/apache/htdocs
vi test.php

输入:

<?php
phpinfo( );
?>

保存后,http://localhost/test.php看效果~~~

足够详细了。

四、安装Discuz!

解压后把upload放到默认的htdocs下,把所有文件权限改为777,再修改config.inc.php

vi /usr/local/apache/htdocs/config.inc.php

数据库设置为刚开始建立的bbs,用户为root……

这样之前没什么问题的话,输入http://yourdomain/install.php就可以开始配置了。由于之前配置mysql时加入了gbk支持,所以这里的设置应该是没什么问题了。

当然你要先建好了DNS,传文件的时候用samba (我用samba的,应该是ftp).

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1663
14
PHP Tutorial
1263
29
C# Tutorial
1237
24
Linux Architecture: Unveiling the 5 Basic Components Linux Architecture: Unveiling the 5 Basic Components Apr 20, 2025 am 12:04 AM

The five basic components of the Linux system are: 1. Kernel, 2. System library, 3. System utilities, 4. Graphical user interface, 5. Applications. The kernel manages hardware resources, the system library provides precompiled functions, system utilities are used for system management, the GUI provides visual interaction, and applications use these components to implement functions.

How to check the warehouse address of git How to check the warehouse address of git Apr 17, 2025 pm 01:54 PM

To view the Git repository address, perform the following steps: 1. Open the command line and navigate to the repository directory; 2. Run the "git remote -v" command; 3. View the repository name in the output and its corresponding address.

What is the main purpose of Linux? What is the main purpose of Linux? Apr 16, 2025 am 12:19 AM

The main uses of Linux include: 1. Server operating system, 2. Embedded system, 3. Desktop operating system, 4. Development and testing environment. Linux excels in these areas, providing stability, security and efficient development tools.

How to run java code in notepad How to run java code in notepad Apr 16, 2025 pm 07:39 PM

Although Notepad cannot run Java code directly, it can be achieved by using other tools: using the command line compiler (javac) to generate a bytecode file (filename.class). Use the Java interpreter (java) to interpret bytecode, execute the code, and output the result.

How to run sublime after writing the code How to run sublime after writing the code Apr 16, 2025 am 08:51 AM

There are six ways to run code in Sublime: through hotkeys, menus, build systems, command lines, set default build systems, and custom build commands, and run individual files/projects by right-clicking on projects/files. The build system availability depends on the installation of Sublime Text.

laravel installation code laravel installation code Apr 18, 2025 pm 12:30 PM

To install Laravel, follow these steps in sequence: Install Composer (for macOS/Linux and Windows) Install Laravel Installer Create a new project Start Service Access Application (URL: http://127.0.0.1:8000) Set up the database connection (if required)

How to use VSCode How to use VSCode Apr 15, 2025 pm 11:21 PM

Visual Studio Code (VSCode) is a cross-platform, open source and free code editor developed by Microsoft. It is known for its lightweight, scalability and support for a wide range of programming languages. To install VSCode, please visit the official website to download and run the installer. When using VSCode, you can create new projects, edit code, debug code, navigate projects, expand VSCode, and manage settings. VSCode is available for Windows, macOS, and Linux, supports multiple programming languages ​​and provides various extensions through Marketplace. Its advantages include lightweight, scalability, extensive language support, rich features and version

git software installation git software installation Apr 17, 2025 am 11:57 AM

Installing Git software includes the following steps: Download the installation package and run the installation package to verify the installation configuration Git installation Git Bash (Windows only)

See all articles