In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Editor to share with you about the LAMP environment and how to install the Discuz forum system. I hope you will get something after reading this article. Let's discuss it together.
Step 1: 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 2: install MySQL first
Extract the mysql installation package
Tar-zxvf mysql-5.1.73-linux-x86_64-glibc23.tar.gz
Move the extracted packets to / usr/local/mysql
Mv mysql-5.1.73-linux-x86_64-glibc23 / usr/local/mysql
Create a mysql account
Useradd-s / sbin/nologin mysql
Initialize 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 fil
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 item, and set the boot to start, start mysql
Chkconfig-add mysqld
Chkconfig mysqld on
Service mysqld start
Step 3: install Apache
Extract the installation package
Tar-zxvf httpd-2.2.31.tar.gz
Install the required plug-ins
Yum install-y zlib-devel pcre pcre-devel apr apr-devel
Enter the installation package and compile 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
Compile make
Install make install
Step 4: install PHP
Extract the installation package:
Tar-zxvf php-5.3.27.tar.gz
Install extension sourc
Rpm-ivh "http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm"
Install the php compilation environment
Yum install-y libxml2-devel openssl openssl-devel bzip2 bzip2-devel libpng libpng-devel freetype freetype-devel libmcrypt-devel libjpeg-devel
Change 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
Compile make
Install make install
Copy configuration fil
Cp php.ini-production / usr/local/php/etc/php.ini
Step 5: combine Apache with PHP
Vim / usr/local/apache2/conf/httpd.conf
Find:
AddType application/x-gzip .gz .tgz
Add under the line:
AddType application/x-httpd-php .php
Find:
DirectoryIndex index.html
Change the line to:
DirectoryIndex index.html index.htm index.php
Find:
# ServerName www.example.com:80
Modified to:
ServerName localhost:80
Step 6: test whether LAMP is successful
Check the Apache configuration file for errors
/ usr/local/apache2/bin/apachectl-t
Start Apache
/ usr/local/apache2/bin/apachectl start
View Apache port
Netstat-lnp | grep httpd
Test home page
Curl localhost
Create a new php profile
Vim / usr/local/apache2/htdocs/info.php
Enter:
Edit firewall file to open port 80 (or turn off firewall)
Vim / etc/sysconfig/iptables
Service iptables restart
Restart Apache
/ usr/local/apache2/bin/apachectl restart
Then the browser visits to see if it is normal ~!
Step 7: 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
Extract the installation package:
Unzip Discuz_X3.2_SC_GBK.zip
Move the directory file to / data/www
Mv upload/*. /
Delete unwanted files
Rm-rf Discuz_X3.2_SC_GBK.zip readme upload utility
Configure the Apache profile to start the virtual host
Vim / usr/local/apache2/conf/httpd.conf
find
# Virtual hosts
# Include conf/extra/httpd-vhosts.conf
Modify to
Virtual hosts
Include conf/extra/httpd-vhosts.conf
find
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Modify to
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
Modify virtual host configuration file
Vim / usr/local/apache2/conf/extra/httpd-vhosts.conf
Leave only one virtual machine configuration and modify it to:
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
Modify the permissions of the discuz configuration file:
Chown-R daemon config data uc_client/data uc_server/data
Uninstall the built-in mysql database
Query the installation directory which mysql
Check the installation package name rpm-qf / usr/bin/mysql
Uninstall the built-in database yum remove mysql
Create a variable file for a database
Vim / etc/profile.d/path.sh
Add content:
#! / bin/bash
Export PATH=$PATH:/usr/local/mysql/bin
Apply the path.sh file source / etc/profile.d/path.sh
And then access the database.
Mysql
Mysql > create database discuz; create database
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
After reading this article, I believe you have a certain understanding of "LAMP environment and how to install Discuz forum system". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.