Article Title: apache2.2 + mysql5.0 + php5.1 + Discuz! 4.1 configuration. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
1. install Apache
There are two ways to use PHP with Apache:
As a dynamic module, it can be loaded to the Web server during running;
Or as a static module, it can be directly compiled into the Web server code.
We focus on the first method.
To enable PHP to be dynamically loaded using the Apache module, the Apache server must be compiled with a Dynamic Shared Object (DSO, Dynamic Shared Object. You can pass the -- enable-so parameter to make this feature take effect.
# Cd/extract directory/httpd-2.2.2
#./Configure -- prefix =/usr/local/apache -- enable-so
# Make
# Make install
2. Install mysql5.0.18 (source code package)
The source code package can be obtained at this URL:
Http://download.mysql.cn/src/2006/0208/62.html
All these operations require root permissions.
Installation start:
# Groupadd mysql
# Useradd-g mysql
# Gunzip <mysql-VERSION.tar.gz
# Cd mysql-VERSION
#./Configure -- prefix =/usr/local/mysql -- with-charset = gb2312
# Make
# Make install
# Cp support-files/my-medium.cnf/etc/my. cnf
# Cd/usr/local/mysql
# Chown-R root.
# Chown-R mysql var
# Chgrp-R mysql.
#./Bin/mysqld_safe -- user = mysql &
(It is important to start with a mysql user .)
#./Bin/mysql-uroot-p
(Enter the password. The default password is blank. Press enter)
Can't connect to local MySQL server through socket '/tmp/mysql. sock' (2)
If the above prompt is displayed, it indicates that the mysql service is not started properly. Because the mysql service is started, the mysql. sock file is automatically generated.
# Killall mysql
Kill all mysql processes and restart them.
./Bin/mysql_install_db -- user = mysql
Restart
./Bin/mysql-uroot-p
Description: encoding. when mysql is installed, latin1 encoding is used by default. To change the default encoding, use the option -- with-charst.
For example:
#./Configure -- with-charset = CHARSET
3. install php ./Configure -- prefix =/usr/local/php5 (configure php parameters)
-- With-apxs2 =/usr/local/apache2/bin/apxs
-- With-libxml-dir =/usr/local/lib
-- With-zlib-dir =/usr/local/lib
-- With-mysql =/usr/local/mysql (mysql installation directory is the decompressed directory)
-- Enable-soap -- enable-sockets
# Make
# Make install
Change the php. ini-dist file in the installation directory to the/usr/local/lib file stored in php. ini.
4. Edit the Apache configuration file/usr/local/apache/conf/httpd. conf and add the following line:
5. Test Create the test. php file and place it in the htdocs directory of apache. The content is as follows:
Phpinfo ();
?>
View http: // localhost/test. php in a browser
6. Install Discuz! Forum Program ① Find Discuz online! Forum program and decompress it (the process will not be repeated)
② Step 2: Upload
Log on to your server using FTP software, create a separate directory, or select a proper location to ensure that the files stored in this location can be accessed by web requests, the directory has the permission to execute PHP code. Discuz! Upload all files and directory structures in the./upload directory of the package to the server (upload files and directories in the upload directory instead of uploading directories and structures containing the upload directory ).
(If you are only doing experiments, you do not need to upload them to the server. Copy them directly to any directory with permissions and set them in httpd. conf)
③ Set Directory properties in step 3
Before installation, you must set related directory properties so that data files can be Discuz! Correct read/write. Set the following directory attribute to 777.
./Templates
./Templates/default
./Templates/default /*.*
./Attachments
./Customavatar
./Forumdata
./Forumdata/cache
./Forumdata/templates
Step 4: Configure database information
Use the editor to open the default configuration file (config. inc. php) on your local machine and view the following content:
$ Dbhost = 'localhost'; // database server
// Database Server
$ Dbname = 'discuz'; // database name
// Database Name
$ Adminemail = 'admin @ your.com '; // admin email
// Forum system Email
$ Dbreport = 0; // send db error report? 1 = yes
// Do you want to send a Database Error Report? 0 = No, 1 = Yes
Configure the database server, user name, password, and database name provided by the space service provider based on the preceding annotations. If you use a self-installed server environment, we recommend that you do not use the root account whenever possible, instead, based on Discuz! And other software needs on the server, allocate accounts and databases for each program separately to reduce the possibility of security issues.
Step 5: Execute the installation script
Your installation is in the last step. Run install. php in your browser, that is, access http: // your domain name/Forum directory/install. php to complete the final installation.
The installation script checks the system environment, available space, and database environment of your server, and has certain error correction functions. If you have any problems with the previous steps, the installation script will usually find and prompt you. Check the installation process as prompted. If no problem is prompted, follow the instructions to complete the final installation.
After the installation is successful, delete the installation script (install. php) to avoid re-installation. If you do not delete it, you cannot set it when you enter the background of the Forum.
Note: The above lab environment is RedHat AS4 + VMWare5.5
Okay, the whole process is over. I believe you should feel the joy of success now. I personally think that a sense of accomplishment exists when I learn Linux and see the final result! Now, I hope you can join the Linux wild tribe and talk about it!
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