WWW


root> yum install httpd mysql mysql-server php php-mysql

root>vim /etc/hosts

127.0.0.1 localhost.localdomain localhost

root> vim /etc/httpd/conf/httpd..conf


PHP


root> cd /etc/httpd/conf.d

root> ll *.conf

root> vim /etc/httpd/conf.d/php.conf

root>vim /etc/php.ini

Test PHP

root> vim /var/www/html/phpinfo.php

<?php phpinfo(); ?>

 


WWW

root>/etc/init.d/httpd start

root>/etc/init.d/httpd configtest

root> chkconfig httpd on

root>/etc/init.d/apachectl start

root>/etc/init.d/apchectl stop

root>netstat -tulnp | grep 'httpd'

root> tail /var/log/httpd/error_log (察看錯誤)

http://192.168.100.254



MySQL

root> /etc/init.d/mysqld start

root> chkconfig mysqld on

root> netstat -tulnp | grep 'mysqld'

root>mysql -u root

root>mysqladmin -u root password "YourWonPasswd"

root>mysql -u root -p

create database vbirddb;

grant all priviledges no vbirddb.* to vbirduser@localhost

show databases;

use mysqls;

select * from user where user= 'vbirduser';


firewall

root>iptables -I INPUT -p TP -i eth? --dport 80 --sport 1024:65534 -j ACCEPT

root>iptables-save | grep 80

root>getsebool -a | grep httpd

root>setsebool -p httpd_can_network_connect=1

root> echo "This is a jdwang test" > index.html

root> mv index.html /var/www/html

root>ll /var/www/html/index.html

===============================

網站 用戶個人 

==============================

root> vim /etc/httpd/conf/httpd.conf

<IfModule mod_userdir.c>

#UserDir disable

UserDir www

<IfModule>

root>/etc/init.d/httpd restart

jdwang>mkdir www

jdwang>chmod 755 www

jdwang>ls -al www

jdwang>chmod 711 ~

jdwang> cd ~/jdwang

jdwang/www>echo "jdwang 2013.6. " >> index.html

=> Browser (http://192.168.100.254/~jdwang)

root>setsebool -P httpd_enable_homedirs=1

root>restorecon -Rv / home/

=> Browser (http://192.168.100.254/~jdwang)

============================================

認證網頁設定

===========================================

root> mkdir /var/www/html/protect

root> echo "jdwang test .htaccess" >> index.html

root> vim /etc/httpd/conf/httpd.conf

<Directory "/var/www/html/protect">

AllowOverride AuthConfig

Order allow, deny

Allow from all

</Directory>

root> /etc/init.d/httpd restart

===========Set Dir Proect==============

root> cd /var/www/html/protect

root> vim .htaccess

AuthName "Protect test by jdwang 2013.6.3"

Authtype Basic

AuthUserFile /var/www/apache.passwd

require user jdwang

============Add User============

root> htpasswd -c /var/www/apache.passwd jdwang

New password:

Re-type...

root> cat /var/www/apache.passwd

root> htpasswd /var/www/apache.passwd test

===========登錄檔分析軟體:webalizer================

root> yum install webalizer

root> vim /etc/webalizer.conf

http://linux.vbird.org/linux_server/0360apache.php#other_pkg_php