Linux Server Deployment(III)Apache and Perl
It is easy to install apache perl mod on ubuntu with apt-get install. I will try on linux.
It is almost the same configuration on Ubuntu.
1. configure the date
And I realized that the date is wrong on the server. So I try this to change it.
syntax:
# date {mmddhhmiyyyy.ss}
mm-- month
dd----- day
hh----- hour
mi----- minites
yyyy-- year
ss------ seconds
>date 062114342011.10
2. configure apache to auth the username/password
require this module mod_auth
find the configuration file, on my system is default.
>vi /etc/apache2/sites-available/default
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews +Includes
#AllowOverride None
AllowOverride authconfig
Order allow,deny
allow from all
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
</Directory>
create a configuration file under the directory you want to put auth in.
>vi /var/www/.htaccess
AuthName "sillycat"
AuthType basic
AuthUserFile /etc/apache2/valid.txt
require valid-user
generate the password files
>htpasswd -bc /etc/apache2/valid.txt username1 password1
>htpasswd -b /etc/apache2/valid.txt username2 password2
3. Restart the apache server
>/etc/init.d/apache2 restart
4. Others
We need to put all the .htaccess files to all the soft link directories. We can also benefit from the auth.
references:
http://blog.opendigest.org/show-428-1.html
http://blog.youkuaiyun.com/tenfyguo/archive/2011/01/27/6167190.aspx
It is easy to install apache perl mod on ubuntu with apt-get install. I will try on linux.
It is almost the same configuration on Ubuntu.
1. configure the date
And I realized that the date is wrong on the server. So I try this to change it.
syntax:
# date {mmddhhmiyyyy.ss}
mm-- month
dd----- day
hh----- hour
mi----- minites
yyyy-- year
ss------ seconds
>date 062114342011.10
2. configure apache to auth the username/password
require this module mod_auth
find the configuration file, on my system is default.
>vi /etc/apache2/sites-available/default
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews +Includes
#AllowOverride None
AllowOverride authconfig
Order allow,deny
allow from all
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
</Directory>
create a configuration file under the directory you want to put auth in.
>vi /var/www/.htaccess
AuthName "sillycat"
AuthType basic
AuthUserFile /etc/apache2/valid.txt
require valid-user
generate the password files
>htpasswd -bc /etc/apache2/valid.txt username1 password1
>htpasswd -b /etc/apache2/valid.txt username2 password2
3. Restart the apache server
>/etc/init.d/apache2 restart
4. Others
We need to put all the .htaccess files to all the soft link directories. We can also benefit from the auth.
references:
http://blog.opendigest.org/show-428-1.html
http://blog.youkuaiyun.com/tenfyguo/archive/2011/01/27/6167190.aspx
本文详细介绍了如何在Linux环境下使用apt-get安装Apache和Perl模块,并通过htpasswd生成密码文件,实现用户认证。
1246

被折叠的 条评论
为什么被折叠?



