Home Backend Development PHP Tutorial LAMP and Discuz installation under Redhat Linux AS4_PHP tutorial

LAMP and Discuz installation under Redhat Linux AS4_PHP tutorial

Jul 13, 2016 pm 05:30 PM
discuz lamp linux redhat and thing Do Install of this Configuration

The simplest configuration of LAMP

I thought it was quite difficult to make this thing at first, so I didn’t want to try it. Later, my friend asked me to set up a forum to try it, so I tried it first. I originally wanted to learn iptables first. Now let’s learn the basics of LAMP.

After reading the online introduction and Brother Bird’s stuff, the installation process is basically as follows:

The software is as follows:

Mysql: mysql-4.0.21.tar.gz (I installed the rpm version at first, but I couldn’t find the configuration files, 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 (all downloaded on CU)

1. Install Mysql first

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

#I saw a lot of related stuff here later. When installing Discuz!, a gbk error will appear. Just add --with-charset=gbk

make

make install

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

# (This folder is in the original compiled directory) When asked if you want to overwrite, 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 &

#Also run as mysql user

#If there are no problems here, it should be fine and installed.

Add mysql to startup:

#鸟哥 said this:

Start immediately after booting!

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

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

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

# In this way, MySQL can be started automatically every time you turn on the computer!

Advanced setting content:

vi ~/.bashrc added

export PATH="$PATH: /usr/local/mysql/bin" //Add all commands under mysql in to the system PATH

#This is added to the setup system service.

cp /usr/local/mysql/share/mysql/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 mysql user

chown -R mysql /usr/local/mysql

chown -R mysql /etc/rc.d/init.d/mysql //Give the mysql user permissions

/sbin/chkconfig --del mysql

/sbin/chkconfig --add mysql //Put mysql into the startup item list

This should be ok. If you do it again, you can create the database "bbs" of the next forum. And add a password for the mysql root user

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

If you want to check, you can

mysql>show databases; There should be three databases

2. 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-soThis 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 Startup:

Will /usr/local/apache2/bin/apachectl start (I use /usr/local/apache2/bin/httpd -k start)

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

#鸟哥 said this:

/etc/rc.d/rc.local Riga, enable mysql and apache to start

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:

<?php
phpinfo( );
?>

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

Detailed enough.

4. Install Discuz!

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

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

The database is set to bbs that was just created, and the user is root...

If there were no problems before, enter http://yourdomain/install.php to start the configuration. Since gbk support was added when configuring mysql before, there should be no problem with the settings here.

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

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/509191.htmlTechArticleLAMP is the simplest configuration to make this thing. I thought it was quite difficult at first and didn’t want to try it. Later, my friend said to get one I tried it on the forum, so I tried it first. I originally wanted to learn iptables first. Now let’s learn the basics...
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
1655
14
PHP Tutorial
1254
29
C# Tutorial
1228
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.

vscode terminal usage tutorial vscode terminal usage tutorial Apr 15, 2025 pm 10:09 PM

vscode built-in terminal is a development tool that allows running commands and scripts within the editor to simplify the development process. How to use vscode terminal: Open the terminal with the shortcut key (Ctrl/Cmd). Enter a command or run the script. Use hotkeys (such as Ctrl L to clear the terminal). Change the working directory (such as the cd command). Advanced features include debug mode, automatic code snippet completion, and interactive command history.

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.

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.

vscode terminal command cannot be used vscode terminal command cannot be used Apr 15, 2025 pm 10:03 PM

Causes and solutions for the VS Code terminal commands not available: The necessary tools are not installed (Windows: WSL; macOS: Xcode command line tools) Path configuration is wrong (add executable files to PATH environment variables) Permission issues (run VS Code as administrator) Firewall or proxy restrictions (check settings, unrestrictions) Terminal settings are incorrect (enable use of external terminals) VS Code installation is corrupt (reinstall or update) Terminal configuration is incompatible (try different terminal types or commands) Specific environment variables are missing (set necessary environment variables)

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.

vscode Previous Next Shortcut Key vscode Previous Next Shortcut Key Apr 15, 2025 pm 10:51 PM

VS Code One-step/Next step shortcut key usage: One-step (backward): Windows/Linux: Ctrl ←; macOS: Cmd ←Next step (forward): Windows/Linux: Ctrl →; macOS: Cmd →

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.

See all articles