一. 基本配置。

 

1.[[email protected] ~]# rpm -qa | grep httpd

httpd-manual-2.0.52-25.ent (server program(程序))

httpd-2.0.52-25.ent (手册文档)

httpd-suexec-2.0.52-25.ent

system-config-httpd-1.3.1-1

2.[[email protected] ~]# service httpd restart

Stopping httpd: [FAILED]

Starting httpd: [ OK ]

[[email protected] ~]# service httpd restart

Stopping httpd: [ OK ]

Starting httpd: [ OK ]

3. [[email protected] ~]# chkconfig --list httpd

httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off

[[email protected] ~]# chkconfig --level 35 httpd on

[[email protected] ~]# chkconfig --list httpd

httpd 0:off 1:off 2:off 3:on 4:off 5:on 6:off

[[email protected] ~]#

4 .client test

linux4.0 apache relevant config

5. [[email protected] ~]# grep -v "#" /etc/httpd/conf/httpd.conf

ServerTokens OS

ServerRoot "/etc/httpd"

PidFile run/httpd.pid

Timeout 120

KeepAlive Off

MaxKeepAliveRequests 100

KeepAliveTimeout 15

<IfModule prefork.c>

StartServers 8

MinSpareServers 5

MaxSpareServers 20

ServerLimit 256

MaxClients 256

MaxRequestsPerChild 4000

</IfModule>

<IfModule worker.c>

StartServers 2

MaxClients 150

MinSpareThreads 25

MaxSpareThreads 75

ThreadsPerChild 25

MaxRequestsPerChild 0

</IfModule>

Listen 80

LoadModule access_module modules/mod_access.so

LoadModule auth_module modules/mod_auth.so

LoadModule auth_anon_module modules/mod_auth_anon.so

LoadModule auth_dbm_module modules/mod_auth_dbm.so

LoadModule auth_digest_module modules/mod_auth_digest.so

LoadModule ldap_module modules/mod_ldap.so

LoadModule auth_ldap_module modules/mod_auth_ldap.so

LoadModule include_module modules/mod_include.so

LoadModule log_config_module modules/mod_log_config.so

LoadModule env_module modules/mod_env.so

LoadModule mime_magic_module modules/mod_mime_magic.so

LoadModule cern_meta_module modules/mod_cern_meta.so

LoadModule expires_module modules/mod_expires.so

LoadModule deflate_module modules/mod_deflate.so

LoadModule headers_module modules/mod_headers.so

LoadModule usertrack_module modules/mod_usertrack.so

LoadModule setenvif_module modules/mod_setenvif.so

LoadModule mime_module modules/mod_mime.so

LoadModule dav_module modules/mod_dav.so

LoadModule status_module modules/mod_status.so

LoadModule autoindex_module modules/mod_autoindex.so

LoadModule asis_module modules/mod_asis.so

LoadModule info_module modules/mod_info.so

LoadModule dav_fs_module modules/mod_dav_fs.so

LoadModule vhost_alias_module modules/mod_vhost_alias.so

LoadModule negotiation_module modules/mod_negotiation.so

LoadModule dir_module modules/mod_dir.so

LoadModule imap_module modules/mod_imap.so

LoadModule actions_module modules/mod_actions.so

LoadModule speling_module modules/mod_speling.so

LoadModule userdir_module modules/mod_userdir.so

LoadModule alias_module modules/mod_alias.so

LoadModule rewrite_module modules/mod_rewrite.so

LoadModule proxy_module modules/mod_proxy.so

LoadModule proxy_ftp_module modules/mod_proxy_ftp.so

LoadModule proxy_http_module modules/mod_proxy_http.so

LoadModule proxy_connect_module modules/mod_proxy_connect.so

LoadModule cache_module modules/mod_cache.so

LoadModule suexec_module modules/mod_suexec.so

LoadModule disk_cache_module modules/mod_disk_cache.so

LoadModule file_cache_module modules/mod_file_cache.so

LoadModule mem_cache_module modules/mod_mem_cache.so

LoadModule cgi_module modules/mod_cgi.so

Include conf.d/*.conf

User apache

Group apache

ServerAdmin [email protected]

UseCanonicalName Off

DocumentRoot "/var/www/html"

 

<Directory />

Options FollowSymLinks

AllowOverride None

</Directory>

<Directory "/var/www/html">

Options Indexes FollowSymLinks

AllowOverride None

Order allow,deny

Allow from all

</Directory>

<IfModule mod_userdir.c>

UserDir disable

</IfModule>

DirectoryIndex index.html index.html.var

AccessFileName .htaccess

<Files ~ "^\.ht">

Order allow,deny

Deny from all

</Files>

TypesConfig /etc/mime.types

DefaultType text/plain

<IfModule mod_mime_magic.c>

MIMEMagicFile conf/magic

</IfModule>

HostnameLookups Off

ErrorLog logs/error_log

LogLevel warn

LogFormat "%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common

LogFormat "%{Referer}i -&gt; %U" referer

LogFormat "%{User-agent}i" agent

CustomLog logs/access_log combined

ServerSignature On

Alias /icons/ "/var/www/icons/"

<Directory "/var/www/icons">

Options Indexes MultiViews

AllowOverride None

Order allow,deny

Allow from all

</Directory>

<IfModule mod_dav_fs.c>

DAVLockDB /var/lib/dav/lockdb

</IfModule>

ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

<Directory "/var/www/cgi-bin">

AllowOverride None

Options None

Order allow,deny

Allow from all

</Directory>

IndexOptions FancyIndexing VersionSort Name>

AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip

AddIconByType (TXT,/icons/text.gif) text/*

AddIconByType (IMG,/icons/p_w_picpath2.gif) p_w_picpath/*

AddIconByType (SND,/icons/sound2.gif) audio/*

AddIconByType (VID,/icons/movie.gif) video/*

AddIcon /icons/binary.gif .bin .exe

AddIcon /icons/binhex.gif .hqx

AddIcon /icons/tar.gif .tar

AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv

AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip

AddIcon /icons/a.gif .ps .ai .eps

AddIcon /icons/layout.gif .html .shtml .htm .pdf

AddIcon /icons/text.gif .txt

AddIcon /icons/c.gif .c

AddIcon /icons/p.gif .pl .py

AddIcon /icons/f.gif .for

AddIcon /icons/dvi.gif .dvi

AddIcon /icons/uuencoded.gif .uu

AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl

AddIcon /icons/tex.gif .tex

AddIcon /icons/bomb.gif core

AddIcon /icons/back.gif ..

AddIcon /icons/hand.right.gif README

AddIcon /icons/folder.gif ^^DIRECTORY^^

AddIcon /icons/blank.gif ^^BLANKICON^^

DefaultIcon /icons/unknown.gif

ReadmeName README.html

HeaderName HEADER.html

AddLanguage ca .ca

AddLanguage cs .cz .cs

AddLanguage da .dk

AddLanguage de .de

AddLanguage el .el

AddLanguage en .en

AddLanguage eo .eo

AddLanguage es .es

AddLanguage et .et

AddLanguage fr .fr

AddLanguage he .he

AddLanguage hr .hr

AddLanguage it .it

AddLanguage ja .ja

AddLanguage ko .ko

AddLanguage ltz .ltz

AddLanguage nl .nl

AddLanguage nn .nn

AddLanguage no .no

AddLanguage pl .po

AddLanguage pt .pt

AddLanguage pt-BR .pt-br

AddLanguage ru .ru

AddLanguage sv .sv

AddLanguage zh-CN .zh-cn

AddLanguage zh-TW .zh-tw

LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW

ForceLanguagePriority Prefer Fallback

AddDefaultCharset UTF-8

AddCharset ISO-8859-1 .iso8859-1 .latin1

AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen

AddCharset ISO-8859-3 .iso8859-3 .latin3

AddCharset ISO-8859-4 .iso8859-4 .latin4

AddCharset ISO-8859-5 .iso8859-5 .latin5 .cyr .iso-ru

AddCharset ISO-8859-6 .iso8859-6 .latin6 .arb

AddCharset ISO-8859-7 .iso8859-7 .latin7 .grk

AddCharset ISO-8859-8 .iso8859-8 .latin8 .heb

AddCharset ISO-8859-9 .iso8859-9 .latin9 .trk

AddCharset ISO-2022-JP .iso2022-jp .jis

AddCharset ISO-2022-KR .iso2022-kr .kis

AddCharset ISO-2022-CN .iso2022-cn .cis

AddCharset Big5 .Big5 .big5

AddCharset WINDOWS-1251 .cp-1251 .win-1251

AddCharset CP866 .cp866

AddCharset KOI8-r .koi8-r .koi8-ru

AddCharset KOI8-ru .koi8-uk .ua

AddCharset ISO-10646-UCS-2 .ucs2

AddCharset ISO-10646-UCS-4 .ucs4

AddCharset UTF-8 .utf8

AddCharset GB2312 .gb2312 .gb

AddCharset utf-7 .utf7

AddCharset utf-8 .utf8

AddCharset big5 .big5 .b5

AddCharset EUC-TW .euc-tw

AddCharset EUC-JP .euc-jp

AddCharset EUC-KR .euc-kr

AddCharset shift_jis .sjis

AddType application/x-compress .Z

AddType application/x-gzip .gz .tgz

AddHandler imap-file map

AddHandler type-map var

AddType text/html .shtml

AddOutputFilter INCLUDES .shtml

Alias /error/ "/var/www/error/"

<IfModule mod_negotiation.c>

<IfModule mod_include.c>

<Directory "/var/www/error">

AllowOverride None

Options IncludesNoExec

AddOutputFilter Includes html

AddHandler type-map var

Order allow,deny

Allow from all

LanguagePriority en es de fr

ForceLanguagePriority Prefer Fallback

</Directory>

</IfModule>

</IfModule>

BrowserMatch "Mozilla/2" nokeepalive

BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0

BrowserMatch "RealPlayer 4\.0" force-response-1.0

BrowserMatch "Java/1\.0" force-response-1.0

BrowserMatch "JDK/1\.0" force-response-1.0

BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully

BrowserMatch "^WebDrive" redirect-carefully

BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully

BrowserMatch "^gnome-vfs" redirect-carefully

二. 设置个人主页

 

1.[[email protected] ~]# vi /etc/httpd/conf/httpd.conf

# UserDir disable (一定要用“#‘注释掉)

UserDir public_html (去掉“#”)

</IfModule>

#

# Control access to UserDir directories. The following is an example

# for a site where these directories are restricted to read-only.

#

<Directory /home/*/public_html>

AllowOverride FileInfo AuthConfig Limit

Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec

<Limit GET POST OPTIONS>

Order allow,deny (12行全部去掉“#”。表示个人主页相关权限)

Allow from all

</Limit>

<LimitExcept GET POST OPTIONS>

Order deny,allow

Deny from all

</LimitExcept>

</Directory>

[[email protected] ~]# service httpd restart

Stopping httpd: [ OK ]

Starting httpd: [ OK ]

方法1

[[email protected] home]# ls

abc1 abc2 ftpsite fung

[[email protected] home]# cd

[[email protected] ~]# su - abc1

[[email protected] ~]$ pwd

/home/abc1

[[email protected] ~]$ ls

[[email protected] ~]$ ls -ld .

drwx------ 3 abc1 abc1 4096 Jul 30 18:15 .

[[email protected] ~]$ chmod o+x .

[[email protected] ~]$ ls -ld .

drwx-----x 3 abc1 abc1 4096 Jul 30 18:15 .

[[email protected] ~]$ mkdir public_html

[[email protected] ~]$ vi public_html/index.html

Who shi httpd server

Hello

My name is michael fung.

 

 

 

linux4.0 apache relevant config

方法2

[[email protected] ~]# cd /home

[[email protected] home]# ls

abc1 abc2 ftpsite fung

[[email protected] home]# cd abc2

[[email protected] abc2]# ls

aaa

[[email protected] abc2]# mkdir public_html

[[email protected] abc2]# ls

aaa public_html

[[email protected] abc2]# cd public_html/

[[email protected] public_html]# vi index.html

 

who sho abc2 user httpd server

~

~"index.html" [New] 1L, 31C written

[[email protected] home]# ll

total 16

drwx-----x 4 abc1 abc1 4096 Aug 4 14:25 abc1

drwx------ 4 abc2 abc2 4096 Aug 4 14:52 abc2

drwx------ 3 feng feng 4096 Aug 4 03:45 ftpsite

drwx------ 3 fung fung 4096 Jul 30 22:50 fung

[[email protected] home]# chmod -R 755 abc2

[[email protected] home]# ll

total 16

drwx-----x 4 abc1 abc1 4096 Aug 4 14:25 abc1

drwxr-xr-x 4 abc2 abc2 4096 Aug 4 14:52 abc2

drwx------ 3 feng feng 4096 Aug 4 03:45 ftpsite

drwx------ 3 fung fung 4096 Jul 30 22:50 fung

[[email protected] abc2]# ll

total 8

-rwxr-xr-x 1 root root 21 Aug 4 06:14 aaa

drwxr-xr-x 2 root root 4096 Aug 4 14:52 public_html

[[email protected] abc2]# chown -R abc2:abc2 public_html/

[[email protected] abc2]# ll

total 8

-rwxr-xr-x 1 root root 21 Aug 4 06:14 aaa

drwxr-xr-x 2 abc2 abc2 4096 Aug 4 14:52 public_html

[[email protected] abc2]# cd public_html/

[[email protected] public_html]# ll

total 4

-rwxr-xr-x 1 abc2 abc2 31 Aug 4 14:52 index.html

 

 

 

 

 

 

 

linux4.0 apache relevant config

 

三. 虚拟目录

1.[[email protected] ~]# vi /etc/httpd/conf/httpd.conf

#

NameVirtualHost *:80 (start virtual directory

#

# NOTE: NameVirtualHost cannot be used without a port specifier

# (e.g. :80) if mod_ssl is being used, due to the nature of the

# SSL protocol.

#

 

#

# VirtualHost example:

# Almost any Apache directive may go into a VirtualHost container.

# The first VirtualHost section is used for requests without a known

# server name.

#

<VirtualHost *:80>

ServerAdmin [email protected]

DocumentRoot /var/www/abc.com (virtual directory abc.com relevant config)

ServerName www.abc.com

ErrorLog logs/abc.com-error_log

CustomLog logs/dummy-host.example.com-access_log common

</VirtualHost>

 

<VirtualHost *:80>

ServerAdmin [email protected]

DocumentRoot /var/www/abcd.com (virtual directory abcd.com relevant config)

ServerName www.abcd.com

ErrorLog logs/abcd.com-error_log

CustomLog logs/dummy-host.example.com-access_log common

</VirtualHost>

2.[[email protected] ~]# cd /var/www

[[email protected] www]# ls

cgi-bin error html icons manual usage

[[email protected] www]# mkdir abc.com abcd.com

[[email protected] www]# ls

abc.com abcd.com cgi-bin error html icons manual usage

[[email protected] www]#

[[email protected] www]# cd abc.com

[[email protected] abc.com]# ls

[[email protected] abc.com]# vi index.html

 

wo shi abc.com

~

[[email protected] www]# cd abcd.com

[[email protected] abcd.com]# ls

[[email protected] abcd.com]# vi index.html

 

wo shi abcd.com

 

 

[[email protected] ~]# service httpd restart

Stopping httpd: [ OK ]

Starting httpd: [ OK ]

 

3. Client test .

linux4.0 apache relevant config

 

 

linux4.0 apache relevant config

 

 

linux4.0 apache relevant config

 

 

linux4.0 apache relevant config

 

 

4. ok!

 

 

 

四. LAMP环境搭建。

 

1[[email protected] ~]# rpm -qa | grep mysql*

mysql-devel-4.1.20-1.RHEL4.1

mysql-4.1.20-1.RHEL4.1 CLIENT 端)

mysqlclient10-3.23.58-4.RHEL4.1 (驱动)

libdbi-dbd-mysql-0.6.5-10.RHEL4.1 (驱动)

2[[email protected] RPMS]# ls mysql*

mysql-4.1.20-1.RHEL4.1.i386.rpm

mysql-bench-4.1.20-1.RHEL4.1.i386.rpm

mysql-devel-4.1.20-1.RHEL4.1.i386.rpm

mysql-server-4.1.20-1.RHEL4.1.i386.rpm SERVER 端)

mysqlclient10-3.23.58-4.RHEL4.1.i386.rpm

mysqlclient10-devel-3.23.58-4.RHEL4.1.i386.rpm

[[email protected] RPMS]# rpm -ivh mysql-server-4.1.20-1.RHEL4.1.i386.rpm

warning: mysql-server-4.1.20-1.RHEL4.1.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e

Preparing... ########################################### [100%]

1:mysql-server ########################################### [100%]

[[email protected] RPMS]# cd

[[email protected] ~]# rpm -qa | grep mysql*

mysql-devel-4.1.20-1.RHEL4.1

mysql-4.1.20-1.RHEL4.1

mysqlclient10-3.23.58-4.RHEL4.1

mysql-server-4.1.20-1.RHEL4.1

libdbi-dbd-mysql-0.6.5-10.RHEL4.

3[[email protected] ~]# chkconfig --list | grep mysqld

mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off

[[email protected] ~]# chkconfig --level 35 mysqld on

[[email protected] ~]# chkconfig --list | grep mysqld

mysqld 0:off 1:off 2:off 3:on 4:off 5:on 6:off

[[email protected] ~]#

[[email protected] ~]# service mysqld restart

Stopping MySQL: [FAILED]

Initializing MySQL database: [ OK ]

Starting MySQL: [ OK ]

[[email protected] ~]# service mysqld restart

Stopping MySQL: [ OK ]

Starting MySQL: [ OK ]

[[email protected] ~]# service mysqld status

mysqld (pid 4576) is running...

4[[email protected] ~]# mysqladmin -u root password '123456'

[[email protected] ~]# mysql -u root -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 4 to server version: 4.1.20

 

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

 

mysql&gt;

 

 

[[email protected] ~]# mysql -u root-p 漏洞)

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 6 to server version: 4.1.20

 

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

 

mysql&gt; exit

Bye

~

注意:”mysqladmin –u root passwodr ‘123456’” 为mysqladmin 员 ROOT 用户设定密码,为个安全起见,在start mysql 后一定要为其设定密码。

“ Mysqladmin in the root and system in the root is different (不同的).”

“mysql -u root “ 没有设定密码前 login mysql方法。设定密码后不能login mysql”

“mysql -u root -p “ 设定密码后的正确login mysql 方法.并且,要输入密码。

“mysql -u root–p “~设定密码后不正确login mysql 方法,并且,不用输入密码,视为新发现在mysql的漏洞,

 

~5。[[email protected] ~]# mysql -u root -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 8 to server version: 4.1.20

 

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

 

mysql&gt; show databases; (查看MYSQL中有那些数据库)

+----------+

| Database |

+----------+

| mysql |

| test |

+----------+

2 rows in set (0.00 sec)

mysql&gt; create database abc;

Query OK, 1 row affected (0.01 sec)

 

mysql&gt; show databases;

+----------+

| Database |

+----------+

| abc |

| mysql |

| test |

+----------+

3 rows in set (0.00 sec)

 

mysql&gt;

6.[[email protected] ~]# rpm -qa | grep php

php-4.3.9-3.1

php-ldap-4.3.9-3.15

php-pear-4.3.9-3.15

[[email protected] ~]# cd /var/www/html

[[email protected] html]# ls

[[email protected] html]# ll

total 0

[[email protected] html]# vi index.php (create php test 网页)

<?php

phpinfo();

?>

~

~

"index.php" [New] 3L, 20C written

[[email protected] html]# cd

[[email protected] ~]# vi /etc/httpd/conf/httpd.conf

 

# SSL protocol.

#

#NameVirtualHost *:80

#

# NOTE: NameVirtualHost cannot be used without a port specifier

# (e.g. :80) if mod_ssl is being used, due to the nature of the

# SSL protocol.

#

 

#

# VirtualHost example:

# Almost any Apache directive may go into a VirtualHost container.

# The first VirtualHost section is used for requests without a known

# server name.

#

#VirtualHost *:80&gt;

# ServerAdmin [email protected]

# DocumentRoot /var/www/abc.com

# ServerName www.abc.com

# ErrorLog logs/abc.com-error_log

# CustomLog logs/dummy-host.example.com-access_log common

#/VirtualHost&gt;

 

#<VirtualHost *:80>

# ServerAdmin [email protected]

# DocumentRoot /var/www/abcd.com

# ServerName www.abcd.com

# ErrorLog logs/abcd.com-error_log

# CustomLog logs/dummy-host.example.com-access_log common

#</VirtualHost>

"/etc/httpd/conf/httpd.conf" 1038L, 34816C written

 

注意:要注释虚拟主机的配置,不然,PHP 无法正常显示。

 

[[email protected] ~]# service httpd restart

Stopping httpd: [ OK ]

Starting httpd: [ OK ]

7.PHP TEST

linux4.0 apache relevant config

 

 

8.[[email protected] ~]# mount /dev/cdrom /mnt

mount: block device /dev/cdrom is write-protected, mounting read-only

[[email protected] ~]# cd /mnt

[[email protected] mnt]# ls

bbs (bbs就是phpBB论坛解压缩后的文件)

~

~

9.[[email protected] mnt]# cp -R bbs/ /var/www/html (copy bbs to /var/www/html

[[email protected] mnt]# cd

[[email protected] ~]# cd /var/www/htm

[[email protected] html]# ls

bbs index.php

10.TEST

linux4.0 apache relevant config

linux4.0 apache relevant config

Next:

linux4.0 apache relevant config

linux4.0 apache relevant config

11. [[email protected] bbs]# cd p_w_picpaths/

[[email protected] p_w_picpaths]# ls

avatars icons index.htm ranks smilies spacer.gif upload_icons

[[email protected] p_w_picpaths]# cd avatars/

[[email protected] avatars]# ls

gallery index.htm upload

[[email protected] avatars]# ll

total 12

dr-xr-xr-x 2 root root 4096 Aug 4 16:13 gallery

-r-xr-xr-x 1 root root 169 Aug 4 16:13 index.htm

dr-xr-xr-x 2 root root 4096 Aug 4 16:13 upload

[[email protected] avatars]# chmod -R 766 upload

[[email protected] avatars]# ll

total 12

dr-xr-xr-x 2 root root 4096 Aug 4 16:13 gallery

-r-xr-xr-x 1 root root 169 Aug 4 16:13 index.htm

drwxrw-rw- 2 root root 4096 Aug 4 16:13 upload

linux4.0 apache relevant config

12. [[email protected] bbs]# ll

total 404

dr-xr-xr-x 4 root root 4096 Aug 4 16:13 adm

dr-xr-xr-x 2 root root 4096 Aug 4 16:13 cache

-r-xr-xr-x 1 root root 6204 Aug 4 16:13 common.php

-r-xr-xr-x 1 root root 0 Aug 4 16:13 config.php

-r-xr-xr-x 1 root root 6004 Aug 4 16:13 cron.php

dr-xr-xr-x 2 root root 4096 Aug 4 16:13 docs

dr-xr-xr-x 2 root root 4096 Aug 4 16:13 download

-r-xr-xr-x 1 root root 1485 Aug 4 16:13 faq.php

dr-xr-xr-x 2 root root 4096 Aug 4 16:13 files

dr-xr-xr-x 7 root root 4096 Aug 4 16:13 p_w_picpaths

dr-xr-xr-x 13 root root 4096 Aug 4 16:13 includes

-r-xr-xr-x 1 root root 4817 Aug 4 16:13 index.php

dr-xr-xr-x 5 root root 4096 Aug 4 16:13 install

dr-xr-xr-x 5 root root 4096 Aug 4 16:13 language

-r-xr-xr-x 1 root root 21879 Aug 4 16:13 mcp.php

-r-xr-xr-x 1 root root 59666 Aug 4 16:13 memberlist.php

-r-xr-xr-x 1 root root 56122 Aug 4 16:13 posting.php

-r-xr-xr-x 1 root root 4282 Aug 4 16:13 report.php

-r-xr-xr-x 1 root root 41197 Aug 4 16:13 search.php

dr-xr-xr-x 2 root root 4096 Aug 4 16:13 store

-r-xr-xr-x 1 root root 8007 Aug 4 16:13 style.php

dr-xr-xr-x 5 root root 4096 Aug 4 16:13 styles

-r-xr-xr-x 1 root root 9457 Aug 4 16:13 ucp.php

-r-xr-xr-x 1 root root 28486 Aug 4 16:13 viewforum.php

-r-xr-xr-x 1 root root 13965 Aug 4 16:13 viewonline.php

-r-xr-xr-x 1 root root 62006 Aug 4 16:13 viewtopic.php

[[email protected] bbs]# chmod 766 config.php

[[email protected] bbs]# ll

total 404

dr-xr-xr-x 4 root root 4096 Aug 4 16:13 adm

dr-xr-xr-x 2 root root 4096 Aug 4 16:13 cache

-r-xr-xr-x 1 root root 6204 Aug 4 16:13 common.php

-rwxrw-rw- 1 root root 0 Aug 4 16:13 config.php

-r-xr-xr-x 1 root root 6004 Aug 4 16:13 cron.php

dr-xr-xr-x 2 root root 4096 Aug 4 16:13 docs

dr-xr-xr-x 2 root root 4096 Aug 4 16:13 download

-r-xr-xr-x 1 root root 1485 Aug 4 16:13 faq.php

dr-xr-xr-x 2 root root 4096 Aug 4 16:13 files

dr-xr-xr-x 7 root root 4096 Aug 4 16:13 p_w_picpaths

dr-xr-xr-x 13 root root 4096 Aug 4 16:13 includes

-r-xr-xr-x 1 root root 4817 Aug 4 16:13 index.php

dr-xr-xr-x 5 root root 4096 Aug 4 16:13 install

dr-xr-xr-x 5 root root 4096 Aug 4 16:13 language

-r-xr-xr-x 1 root root 21879 Aug 4 16:13 mcp.php

-r-xr-xr-x 1 root root 59666 Aug 4 16:13 memberlist.php

-r-xr-xr-x 1 root root 56122 Aug 4 16:13 posting.php

-r-xr-xr-x 1 root root 4282 Aug 4 16:13 report.php

-r-xr-xr-x 1 root root 41197 Aug 4 16:13 search.php

dr-xr-xr-x 2 root root 4096 Aug 4 16:13 store

-r-xr-xr-x 1 root root 8007 Aug 4 16:13 style.php

dr-xr-xr-x 5 root root 4096 Aug 4 16:13 styles

-r-xr-xr-x 1 root root 9457 Aug 4 16:13 ucp.php

-r-xr-xr-x 1 root root 28486 Aug 4 16:13 viewforum.php

-r-xr-xr-x 1 root root 13965 Aug 4 16:13 viewonline.php

-r-xr-xr-x 1 root root 62006 Aug 4 16:13 viewtopic.php

 

linux4.0 apache relevant config

13. [[email protected] bbs]# ll

total 404

dr-xr-xr-x 4 root root 4096 Aug 4 16:13 adm

dr-xr-xr-x 2 root root 4096 Aug 4 16:13 cache

-r-xr-xr-x 1 root root 6204 Aug 4 16:13 common.php

-rwxrw-rw- 1 root root 0 Aug 4 16:13 config.php

-r-xr-xr-x 1 root root 6004 Aug 4 16:13 cron.php

dr-xr-xr-x 2 root root 4096 Aug 4 16:13 docs

dr-xr-xr-x 2 root root 4096 Aug 4 16:13 download

-r-xr-xr-x 1 root root 1485 Aug 4 16:13 faq.php

dr-xr-xr-x 2 root root 4096 Aug 4 16:13 files

dr-xr-xr-x 7 root root 4096 Aug 4 16:13 p_w_picpaths

dr-xr-xr-x 13 root root 4096 Aug 4 16:13 includes

-r-xr-xr-x 1 root root 4817 Aug 4 16:13 index.php

dr-xr-xr-x 5 root root 4096 Aug 4 16:13 install

dr-xr-xr-x 5 root root 4096 Aug 4 16:13 language

-r-xr-xr-x 1 root root 21879 Aug 4 16:13 mcp.php

-r-xr-xr-x 1 root root 59666 Aug 4 16:13 memberlist.php

-r-xr-xr-x 1 root root 56122 Aug 4 16:13 posting.php

-r-xr-xr-x 1 root root 4282 Aug 4 16:13 report.php

-r-xr-xr-x 1 root root 41197 Aug 4 16:13 search.php

dr-xr-xr-x 2 root root 4096 Aug 4 16:13 store

-r-xr-xr-x 1 root root 8007 Aug 4 16:13 style.php

dr-xr-xr-x 5 root root 4096 Aug 4 16:13 styles

-r-xr-xr-x 1 root root 9457 Aug 4 16:13 ucp.php

-r-xr-xr-x 1 root root 28486 Aug 4 16:13 viewforum.php

-r-xr-xr-x 1 root root 13965 Aug 4 16:13 viewonline.php

-r-xr-xr-x 1 root root 62006 Aug 4 16:13 viewtopic.php

[[email protected] bbs]# chmod -R 766 cache

[[email protected] bbs]# chmod -R 766 files

[[email protected] bbs]# chmod -R 766 store

[[email protected] bbs]# ll

total 404

dr-xr-xr-x 4 root root 4096 Aug 4 16:13 adm

drwxrw-rw- 2 root root 4096 Aug 4 16:13 cache

-r-xr-xr-x 1 root root 6204 Aug 4 16:13 common.php

-rwxrw-rw- 1 root root 0 Aug 4 16:13 config.php

-r-xr-xr-x 1 root root 6004 Aug 4 16:13 cron.php

dr-xr-xr-x 2 root root 4096 Aug 4 16:13 docs

dr-xr-xr-x 2 root root 4096 Aug 4 16:13 download

-r-xr-xr-x 1 root root 1485 Aug 4 16:13 faq.php

drwxrw-rw- 2 root root 4096 Aug 4 16:13 files

dr-xr-xr-x 7 root root 4096 Aug 4 16:13 p_w_picpaths

dr-xr-xr-x 13 root root 4096 Aug 4 16:13 includes

-r-xr-xr-x 1 root root 4817 Aug 4 16:13 index.php

dr-xr-xr-x 5 root root 4096 Aug 4 16:13 install

dr-xr-xr-x 5 root root 4096 Aug 4 16:13 language

-r-xr-xr-x 1 root root 21879 Aug 4 16:13 mcp.php

-r-xr-xr-x 1 root root 59666 Aug 4 16:13 memberlist.php

-r-xr-xr-x 1 root root 56122 Aug 4 16:13 posting.php

-r-xr-xr-x 1 root root 4282 Aug 4 16:13 report.php

-r-xr-xr-x 1 root root 41197 Aug 4 16:13 search.php

drwxrw-rw- 2 root root 4096 Aug 4 16:13 store

-r-xr-xr-x 1 root root 8007 Aug 4 16:13 style.php

dr-xr-xr-x 5 root root 4096 Aug 4 16:13 styles

-r-xr-xr-x 1 root root 9457 Aug 4 16:13 ucp.php

-r-xr-xr-x 1 root root 28486 Aug 4 16:13 viewforum.php

-r-xr-xr-x 1 root root 13965 Aug 4 16:13 viewonline.php

-r-xr-xr-x 1 root root 62006 Aug 4 16:13 viewtopic.php

linux4.0 apache relevant config

14. [[email protected] RPMS]# ls php*

php-4.3.9-3.15.i386.rpm php-mysql-4.3.9-3.15.i386.rpm

php-devel-4.3.9-3.15.i386.rpm php-ncurses-4.3.9-3.15.i386.rpm

php-domxml-4.3.9-3.15.i386.rpm php-odbc-4.3.9-3.15.i386.rpm

php-gd-4.3.9-3.15.i386.rpm php-pear-4.3.9-3.15.i386.rpm

php-imap-4.3.9-3.15.i386.rpm php-pgsql-4.3.9-3.15.i386.rpm

php-ldap-4.3.9-3.15.i386.rpm php-snmp-4.3.9-3.15.i386.rpm

php-mbstring-4.3.9-3.15.i386.rpm php-xmlrpc-4.3.9-3.15.i386.rpm

[[email protected] RPMS]#

[[email protected] RPMS]# rpm -ivh php-gd-4.3.9-3.15.i386.rpm

warning: php-gd-4.3.9-3.15.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e

Preparing... ########################################### [100%]

1:php-gd ########################################### [100%]

[[email protected] RPMS]#

linux4.0 apache relevant config

15. [[email protected] RPMS]# ls *mysql*

freeradius-mysql-1.0.1-3.RHEL4.3.i386.rpm

libdbi-dbd-mysql-0.6.5-10.RHEL4.1.i386.rpm

mod_auth_mysql-2.6.1-2.2.i386.rpm

mysql-4.1.20-1.RHEL4.1.i386.rpm

mysql-bench-4.1.20-1.RHEL4.1.i386.rpm

mysql-devel-4.1.20-1.RHEL4.1.i386.rpm

mysql-server-4.1.20-1.RHEL4.1.i386.rpm

mysqlclient10-3.23.58-4.RHEL4.1.i386.rpm

mysqlclient10-devel-3.23.58-4.RHEL4.1.i386.rpm

php-mysql-4.3.9-3.15.i386.rpm

[[email protected] RPMS]# rpm -ivh php-mysql-4.3.9-3.15.i386.rpm

warning: php-mysql-4.3.9-3.15.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e

Preparing... ########################################### [100%]

1:php-mysql ########################################### [100%]

[[email protected] RPMS]#

linux4.0 apache relevant config

16.linux4.0 apache relevant config linux4.0 apache relevant config

root user is mysql in the root user.

mysql&gt; create database bbs;

Query OK, 1 row affected (0.00 sec)

 

mysql&gt; show databases;

+----------+

| Database |

+----------+

| abc |

| bbs |

| mysql |

| test |

+----------+

 

 

Next

.linux4.0 apache relevant config

linux4.0 apache relevant config

linux4.0 apache relevant config

linux4.0 apache relevant config

linux4.0 apache relevant config

17. [[email protected] bbs]# rm -fr install (DEL 安装文件.一定要删除)

[[email protected] bbs]# ls

adm docs includes posting.php styles

cache download index.php report.php ucp.php

common.php faq.php language search.php viewforum.php

config.php files mcp.php store viewonline.php

cron.php p_w_picpaths memberlist.php style.php viewtopic.php

[[email protected] bbs]# rm -fr faq.php (一定要删除fag.php file 安装向导)

[[email protected] bbs]# ls

adm cron.php p_w_picpaths mcp.php search.php ucp.php

cache docs includes memberlist.php store viewforum.php

common.php download index.php posting.php style.php viewonline.php

config.php files language report.php styles viewtopic.php

[[email protected] bbs]# cd

[[email protected] ~]# service httpd restart

Stopping httpd: [ OK ]

Starting httpd: [ OK ]

[[email protected] ~]# service mysql restart

mysql: unrecognized service

[[email protected] ~]# service mysqld restart

Stopping MySQL: [ OK ]

Starting MySQL: [ OK ]

 

linux4.0 apache relevant config

 

18. [[email protected] ~]# mysql -u root -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 5 to server version: 4.1.20

 

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

 

mysql&gt; use bbs; (指定对BBS 数据库进行操件)

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

 

Database changed

mysql&gt; show tables; (显示bbs databases in the tables )

+----------------------------+

| Tables_in_bbs |

+----------------------------+

| phpbb_acl_groups |

| phpbb_acl_options |

| phpbb_acl_roles |

| phpbb_acl_roles_data |

| phpbb_acl_users |

| phpbb_p_w_uploads |

| phpbb_banlist |

| phpbb_bbcodes |

| phpbb_bookmarks |

| phpbb_bots |

| phpbb_config |

| phpbb_confirm |

| phpbb_disallow |

| phpbb_drafts |

| phpbb_extension_groups |

| phpbb_extensions |

| phpbb_forums |

| phpbb_forums_access |

| phpbb_forums_track |

| phpbb_forums_watch |

| phpbb_groups |

| phpbb_icons |

| phpbb_lang |

| phpbb_log |

| phpbb_moderator_cache |

| phpbb_modules |

| phpbb_poll_options |

| phpbb_poll_votes |

| phpbb_posts |

| phpbb_privmsgs |

| phpbb_privmsgs_folder |

| phpbb_privmsgs_rules |

| phpbb_privmsgs_to |

| phpbb_profile_fields |

| phpbb_profile_fields_data |

| phpbb_profile_fields_lang |

| phpbb_profile_lang |

| phpbb_ranks |

| phpbb_reports |

| phpbb_reports_reasons |

| phpbb_search_results |

| phpbb_search_wordlist |

| phpbb_search_wordmatch |

| phpbb_sessions |

| phpbb_sessions_keys |

| phpbb_sitelist |

| phpbb_smilies |

| phpbb_styles |

| phpbb_styles_p_w_picpathset |

| phpbb_styles_p_w_picpathset_data |

| phpbb_styles_template |

| phpbb_styles_template_data |

| phpbb_styles_theme |

| phpbb_topics |

| phpbb_topics_posted |

| phpbb_topics_track |

| phpbb_topics_watch |

| phpbb_user_group |

| phpbb_users |

| phpbb_warnings |

| phpbb_words |

| phpbb_zebra |

+----------------------------+

62 rows in set (0.00 sec)

 

mysql&gt;

19.实现了LAMP结合

L- Linux

A Apache

M Mysql

P php

20.OK !

转载于:https://blog.51cto.com/michaelfung/411171

相关文章: