First step: Download Apache, MySQL, PHP
wget http://mirrors.sohu.com/apache/httpd-2.2.31.tar.gz
wget http://mirrors.sohu.com/php/php-5.3.27.tar.gz
wget http://mirrors.sohu.com/mysql/MySQL-5.1/mysql-5.1.73-linux-x86_64-glibc23.tar.gz
Step two: Install MySQL first
Unzip the MySQL installation package
TAR-ZXVF mysql-5.1.73-linux-x86_64-glibc23.tar.gz
Move extracted packets to/usr/local/mysql
MV Mysql-5.1.73-linux-x86_64-glibc23/usr/local/mysql
Create MySQL Account
Useradd-s/sbin/nologin MySQL
Initializing the database
cd/usr/local/mysql/;
Mkdir-p/data/mysql; Chown-r Mysql:mysql/data/mysql
./scripts/mysql_install_db--user=mysql--datadir=/data/mysql
Copy configuration file
CP SUPPORT-FILES/MY-LARGE.CNF/ETC/MY.CNF
Copy the startup script and modify the content
CP Support-files/mysql.server/etc/init.d/mysqld
Modify Content Datadir=/usr/mysql Baseddir=/usr/local/mysql
Modify Startup script Permissions
chmod 755/etc/init.d/mysqld
Vim/etc/init.d/mysqld
Add the startup script to the system service entry and set the boot start to start MySQL
Chkconfig--add mysqld
Chkconfig mysqld on
Service mysqld Start
Step three: Install Apache
Unzip the installation package
TAR-ZXVF httpd-2.2.31.tar.gz
Install the required plugins
Yum install-y zlib-devel pcre pcre-devel Apr apr-devel
Entering the installation package and compiling the environment
CD httpd-2.2.31
./configure--prefix=/usr/local/apache2--with-included-apr--enable-so--enable-deflate=shared--enable-expires= Shared--enable-rewrite=shared--with-pcre
Compiling make
Install make install
Fourth Step: Install PHP
Unzip the installation package:
TAR-ZXVF php-5.3.27.tar.gz
Installing the extension source
Rpm-ivh "http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm"
Install the PHP build environment
Yum install-y libxml2-devel OpenSSL openssl-devel bzip2 bzip2-devel libpng libpng-devel freetype freetype-devel libmcrypt -devel Libjpeg-devel
Switch to the installation package directory and compile the environment
CD php-5.3.27
./configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache2/bin/apxs--with-config-file-path=/usr/local/ Php/etc--with-mysql=/usr/local/mysql--with-libxml-dir--with-gd--with-jpeg-dir--with-png-dir--with-freetype-dir --with-iconv-dir--with-zlib-dir--with-bz2--with-openssl--with-mcrypt--enable-soap--enable-gd-native-ttf-- Enable-mbstring--enable-sockets--enable-exif--disable-ipv6
Compiling make
Install make install
Copy configuration file
CP Php.ini-production/usr/local/php/etc/php.ini
Fifth step: Apache with PHP
Vim/usr/local/apache2/conf/httpd.conf
Found it:
AddType application/x-gzip. gz. tgz
Under this line, add the following:
AddType application/x-httpd-php. php
Found it:
<ifmodule dir_module>
DirectoryIndex index.html
</IfModule>
Change the line to read:
<ifmodule dir_module>
DirectoryIndex index.html index.htm index.php
</IfModule>
Found it:
#ServerName www.example.com:80
Modified to:
ServerName localhost:80
Sixth step: Test Lamp success
Check for an Apache configuration file for errors
/usr/local/apache2/bin/apachectl-t
Launch Apache
/usr/local/apache2/bin/apachectl start
View Apache Ports
NETSTAT-LNP |grep httpd
Test Home
Curl localhost
New PHP configuration file
vim/usr/local/apache2/htdocs/info.php
Input:
<?php
Phpinfo ();
?>
Edit Firewall File Open 80 port (or turn off firewall)
Vim/etc/sysconfig/iptables
Service Iptables Restart
Restart Apache
/usr/local/apache2/bin/apachectl restart
Then the browser access to see if the normal ~!
Seventh Step: Install Discuz
Create a Directory
Mkdir/data/www
Enter the directory and download the Discuz installation package
cd/data/www/
wget Http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_GBK.zip
Unzip the installation package:
Unzip Discuz_x3.2_sc_gbk.zip
Move directory files to/data/www
MV upload/*./
Delete unwanted files
RM-RF discuz_x3.2_sc_gbk.zip Readme Upload Utility
Configure Apache configuration file to start a virtual host
Vim/usr/local/apache2/conf/httpd.conf
Found it
# Virtual Hosts
# Include Conf/extra/httpd-vhosts.conf
Revision changed to
Virtual hosts
Include conf/extra/httpd-vhosts.conf
Found it
<directory/>
Options FollowSymLinks
AllowOverride None
Order Deny,allow
Deny from all
</Directory>
Revision changed to
<directory/>
Options FollowSymLinks
AllowOverride None
Order Deny,allow
Allow from all
</Directory>
To modify a virtual host configuration file
Vim/usr/local/apache2/conf/extra/httpd-vhosts.conf
Only one virtual machine configuration is left and modified to:
<virtualhost *:80>
DocumentRoot "/data/www"
ServerName www.yang.com
Serveralias www.li.com
# errorlog "Logs/dummy-host.example.com-error_log"
# customlog "Logs/dummy-host.example.com-access_log" common
</VirtualHost>
To modify the permissions of the Discuz profile:
Chown-r Daemon Config data uc_client/data uc_server/data
Uninstalling your own MySQL database
Query the installation directory which MySQL
View the installation package name Rpm-qf/usr/bin/mysql
Uninstalling your own database yum remove MySQL
Create a variable file of a database
vim/etc/profile.d/path.sh
Add Content:
#!/bin/bash
Export path= $PATH:/usr/local/mysql/bin
Apply path.sh file source/etc/profile.d/path.sh
And then into the database
Mysql
mysql> CREATE DATABASE Discuz;
Mysql> Grant all on discuz.* to ' Yanghao ' @ ' localhost ' identified by ' www123com '; Create Database account and password
Restart Apache to install Discuz
/usr/local/apache2/bin/apachectl restart
This article is from the "Hundred World" blog, please be sure to keep this source http://anson12315.blog.51cto.com/2441584/1914612
Lamp environment and Discuz Forum system installation