Discuz forum to manually compile the installation of LAMP architecture

LAMP platform overview of
the most mature application mode of a corporate website, provides dynamic Web sites and applications development environment

The components that
Linux, Apache, MySQL, PHP / Perl / Python

LAMP advantage of
cost-effective, customizable, easy to develop

Compile and install the experimental procedure
by Windows to download and share LAMP package


On Linux virtual machine remote access share
[root @ LAMP ~] # smbclient -L //192.168.100.3/
Sharename Type the Comment
--------- ---- -------
LAMP-C7 Disk

[Root @ lamp ~] # mount.cifs //192.168.10.37/LAMP-C7 / mnt // remote mount package under / mnt

[root @ lamp ~] # cd / mnt // into the / mnt directory
[root @ lamp mnt] # ls // Check to get the source package
apr-1.6.2.tar.gz install_lamp.sh
apr-util-1.6. MySQL-5.6.26.tar.gz 0.tar.gz
Discuz_X2.5_SC_UTF8.zip PHP-5.6.11.tar.bz2
the httpd-2.4.29.tar.bz2
. 1
2
. 3
. 4
. 5
. 6
. 7
. 8
. 9
10
. 11
12 is
13 is
1, compile and install the Apache,
1.1. unpack the first source / opt directory
[LAMP the root @ mnt] # zxvf On Apr the tar-1.6.2.tar.gz -C / opt /
...
[the root @ LAMP mnt ] # zxvf On Apr-util the tar-1.6.0.tar.gz -C / opt /
....
[LAMP the root @ mnt] # jxvf the httpd-2.4.29.tar.bz2 the tar -C / opt /
...
[root @ lamp mnt] # cd / opt // into the / opt directory
[root @ lamp opt] # ls // view unzipped
On Apr-util 1.6.2 On Apr-httpd-2.4.29-RH 1.6.0
. 1
2
. 3
. 4
. 5
. 6
. 7
. 8
. 9
1.2. httpd moving component package and install the compiler tool
[@ LAMP the root opt] # Music Videos On Apr-1.6.2 / the httpd-2.4.29 / srclib / On Apr
[@ LAMP the root opt] # Music Videos On Apr-1.6.0-util / the httpd-2.4.29 / srclib / APR- util
[root @ LAMP opt] # yum -y install \
gcc \ // c language
gcc-c ++ \ // c ++ language
make \ // compiler tool
pcre-devel \ // pcre language tools
expat-devel \ // identification tag language tools
perl // perl compiler
. 1
2
. 3
. 4
. 5
. 6
. 7
. 8
. 9
1.3 configuration and installation directory module
[root @ lamp opt] # cd /opt/httpd-2.4.29/
[root @ lamp httpd-2.4.29] #. / configure \ // Configuration
> --prefix = / usr / local / the httpd \
> --enable-SO \ // open core module Apache
> --enable-rewrite \ // open rewriting, security chain
> --enable-charset-lite \ // supported character sets, Simplified Chinese
> --enable-cgi // common gateway Interface
...
. 1
2
. 3
. 4
. 5
. 6
. 7
. 8
1.4. compiling and installing
[root @ lamp httpd-2.4.29] # make // generate executable binaries
...
[root @ LAMP httpd-2.4.29] # the make install // copy the binary files into the system, configure the application environment
...
. 1
2
. 3
. 4
1.5. Alternatively startup script
[root @ lamp httpd-2.4.29] # cp / usr / local / httpd / bin / apachectl /etc/init.d/httpd // copy startup script cover apache httpd the original startup script
1
1.6. httpd configuration file parameters
[root @ LAMP httpd-2.4.29] # vim /etc/init.d/httpd
# / bin / SH!
# chkconfig: 35 85 21
# the Description: the Apache IS A World Wide Web Server // in # / bin /! SUMMARY downlink insert two lines sh
[root @ lamp httpd-2.4.29] # chkconfig --add httpd // added to the httpd SERVICE manager
[root @ lamp httpd-2.4.29] # vim / usr / local / httpd / conf / httpd.conf

Input / ServerName, found: ServerName www.example.com:80 the # sign in front delete comment //www.example.com domain can modify, retain the original unchanged here

Input / Listen, look for 80-port listening, listening and turn this host on port 80 Listen 192.168.235.137: 80 // listen address according to the IP address of each device may be
#Listen 192.168.235.137:80
the Listen 80

[root @ lamp httpd-2.4.29] # httpd -t // Check the configuration file syntax
Syntax OK


. 1
2
. 3
. 4
. 5
. 6
. 7
. 8
. 9
10
. 11
12 is
13 is
14
15
16
. 17
1.7. Create a soft link, to facilitate the management
[root @ lamp httpd-2.4.29] # ln -s / usr / local / httpd / conf / httpd. conf / etc /
[root @ LAMP httpd-2.4.29] # LN -s / usr / local / httpd / bin / * / usr / local / bin /
1
2
1.8. and turn off the firewall service
[root @ lamp httpd- 2.4.29] STOP # systemctl firewalld.service
[the root @ LAMP the httpd-2.4.29] # the setenforce 0
[the root @ LAMP the httpd-2.4.29] # the httpd Start-Service
[the root @ LAMP the httpd-2.4.29] # the netstat - ntuap | grep the httpd
TCP6 0 0 ::: ::: 80 73 975 * the LISTEN / the httpd
. 1
2
. 3
. 4
. 5
2: Installation MYSQL Based coding (note change directory)
[the root @ LAMP mnt] # yum the install the ncurses -Y-devel autoconf CMake // package and installation environment Cmake Kits
[root @ lamp mnt] # tar zxvf mysql-5.6.26 .tar.gz -C / opt / // extract the package solution database compression to the / opt directory

[root @ lamp mnt] # cd / opt // into the / opt directory View-extracting file
[root @ LAMP opt] # LS
httpd 2.4.29 MySQL-5.6.26-rh
[root @ LAMP opt] #cd / opt / MySQL -5.6.26 / // into the database directory
[root @ LAMP MySQL-5.6.26] # cmake \
-DCMAKE_INSTALL_PREFIX = / usr / local / MySQL \ // specify the installation path
-DDEFAULT_CHARSET = utf8 \ // specify the character set
-DDEFAULT_COLLATION = utf8_general_ci \ // specify the default character set
-DEXTRA_CHARSETS = all \ // specify the extended character set
-DSYSCONFIDIR = / etc \ // specify the configuration file directory
-DMYSQL_DATADIR = / home / mysql / \ // specified database data files
- DMYSQL_UNIX_ADDR = / home / mysql / mysql.sock // file connection defined sock database file
. 1
2
. 3
. 4
. 5
. 6
. 7
. 8
. 9
10
. 11
12 is
13 is
14
15
[@ the root-LAMP MySQL 5.6.26] the make #
[@ the root-LAMP MySQL 5.6.26] # the make the install
. 1
2
[the root @-LAMP MySQL 5.6.26] # CP-Support Files / My-default.cnf / etc /my.cnf
cp: overwrite "/etc/my.cnf"? yes
[root @ LAMP MySQL-5.6.26] # cp Support-Files / mysql.server /etc/init.d/mysqld
cp: overwrite "/etc/init.d/mysqld"? yes
[root @ LAMP MySQL-5.6.26] # chmod 755 /etc/init.d/mysqld // grant execute permission
[root @ lamp mysql-5.6.26] # chkconfig --add /etc/init.d/mysqld // Add the database service manager
[root @ lamp mysql-5.6.26] # chkconfig mysqld --level 235 on // open the database run level 2,3,5
[root @ lamp mysql-5.6.26] # echo "PATH = $ PATH: / usr / local / mysql / bin" >> / etc / profile // command to enable the database system environment variables
[root @ lamp mysql-5.6.26] # source / etc / profile // enable system environment variables
[root @ lamp mysql-5.6.26] # echo $ PATH // Check the system environment variables
/ usr / local / sbin: / usr / local / bin: / usr / sbin: / usr / bin: / root / bin: / usr / local / mysql / bin
[root @ LAMP mysql-5.6.26] # useradd -s / sbin / nologin // create mysql user mysql program, banned from the database
[root @ lamp mysql-5.6.26] # chown -R mysql: mysql / usr / local / mysql / // mention the right to all users at / usr / local / mysql / directory
[root @ lamp mysql-5.6.26] # / usr / local / mysql / scripts / mysql_install_db --user = mysql --ldata = / var / lib / mysql --basedir = / usr / local / mysql --datadir = / home / mysql // initialize the database, and specify the user data to a specified directory
[root @ lamp mysql-5.6 .26] # vim /etc/init.d/mysqld // edit profile database
basedir = / usr / local / mysql // line 46 in the local path specified database
// specified in line 47 datadir = / home / mysql database storage location
[root @ lamp mysql-5.6.26] # service mysqld start // open the database service
Starting MySQL. SUCCESS!
[root @ lamp mysql-5.6.26] # netstat -anpt | grep 3306 // view the listening port the database 3306
tcp6 0 0 ::: 3306 ::: * LISTEN 90105 / mysqld
[root @ LAMP MySQL-5.6.26] # mysqladmin -u root -p password "abc123 " // set database root password
. 1
2
. 3
. 4
. 5
. 6
. 7
. 8
. 9
10
. 11
12 is
13 is
14
15
16
. 17
18 is
. 19
20 is
21 is
22 is
3, the installation PHP (Note directory switching)
[the root @ LAMP ~] # yum the install the libpng the libpng -Y-Gd-devel devel PCRE PCRE libjpeg the libxml2-devel-devel // PHP installation environment
[LAMP the root @ ~] # CD / mnt
[LAMP the root @ mnt] # tar jxvf php-5.6.11.tar.bz2 -C / opt / // Extract the PHP Source package

[root @ lamp mnt] # cd /opt/php-5.6.11/ // enter /opt/php-5.6.11/ directory
[root @ lamp php-5.6.11] # ./configure --prefix = / usr / local / php5 --with-gd --with -zlib --with-apxs2 = / usr / local / httpd / bin / apxs --with-mysql = / usr / local / mysql --with-config-file- path = / usr / local / php5 --enable-mbstring // PHP configuration database and related components and related service httpd
[root @ lamp php-5.6.11] # make // compiler, compiled Do not pay attention to the test

[root@lamp php-5.6.11]# make install //安装

[Root @ lamp php-5.6.11] # cp php.ini-development /usr/local/php5/php.ini // copy the configuration file to the directory in php.ini

[Root @ lamp php-5.6.11] # ln -s / usr / local / php5 / bin / * / usr / local / bin / // build PHP command soft link

[root @ lamp php-5.6.11] # vim /etc/httpd.conf // Edit profile httpd
// will replace index.php index.html 256 DirectoryIndex index.html first row to the
255 <IfModule dir_module>
256 the DirectoryIndex the index.php
257 </ IfModule>
// append the line behind another two line entries transducer PHP execute permission granted
the AddType file application / X-PHP the httpd-.php
the AddType file application / X-Source-the httpd-PHP. Phps

[root @ lamp php-5.6.11] # vim /usr/local/httpd/htdocs/index.php // edit PHP page file, writes the following information
<PHP?
phpinfo ();
?>
[root @ LAMP PHP- 5.6.11] # service httpd restart // restart the httpd service

. 1
2
. 3
. 4
. 5
. 6
. 7
. 8
. 9
10
. 11
12 is
13 is
14
15
16
. 17
18 is
. 19
20 is
21 is
22 is
23 is
24
25
26 is
27
28
29
verification PHP Home
added /index.php after the source IP address to log on to the home page specified PHP


4: Install Discuz forum
[root @-LAMP PHP 5.6.11] #cd / mnt
// into the / mnt directory
[root @ LAMP mnt] # Discuz_X2.5_SC_UTF8.zip the unzip -d / opt / Discuz
// extract the Forum Package to / opt directory
[root @ LAMP mnt] # cp -r / opt / Discuz / the Upload / / usr / local / httpd / htdocs / bbs
// copy / opt directory contents to the bbs directory httpd sites
[root @ mnt LAMP] # MySQL -u root -p
// access to the database, the password is set before the abc23
MySQL> the create database bbs;
// create bbs database
mysql> GRANT all ON bbs * tO 'bbsuser'@'192.168.235.137. 'IDENTIFIED BY' admin123 ';
// mention the right database user and set a password for the administrator bbsuser
MySQL> flush privileges;
// refresh the database
MySQL> quit
// exit database
[root @ lamp mnt] # cd / usr / local / the httpd / the htdocs / bbs /
// enter bbs directory
[root @ lamp bbs] # chown -R daemon ./config/
[LAMP the root @ BBS] # chown -R & lt daemon ./data/
[LAMP the root @ BBS] # chown -R & lt daemon ./uc_client/data/cache/[root@lamp BBS] # chown -R & lt daemon ./uc_server/data /
// elevated privileges for the user program
. 1
2
. 3
. 4
. 5
. 6
. 7
. 8
. 9
10
. 11
12 is
13 is
14
15
16
. 17
18 is
. 19
20 is
21 is
22 is
using a browser input 192.168.235.137/bbs officially installed Discuz Forum


In setting up the environment select the "clean installation"


Install the database
here must pay attention to:
Data Server: 192.168.235.137 (IP entered here to create the database host)

Database name: bbs

Database Username: bbsuser (user name can be modified at the command line)

Database Password: admin123 (password can be modified at the command line)

Administrator account: admin (This account is the default)

Password: 123123 (password can be set directly on the page)


After a successful installation into the forum home page
using an administrator account login management center can click on the top right of the daily management


Equivalent management center to enter the page background

 

Guess you like

Origin www.cnblogs.com/java67/p/11728768.html