一. 基本配置。
1.[root@michael ~]# 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.[root@michael ~]# service httpd restart
Stopping httpd: [FAILED]
Starting httpd: [ OK ]
[root@michael ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
3. [root@michael ~]# chkconfig --list httpd
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@michael ~]# chkconfig --level 35 httpd on
[root@michael ~]# chkconfig --list httpd
httpd 0:off 1:off 2:off 3:on 4:off 5:on 6:off
[root@michael ~]#
4 .client test
5. [root@michael ~]# 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 root@localhost
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\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %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/image2.gif) image/*
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.[root@michael ~]# 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>
[root@michael ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
方法1:
[root@michael home]# ls
abc1 abc2 ftpsite fung
[root@michael home]# cd
[root@michael ~]# su - abc1
[abc1@michael ~]$ pwd
/home/abc1
[abc1@michael ~]$ ls
[abc1@michael ~]$ ls -ld .
drwx------ 3 abc1 abc1 4096 Jul 30 18:15 .
[abc1@michael ~]$ chmod o+x .
[abc1@michael ~]$ ls -ld .
drwx-----x 3 abc1 abc1 4096 Jul 30 18:15 .
[abc1@michael ~]$ mkdir public_html
[abc1@michael ~]$ vi public_html/index.html
Who shi httpd server
Hello
My name is michael fung.
方法2:
[root@michael ~]# cd /home
[root@michael home]# ls
abc1 abc2 ftpsite fung
[root@michael home]# cd abc2
[root@michael abc2]# ls
aaa
[root@michael abc2]# mkdir public_html
[root@michael abc2]# ls
aaa public_html
[root@michael abc2]# cd public_html/
[root@michael public_html]# vi index.html
who sho abc2 user httpd server
~
~"index.html" [New] 1L, 31C written
[root@michael 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
[root@michael home]# chmod -R 755 abc2
[root@michael 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
[root@michael 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
[root@michael abc2]# chown -R abc2:abc2 public_html/
[root@michael 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
[root@michael abc2]# cd public_html/
[root@michael public_html]# ll
total 4
-rwxr-xr-x 1 abc2 abc2 31 Aug 4 14:52 index.html
三. 虚拟目录
1.[root@michael ~]# 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.[root@michael ~]# cd /var/www
[root@michael www]# ls
cgi-bin error html icons manual usage
[root@michael www]# mkdir abc.com abcd.com
[root@michael www]# ls
abc.com abcd.com cgi-bin error html icons manual usage
[root@michael www]#
[root@michael www]# cd abc.com
[root@michael abc.com]# ls
[root@michael abc.com]# vi index.html
wo shi abc.com
~
[root@michael www]# cd abcd.com
[root@michael abcd.com]# ls
[root@michael abcd.com]# vi index.html
wo shi abcd.com
[root@michael ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
3. Client test .
4. ok!
四. LAMP环境搭建。
1.[root@michael ~]# 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.[root@michael 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
[root@michael 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%]
[root@michael RPMS]# cd
[root@michael ~]# 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.[root@michael ~]# chkconfig --list | grep mysqld
mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@michael ~]# chkconfig --level 35 mysqld on
[root@michael ~]# chkconfig --list | grep mysqld
mysqld 0:off 1:off 2:off 3:on 4:off 5:on 6:off
[root@michael ~]#
[root@michael ~]# service mysqld restart
Stopping MySQL: [FAILED]
Initializing MySQL database: [ OK ]
Starting MySQL: [ OK ]
[root@michael ~]# service mysqld restart
Stopping MySQL: [ OK ]
Starting MySQL: [ OK ]
[root@michael ~]# service mysqld status
mysqld (pid 4576) is running...
4.[root@michael ~]# mysqladmin -u root password '123456'
[root@michael ~]# 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>
[root@michael ~]# 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> 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。[root@michael ~]# 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> show databases; (查看MYSQL中有那些数据库)
+----------+
| Database |
+----------+
| mysql |
| test |
+----------+
2 rows in set (0.00 sec)
mysql> create database abc;
Query OK, 1 row affected (0.01 sec)
mysql> show databases;
+----------+
| Database |
+----------+
| abc |
| mysql |
| test |
+----------+
3 rows in set (0.00 sec)
mysql>
6.[root@michael ~]# rpm -qa | grep php
php-4.3.9-3.1
php-ldap-4.3.9-3.15
php-pear-4.3.9-3.15
[root@michael ~]# cd /var/www/html
[root@michael html]# ls
[root@michael html]# ll
total 0
[root@michael html]# vi index.php (create php test 网页)
<?php
phpinfo();
?>
~
~
"index.php" [New] 3L, 20C written
[root@michael html]# cd
[root@michael ~]# 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>
# 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>
#<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 无法正常显示。
[root@michael ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
7.PHP TEST
8.[root@michael ~]# mount /dev/cdrom /mnt
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@michael ~]# cd /mnt
[root@michael mnt]# ls
bbs (bbs就是phpBB论坛解压缩后的文件)
~
~
9.[root@michael mnt]# cp -R bbs/ /var/www/html (copy bbs to /var/www/html)
[root@michael mnt]# cd
[root@michael ~]# cd /var/www/htm
[root@michael html]# ls
bbs index.php
10.TEST
Next:
11. [root@michael bbs]# cd images/
[root@michael images]# ls
avatars icons index.htm ranks smilies spacer.gif upload_icons
[root@michael images]# cd avatars/
[root@michael avatars]# ls
gallery index.htm upload
[root@michael 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
[root@michael avatars]# chmod -R 766 upload
[root@michael 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
12. [root@michael 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 images
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
[root@michael bbs]# chmod 766 config.php
[root@michael 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 images
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
13. [root@michael 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 images
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
[root@michael bbs]# chmod -R 766 cache
[root@michael bbs]# chmod -R 766 files
[root@michael bbs]# chmod -R 766 store
[root@michael 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 images
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
14. [root@michael 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
[root@michael RPMS]#
[root@michael 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%]
[root@michael RPMS]#
15. [root@michael 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
[root@michael 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%]
[root@michael RPMS]#
16.
root user is mysql in the root user.
mysql> create database bbs;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+----------+
| Database |
+----------+
| abc |
| bbs |
| mysql |
| test |
+----------+
Next
.
17. [root@michael bbs]# rm -fr install (DEL 安装文件.一定要删除)
[root@michael 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 images memberlist.php style.php viewtopic.php
[root@michael bbs]# rm -fr faq.php (一定要删除fag.php file 安装向导)
[root@michael bbs]# ls
adm cron.php images 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
[root@michael bbs]# cd
[root@michael ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@michael ~]# service mysql restart
mysql: unrecognized service
[root@michael ~]# service mysqld restart
Stopping MySQL: [ OK ]
Starting MySQL: [ OK ]
18. [root@michael ~]# 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> 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> 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_attachments |
| 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_imageset |
| phpbb_styles_imageset_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>
19.实现了LAMP结合
L- Linux
A Apache
M Mysql
P php
20.OK !
本文出自 “michaelfung_专栏” 博客,转载请与作者联系!