software httpd-2.2.6.tar.gz
Firstly、 install the software
1、prepare before install
must be install gcc
[root@localhost ~]# /etc/init.d/httpd stop(shut default software httpd)
[root@localhost ~]# chkconfig httpd off(set not work when starting up)
mv the httpd software into linux
2、the process of install
[root@localhost ~]# ll httpd-2.2.6.tar.gz
-rw-r--r-- 1 root root 6028951 Sep 6 2007 httpd-2.2.6.tar.gz
[root@localhost ~]# tar zxvf httpd-2.2.6.tar.gz
[root@localhost ~]# cd httpd-2.2.6
[root@localhost httpd-2.2.6]# ./configure
[root@localhost httpd-2.2.6]# make
[root@localhost httpd-2.2.6]# make install
[root@localhost httpd-2.2.6]# cd /usr/local/apache2/bin
[root@localhost bin]# ./apachectl start
[root@localhost bin]# ps aux|grep apache
[root@localhost bin]# netstat -tulnp|grep httpd
3、the process of test
enter into IE by when you have looked up :It Works!! good job !
Secondly 、 set the authentication of Basic
[root@localhost ~]# cd /usr/local/apache2/bin/
[root@localhost bin]# ./htpasswd -c /usr/local/apache2/conf/users sam(create a user with name is sam,below enter the password)
[root@localhost bin]# cd ..
[root@localhost apache2]# cd htdocs/
[root@localhost htdocs]# mdkir secure_info/(create a test document)
[root@localhost secure_info]# vi index.html
Hello ethnicitybeta!!
[root@localhost secure_info]# cd ..
[root@localhost htdocs]# cd ..
[root@localhost apache2]# cd conf/
[root@localhost conf]# vi httpd.conf (chege the primary documnet add the paragraph below)
<Directory "/usr/local/apache2/htdocs/secure_info">
Options Indexes FollowSymLinks
AllowOverride None
AuthType Basic
AuthName "secure_info_auth"
AuthuserFile /usr/local/apache2/conf/users
require user sam
Order deny,allow
Allow from all
</Directory>
[root@localhost conf]# cd ../bin
[root@localhost bin]# ./apachectl restart(restare the service)
enter IE with After you have enter the username and password !And you will look up the sentence Hello ethnicitybeta! good job!!