技术员联盟提供win764位系统下载,win10,win7,xp,装机纯净版,64位旗舰版,绿色软件,免费软件下载基地!

当前位置:主页 > 教程 > 服务器类 >

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

来源:技术员联盟┆发布时间:2019-03-09 00:41┆点击:

以下配置的路径以阿里云提供的标准环境路径为准,如果您另行安装,请根据实际安装路径配置。

 

1.cd /alidata/server/httpd/conf/vhosts/ 进入绑定域名所在目录,

 

2.vim test.conf  建立一个配置文件,test可以自己命名;

 

3.点击字母“i”开始编辑文件,输入内容:

<VirtualHost *:80>

        DocumentRoot /alidata/www/phpwind

        ServerName localhost

        ServerAlias localhost

        <Directory "/alidata/www/phpwind">

            Options -Indexes FollowSymLinks

            AllowOverride all

            Order allow,deny

            Allow from all

        </Directory>

        <IfModule mod_rewrite.c>

                RewriteEngine On

                RewriteRule ^(.*)-htm-(.*)$ $1.php?$2

                RewriteRule ^(.*)/simple/([a-z0-9_]+.html)$ $1/simple/index.php?$2

        </IfModule>

        ErrorLog "/alidata/log/httpd/phpwind-error.log"

        CustomLog "/alidata/log/httpd/access/phpwind.log" common

</VirtualHost>

 

其中:

ServerName 绑定的网站域名

ServerAlias test.com 绑定的网站别名(您如果有多个域名添加在这里)

DirectoryIndex index.html index.php index.htm 设置默认首页

DocumentRoot /alidata/www/test 和 Directory "/alidata/www/test" 都是指定网站的目录,需要一致。