注册
登录
关注:
官网首页
阿里云8折
论坛
wdCDN系统
智能DNS软件
搜索
私人消息 (0)
公共消息 (0)
论坛任务 (0)
系统消息 (0)
好友消息 (0)
帖子消息 (0)
WDlinux官方论坛
»
lamp|lnmp|lnamp|一键安装包
» 无法wget,不能用vhost.sh命令。求解!
无标题文档
wdCP系统
(
介绍
,
功能特性
,
运行环境
,
安装说明
,
演示
,
常见问题
,
使用教程
)
wdCDN系统
(
介绍
,
功能特性
,
运行环境
,
安装说明
,
演示
,
常见问题
,
使用手册
)
wdOS系统
(
介绍
,
功能特性
,
运行环境
,
安装说明
,
演示
,
常见问题
,
使用教程
)
wdDNS系统
(
介绍
,
功能特性
,
运行环境
,
安装说明
,
演示
,
常见问题
,
使用手册
)
注册 发贴 提问 回复-必看必看
wddns免费智能 DNS
开通
本地或虚拟机使 用wdcp
一键包在mysql编 译时"卡住"
AI导航网AI应用网站大全
wdcp官方技术支持/服务
阿里云8折优惠券
无敌云
腾讯云优惠中,现注册更有260代金额券赠送
返回列表
发帖
xmmaster
发短消息
加为好友
xmmaster
当前离线
UID
54
帖子
347
精华
0
积分
1700
阅读权限
0
在线时间
368 小时
注册时间
2011-11-17
最后登录
2018-5-5
禁止发言
1
#
跳转到
»
发表于 2011-11-20 22:24
|
显示全部帖子
提问三步曲:
提问先看教程/FAQ索引(
wdcp
,
wdcp_v3
,
一键包
)及搜索,会让你更快解决问题
1 提供详细,如系统版本,wdcp版本,软件版本等及错误的详细信息,贴上论坛或截图发论坛
2 做过哪些操作或改动设置等
温馨提示:信息不详,很可能会没人理你!论坛有教程说明的,也可能没人理!因为,你懂的
#!/bin/bash
#
# Web Server Install Script
# Created by wdlinux QQ:12571192
# Url:http://www.wdlinux.cn
# Last Updated 2010.11.19
#
PS_SERVER=`ps ax | grep nginx.conf | grep -v "grep"`
if [[ $PS_SERVER ]];then
SERVER="nginx"
else
SERVER="apache"
fi
conf_dir="/www/wdlinux/$SERVER/conf/vhost"
log_dir="/www/wdlinux/$SERVER/logs"
web_dir="/www/web"
function dis_info {
clear
echo
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "Add Virtual Host for wdlinux or lanmp,Written by wdlinux"
echo "---------------------------------------------------------------"
echo "Wdlinux is a customized version of CentOS based, for quick, easy to install web server system"
echo "lanmp is a tool to auto-compile & install lamp or lnmp on linux"
echo "This script is a tool add virtual host for wdlinux"
echo "For more information please visit http://www.wdlinux.cn"
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo
echo "The server is running $SERVER"
echo "----------------------------------------------------------------"
echo
}
dis_info;
echo "Pleast input domain:"
read -p "(Default or Example domain:www.wdlinux.cn):" domain
if [[ $domain == "" ]];then
domain="www.wdlinux.cn"
fi
echo
echo "domain:$domain"
echo "-----------------------------------------"
echo
sdomain=${domain#www.}
if [[ -f "$conf_dir/$domain.conf" ]];then
echo "$conf_dir/$domain.conf is exists!"
exit
fi
echo "Do you want to add more domain name? (y/n)"
read more_domain
if [[ $more_domain == "y" || $more_domain == "Y" ]];then
echo "Input domain name,example(bbs.wdlinux.cn blog.wdlinux.cn):"
read domain_a
domain_alias=${sdomain}" "${domain_a}
else
domain_alias=$sdomain;
fi
echo
echo "domain alias:$domain_alias"
echo "-----------------------------------------"
echo
echo "Allow access_log? (y/n)"
read access_log
if [[ $access_log == "y" || $access_log == "Y" ]];then
nginx_log="log_format $domain '\$remote_addr - \$remote_user [\$time_local] \"\$request\" '
'\$status \$body_bytes_sent \"\$http_referer\" '
'\"\$http_user_agent\" \$http_x_forwarded_for';
access_log logs/$domain.log $domain;"
apache_log=" ErrorLog \"logs/$domain-error_log\"
CustomLog \"logs/$domain-access_log\" common"
echo
echo "access_log dir:"$log_dir/$domain.log
echo "------------------------------------------"
echo
else
nginx_log="access_log off;"
apache_log=""
fi
echo "Do you want to add ftp Account? (y/n)"
read ftp_account
if [[ $ftp_account == "y" || $ftp_account == "Y" ]];then
read -p "ftp user name:" ftp_user
read -p "ftp user password:" ftp_pass
useradd -d $web_dir/$domain -s /sbin/nologin $ftp_user
echo "$ftp_pass" | passwd --stdin $ftp_user
chmod 755 $web_dir/$domain
echo
else
echo "Create virtual host directory."
mkdir -p $web_dir/$domain
chown -R www.www $web_dir/$domain
fi
if [[ $SERVER == "nginx" ]];then
cat > $conf_dir/$domain.conf<<eof
server {
listen 80;
server_name $domain $domain_alias;
root $web_dir/$domain;
index index.html index.php index.htm wdlinux.html;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 1d;
}
location ~ .*\.(js|css)?$ {
expires 12h;
}
$nginx_log
}
eof
else
cat > $conf_dir/$domain.conf<<eof
<VirtualHost *:80>
DocumentRoot "$web_dir/$domain"
ServerName $domain
ServerAlias $domain_alias
$apache_log
</VirtualHost>
eof
fi
cat > $web_dir/$domain/index.html<<eof
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>test page</title>
</head>
<body>
<div align="center">
<h1>test page of $domain </h1>
<p>Create by vhost.sh of <a href="http://www.wdlinux.cn" target="_blank">www.wdlinux.cn</a> </p>
</div>
</body>
</html>
eof
if [[ $ftp_account == "y" || $ftp_account == "Y" ]];then
chown $ftp_user $web_dir/$domain/index.html
fi
if [[ $SERVER == "nginx" ]];then
service nginxd restart
else
service httpd restart
fi
echo
echo
echo
echo "web site infomations:"
echo "========================================"
echo "domain list:$domain $domain_alias"
echo "----------------------------------------"
echo "website dir:$web_dir/$domain"
echo "----------------------------------------"
echo "conf file:$conf_dir/$domain.conf"
echo "----------------------------------------"
if [[ $access_log == "y" || $access_log == "Y" ]];then
echo "access_log:$log_dir/$domain.log"
echo "----------------------------------------"
fi
if [[ $ftp_account == "y" || $access_log == "Y" ]];then
echo "ftp user:$ftp_user password:$ftp_pass";
echo "----------------------------------------"
fi
echo "web site is OK"
echo "For more information please visit http://www.wdlinux.cn"
echo "========================================"
复制代码
AI导航网,AI网站大全,AI工具大全,AI软件大全,AI工具集合,AI编程,AI绘画,AI写作,AI视频生成,AI对话聊天等,尽在aiaiV.cn
TOP
xmmaster
发短消息
加为好友
xmmaster
当前离线
UID
54
帖子
347
精华
0
积分
1700
阅读权限
0
在线时间
368 小时
注册时间
2011-11-17
最后登录
2018-5-5
禁止发言
2
#
发表于 2011-11-20 22:27
|
显示全部帖子
楼主 我帮你下了
http://www.wdlinux.cn/in_scripts/vhost.sh.txt
上面是这个文件的内容
TOP
返回列表
我的Linux|wdlinux
ai|大模型|大数据
开源精选
wdCP V3|Linux服务器/云主机/虚拟主机管理系统
wddns|智能DNS系统|免费智能DNS解析
lamp|lnmp|lnamp|一键安装包
wdCP V2|linux下免费的服务器/虚拟主机管理系统
wdcdn系统|CDN缓存加速管理系统
wdOS|CentOS精简版|CentOS定制版
区块链技术|智能合约|区块链开发
wdlinux学堂|wdOS知识库|linux知识库|教程|文档
站务管理
站务管理
[收藏此主题]
[关注此主题的新回复]
[通过 QQ、MSN 分享给朋友]