Install LAMP and Discuz in RHELAS4

Source: Internet
Author: User
Install LAMP and Discuz under RHELAS4-Linux Enterprise Application-Linux server application information. The following is a detailed description. At first, I thought it was quite difficult to try it. Later, my friend told me to try it on a forum, so I tried it first. I wanted to learn iptables first. Now we will first learn the basic LAMP.

After reading the introduction on the Internet and what laruence has done, the installation process is basically as follows:
The software is as follows:
Mysql: mysql-4.0.21.tar.gz (the initial installation is rpm, but can not find the configuration file and the like, So I compiled it myself)
Php: php-4.4.2.tar.gz
Apache: httpd-2.2.0.tar.bz2
Discuz! _4.1.0_ SC _GBK.zip

1. Install Mysql first
Mkdir/usr/local/mysql
Groupadd mysql
Useradd-g 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'
# Here I will see a lot of related things. Install Discuz! When the gbk error occurs, add -- with-charset = 'gbk '.
Make
Make install
Cp support-files/my-medium.cnf/etc/my. cnf
# (This folder is in the original compiled directory) If you want to overwrite it, enter "y"
Cd/usr/local/mysql
Cd bin
./Mysql_install_db -- user = mysql
# The user here must be mysql
Chown-R root.
Chown-R mysql var
Chown-R mysql.
Bin/mysqld_safe -- user = mysql &
# Run it with a mysql user
# If there is no problem here, it should be okay. The installation is complete.

Then add mysql to start:
# This is what laruence says:

?? C and then immediately ?? Sakura
# Vi/etc/rc. d/rc. local
#? ⒌ Violet @ Add a row ???? The last line of n case!
Cd/usr/local/mysql;/usr/local/mysql/bin/safe_mysqld -- user = mysql &
#?? Right? Why? Look at Wu _? C can be self-built? Yes ?? MySQL? Sakura

??? OK? Hot Swap? Br/> vi ~ /. Add bashrc
Export PATH = "$ PATH:/usr/local/mysql/bin" // Add all the commands in mysql \ bin to the system PATH.

# Add this to the setup System Service
Cp/usr/local/mysql/share/mysql. server/etc/rc. d/init. d/mysql // copy the mysql service startup Item File
Chmod + x/etc/rc. d/init. d/mysql // execution permission
Useradd mysql // create a mysql user
Chown-R mysql/usr/local/mysql
Chown-R mysql/etc/rc. d/init. d/mysql // grant mysql user permissions
/Sbin/chkconfig -- del mysql
/Sbin/chkconfig -- add mysql // put mysql in the startup Item List

It should be OK here. If you try again, you can set up the database "bbs" in the next Forum. Add a password to the root user of mysql.
# Mysqladmin-u root password '123'
# 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;
You can
Mysql> show databases; three databases should appear


Ii. 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 is particularly important
Make
Make install
# The Startup File is/usr/local/apache/bin/apachectl start (the same as httpd-k start)
Vi conf/httpd. conf
# Modify the default startup page
DirectoryIndex index.html index.htm default.htm default.html index. php index. php3 index. jsp

Join and start:

Set/usr/local/apache2/bin/apachectl start (I used/usr/local/apache2/bin/httpd-k start)
Put in/etc/rc. d/rc. local

# This is what laruence says:
/Etc/rc. d/rc. local add to enable mysql and apache
Cd/usr/local/mysql;/usr/local/mysql/bin/safe_mysql -- user = mysql &
/Usr/local/apache/bin/httpd-k start &

3. 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
# Start the php option in Apache and find the following two lines
LoadModule php4_module modules/libphp4.so
AddType application/x-httpd-php. php
Test PHP
Restart Apache:/usr/local/apache/bin/apachectl stop/start
Cd/usr/local/apache/htdocs
Vi test. php
Input:
Phpinfo ();
?>
After saving the file, visit http: // localhost/test. php ~~~

Detailed enough.


4. Install Discuz!

Decompress the package and place the upload file under the default htdocs file. Change the permission of all files to 777, and then modify config. inc. php.
Vi/usr/local/apache/htdocs/config. inc. php
The database is set to the bbs created at the beginning, and the user is root ......
In this case, enter http: // yourdomain/install. php to start the configuration. Since gbk support was added during mysql configuration, the settings here should be fine.

Of course, you must first set up DNS and use samba when transferring files (I use samba, it should be ftp ).

It's enough details. It should be okay to try again next time.

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.