使用方法: 建议各位先update和upgrade: apt-get -y updateapt-get -y upgrade OK后执行: sudo suwget http://lvamp.yzs.me/lvamp0.3.tar.gztar zxvf lvamp.tar.gzcd lvamp0.3 如果是Debian的,请执行: ./db-lvamp.sh Ubuntu的,请执行: ./ub-lvamp.sh
使用方法:
建议各位先update和upgrade:
apt-get -y updateapt-get -y upgrade
OK后执行:
sudo suwget http://lvamp.yzs.me/lvamp0.3.tar.gztar zxvf lvamp.tar.gzcd lvamp0.3
如果是Debian的,请执行:
./db-lvamp.sh
Ubuntu的,请执行:
./ub-lvamp.sh
安装MySQL时会提示输入MySQL的root密码,putty可能会乱码,不过直接输入密码然后按Enter就OK了:
添加虚拟主机:
/root/addhost
添加虚拟主机详细教程:
=========================================================================Add Virtual Host for LVAMP=========================================================================Made by ExtremeMy Blog:http://yzs.me/For more information please visit http://yzs.me/1517.html=========================================================================Please input domain:example.com #此处输入你要绑定的域名===========================domain=example.com===========================Do you want to add more domain name? (y/n) #如果改网站还有其他域名(例如www,bbs),则输入y,否则输入n,按回车y Type domainname,example(www.yzs.me bbs.yzs.me blog.yzs.me):www.example.com #此处输入你要添加的域名===========================domain list=www.example.com===========================Do you want to use a different user for this website? (y/n) #让你的站点以不同的用户身份运行(默认用户为www-data),能有效防跨站yType username,example:mywebsiteexample #这里输入该网站要使用的用户的用户名(用户不存在时会自动创建,千万别输入root)===========================your website user is example===========================Please input the directory for the domain:test.com : #这里输入你的网站的根目录,默认为/var/www/你的域名,可直接按回车使用默认设置(Default directory: /var/www/<a style="color:transparent">来@源gao*daima.com搞@代#码网</a>test.com):===========================Virtual Host Directory=/var/www/test.com===========================Please input Administrator Email Address:[email protected] #此处输入你的网站的管理员邮箱,可直接按回车跳过使用配置设置。===========================Server Administrator [email protected]===========================Press any key to create your virtul host...Create Virtul Host directory......set permissions of Virtual Host directory......Enabling site test.com.Run '/etc/init.d/apache2 reload' to activate new configuration!Restart Apache2......Restarting web server: apache2 ... waiting .=========================================================================Add Virtual Host for LVAMP=========================================================================Made by ExtremeMy Blog:http://yzs.me/For more information please visit http://yzs.me/1517.html=========================================================================到此,虚拟主机创建完毕
状态管理工具:
/root/lvamp {start|stop|reload|restart|kill
如果要删除网站:
a2dissite 域名service apache2 restart
如果要卸载LVAMP(先进入LVAMP一键包的目录):
./remove.sh
FAQ:
使用某些程序时,例如WordPress,可能会提示输入FTP信息,如果你没有设置站点以其他用户身份运行,则执行:
chown -R www-data:www-data +你的网站目录
如果站点以其他用户身份运行,则把www-data改成添加虚拟主机时填写的用户名,例如我填的是example,则执行:
chown -R example:example +你的网站目录
======================我是邪恶的分割线======================
2013年4月5日更新日志:
1 ) Debian不再需要自行添加Dotdeb源
2 ) 优化安装过程,提前MySQL安装,更早提示用户们输入密码
3 ) 添加PHP-GD库
4 ) 关闭文件列表功能
5 ) 添加服务管理工具(/root/lvamp)使用方法:
/root/lvamp {start|stop|reload|restart|killstar:启动LVAMP服务stop:停止LVAMP服务reload:重新LVAMP配置文件restart:重新启动LVAMP服务kill:强制中止LVAMP服务
5 ) 更改创建网站文件夹默认权限755(rwxr_xr_x)为711(rwx__x__x),更有效对付跨站获取数据。
6 ) 添加mpm-itk模块,支持每个站点一个用户,使用方法:
在执行/root/addhost时,会提示您输入网站用户名:
Do you want to use a different user for this website? (y/n) y #输入y则使用该功能,n则不使用输入y后:Type username,example:mywebsitetest===========================your website user is test
如图:
2013年2月6日更新日志:
1 ) 添加mod_headers模块。可以在.htaccess添加如下代码定义缓存时间:
#max-age以秒做单位#定义图片、CSS、JS的缓存时间为七天Header set Cache-Control "max-age=604800"#定义HTML、TXT的缓存时间为两个小时Header set Cache-Control "max-age=7200"
2013年2月5日更新日志:
1 ) 修复后端无法获取真实IP地址的BUG
2 ) 增加varnish等待连接后端(backend)的時間、等待从backend传输的第一個字符的时间、两个字元的间隔时间。防止503错误。