Lamp and Discuz installation _php tutorial Redhat Linux AS4

Source: Internet
Author: User

the simplest configuration of lamp

Do this thing, just start to feel very difficult, do not want to try, later friends said to get a forum to try, so first try. I wanted to learn iptables first. Now learn the basic lamp first.

Read the online introduction and bird Brother's things, the installation process is basically as follows:

The software is as follows:

Mysql:mysql-4.0.21.tar.gz (first loaded is RPM, but can not find the configuration files and so on, so they compiled)

Php:php-4.4.2.tar.gz

apache:httpd-2.2.0.tar.bz2

Discuz!_4.1.0_sc_gbk.zip (both are downloaded on the CU)

First, install 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

#这里后来看到很多相关的, there will be a GBK error when installing discuz!, plus--WITH-CHARSET=GBK can

Make

Make install

CP SUPPORT-FILES/MY-MEDIUM.CNF/ETC/MY.CNF

# (This folder is the original compiled directory) when asked if you want to overwrite, enter "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用户运行

#如果这里没什么问题的话, it should be OK, installed.

Then add MySQL to the boot:

#鸟哥是这样讲的:

Activate immediately after the start of the machine!

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

# Add the bottom line to the last line of this file!

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

# this way, every time you start a robot, you can automatically activate MySQL!

Advanced Setup Content:

VI ~/.BASHRC Join

Export path= "$PATH:/usr/local/mysql/bin"//Add the commands under Mysqlin to the system PATH

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

Cp/usr/local/mysql/share/mysql/mysql.server/etc/rc.d/init.d/mysql//Copy the MySQL service startup key file.

chmod +x/etc/rc.d/init.d/mysql//Execute permissions

Useradd MySQL//build MySQL User

Chown-r Mysql/usr/local/mysql

Chown-r mysql/etc/rc.d/init.d/mysql//give MySQL user rights

/sbin/chkconfig--del MySQL

/sbin/chkconfig--add MySQL//put MySQL in the Startup item list

Here should be OK, and then you can put the next forum database "BBS" to establish a good. and add a password for the root user of MySQL

#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;

To view, you can

Mysql>show databases; There should be three databases

Second, install 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 this is especially important.

Make

Make install

#启动文件为/usr/local/apache/bin/apachectl Start (the httpd-k start)

VI conf/httpd.conf

#修改默认启动页

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

Join start:

Will/usr/local/apache2/bin/apachectl start (I'm using/usr/local/apache2/bin/httpd-k start)

Put it in the/etc/rc.d/rc.local.

#鸟哥上是这样讲的:

/etc/rc.d/rc.local Riga, enable MySQL and Apache to boot

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

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

Third, install 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选项, find the following two lines

LoadModule Php4_module modules/libphp4.so

AddType application/x-httpd-php. php

Test PHP

Re-starting Apache:/usr/local/apache/bin/apachectl Stop/start
Cd/usr/local/apache/htdocs
VI test.php

Input:

Phpinfo ();
? >

After saving, http://localhost/test.php see effect ~ ~ ~

Enough detail.

iv. installation of discuz!

After decompression, put upload into the default htdocs, change all the file permissions to 777, and then modify the config.inc.php

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

The database is set to the first BBS, the user is root ...

If this is not a problem, enter http://yourdomain/install.php to start the configuration. Because GBK support was added to the previous configuration of MySQL, the settings here should be fine.

Of course you have to build the DNS first, the file is used with samba (I use Samba, should be FTP).

http://www.bkjia.com/PHPjc/509191.html www.bkjia.com true http://www.bkjia.com/PHPjc/509191.html techarticle Lamp The simplest configuration to do this thing, just beginning to feel very difficult, do not want to try, later friends said to get a forum to try, so first try. I wanted to learn iptables first. Let's learn the basics now ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.