上云,就上阿里云!
购买咨询:400-605-6095(全国)
首页 > 使用教程 > 如何添加网站for Linux(绑定域名)

如何添加网站for Linux(绑定域名)

更新时间:2015-7-31 22:24:09
【以下配置的路径以阿里云提供的标准环境路径为准,如果您另行安装,请根据实际安装路径配置】。
 
1.cd /alidata/server/httpd/conf/vhosts/ 进入绑定域名所在目录,
 
2.vim test.conf  建立一个配置文件,test可以自己命名;
 
3.点击字母“i”开始编辑文件,输入内容:
        DocumentRoot /alidata/www/phpwind
        ServerName localhost
        ServerAlias localhost
       
            Options -Indexes FollowSymLinks
            AllowOverride all
            Order allow,deny
            Allow from all
       
       
                RewriteEngine On
                RewriteRule ^(.*)-htm-(.*)$ $1.php?$2
                RewriteRule ^(.*)/simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2
       
        ErrorLog "/alidata/log/httpd/phpwind-error.log"
        CustomLog "/alidata/log/httpd/access/phpwind.log" common
 
 
其中:
ServerName www.test.com 绑定的网站域名
ServerAlias test.com 绑定的网站别名(您如果有多个域名添加在这里)
DirectoryIndex index.html index.php index.htm 设置默认首页
DocumentRoot /alidata/www/test 和 Directory "/alidata/www/test" 都是指定网站的目录,需要一致。
 
按“esc”退出编辑模式,输入“:wq”保存退出。
 
4.输入命令:/alidata/server/httpd/bin/apachectl restart 重启apache测试。
 
5.测试网站。请在浏览器中输入域名,测试设置。
Tags: 阿里云 阿里云代理 阿里云代理商

购买咨询:400-605-6095(全国)

站内导航: 阿里云服务器价格| 阿里云数据库| 香港云服务器| 阿里云企业网盘| 阿里企业邮箱| SSL证书| 阿里云短信| 阿里云虚拟主机| 阿里云电脑| 轻量应用服务器| 阿里云建站

阿里云代理商| 阿里云新用户注册| 购买流程| 免费试用| 常见问题| 虚机帮助| 短信帮助| 使用教程| 最新动态| 关于我们| 合作联系| 付款方式

CopyRight © 2023 www.aliyunecs.cn. All Rights Reserved  粤ICP备14093887号-5 百事腾| 阿里云精英合作伙伴

微信扫码咨询

电话咨询
400-605-6095

关闭