一、主配置文件目录
apache : /etc/httpd/conf/httpd.conf
mysql : /var/lib/mysql
二、启动服务
service mysqld start
service httpd start
三、mysql基础配置
mysql :进入数据库
create database jljc; :创建数据库
show databases; :查看数据库
四、启动个人主页
vi /etc/selinux/config
selinux = disabled
在用户的家目录下创建网页存放的目录
mkdir /home/test/public_html
chmod -R 755 /home
vi /etc/httpd/conf/httpd.conf
allowoverride authconfig
order allow,deny
allow from all
cd /home/test/public_html/renzheng
vi .htaccess
authname "this is a authentication web"
authtype basic
authuserfile /home/a/apach.passwd
require valid-user
五、AUTHENTICATION WEB
步骤:创建目录,创建ID与密码文件,修改主配置,重启服务
mkdir /var/www/html/dirname
cd /var/www/html/dirname
echo "this is a test authentication web">test.html
cd /var/www
htpasswd -c apache.passwd admin
authname "this is authentication web"
authtype basic :默认类型
authuserfile /var/www/apache.passwd :文件详细目录
require valid-user :允许所有在密码中的用户访问
#require user test admin :表示只有文件中的这些用户可以访问
六、虚拟主机
不同域名,不同网页,在同一个服务器上,在应用层实现
namevirtualhost *:80 :启动虚拟机
serveradmin web@sina.com :邮箱地址
documentroot /var/www/html :若其它的失败就显示第一个
servername www.cnc.com :网页域名