Let's learn how to use apache + php + mysql to build a Forum Environment in linux.
Source: Internet
Author: User
Let's take a look at how to use apache + php + mysql to build a Forum environment-linux Enterprise applications-Linux server applications. For more information, see the following. Use apache + php + mysql to build a forum
Fang ShengShan 20100524
1. Download software required for the LAMP Environment
Apache: http://www.apache.org
PHP: http://www.php.net
MySQL: http://www.mysql.comdownloads ===> MySQL Community Server ====> Compressed gnu tar archive (tar.gz)
Discuz: http://www.discuz.com
Http://www.centos.org: Linux
2. Check whether the software required to build the Forum has been installed.
Rpm-qa | grep mysql
Rpm-e mysql-server -- nodeps
Rpm-q httpd
Rpm-q php
Iii. Install MySQL 5.0
Shell> useradd mysql // the account and password used for subsequent database installation
Shell> passwd mysql
Shell> tar-xzvf mysql-5.0.51a.tar.gz // extract Software
Shell> cd mysql-5.0.51a // enter the mysql directory
Shell>./configure -- prefix =/usr/local/mysql // If the installation directory is not specified, the default value is/usr/local.
Shell> make // automatically update files to maintain the relationship between files
Shell> make install // install source code
Shell> cp support-files/my-medium.cnf/etc/my. cnf // generate the MySQL Master Profile
Shell> cd/usr/local/mysql // The Directory here is your installation directory,
Based on the actual situation
Shell> chown-R mysql. mysql.
Shell> bin/mysql_install_db -- user = mysql // initialize the database
Shell> chown-R root.
Shell> chown-R mysql var
Shell> bin/mysqld_safe -- user = mysql & // start the database with a mysql account
Echo "/usr/local/mysql/bin/mysqld_safe -- user = mysql &">/etc/rc. local // set the process to self-start upon startup
4. install Apache 2.2.8
1. tar-xzvf httpd-2.2.8.tar.gz
2. cd httpd-2.2.8
3../configure -- enable-so // if no installation directory is specified
, Default/usr/local/apache2
4. make
5. make install
5. Install PHP5.2.5
1. tar-xzvf php-5.2.5.tar.gz
2. cd php5.2.5
3 ../configure -- with-apxs2 =/usr/local/apache2/bin/apxs -- with-mysql =/usr/local/mysql
4. make
5. make install
6. cp php. ini-dist/usr/local/lib/php. ini // php main configuration file
7. vim/usr/local/apache2/conf/httpd. conf // apache Master configuration file
LoadModule php5_module modules/libphp5.so // View
AddType application/x-httpd-php. php. phtml // added
Echo "/usr/local/apache2/bin/apachectl start">/etc/rc. local
9. Test vim/usr/local/apache2/htdocs/index. php // default apache home directory/usr/local/apache2/htdocs
Phpinfo ();
?>
10. test whether the browser is normal.
Http: // ip-address
If "ip works" is displayed, apache runs normally.
5. Install Discuz 6.0
1. upload the forum to the/usr/local/apache2/htdocs // apache main directory. Be sure to transfer all the content in the Forum's upload directory to the htdocs directory.
2. http: // 172.16.119.230/install. php
// Install the Forum
Go to the installation page
Cd/usr/local/apache2/htdocs
Chmod 777 ***************** // change the directory folder permission to the maximum permission
Note: it is not enough to modify the preceding values. You need to change the execution permissions of all the remaining directories to 777, in this way, the "Re-check settings" on the Discuz settings page is changed to "Next ".
Note that you must change the current status of the Directory files mentioned here to "writable"
(The default status is "not writable ")
Set the database account as above. The database user name here is not the one previously installed
"Mysql", but the system administrator account "root"
Create Forum-related data tables
So far, the Forum has been installed successfully. To ensure security, you must delete the following installation files:
Install. php; install all files in the folder;
To reinstall the Forum, delete the following files:
Forumdata/install. lock
6. Visit the Forum
Http: // ip-address/index. php
The index. php is the index. php In the Forum upload folder.
VII. FAQs:
If you use a GBK forum, the following error may occur during installation:
Database_errno_1115
Vim config. inc. php
$ Dbcharset = ''; // MySQL character set. Optional values: 'gbk', 'big5', 'utf8', and 'latin1'. The reserved values are set according to the Forum character set.
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.