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

深碍√TFBOYSˉ_ 2022-08-11 14:59 254阅读 0赞

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

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

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

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

  1. DocumentRoot /alidata/www/phpwind
  2. ServerName localhost
  3. ServerAlias localhost
  4. Options -Indexes FollowSymLinks
  5. AllowOverride all
  6. Order allow,deny
  7. Allow from all
  8. RewriteEngine On
  9. RewriteRule ^(.\*)-htm-(.\*)$ $1.php?$2
  10. RewriteRule ^(.\*)/simple/(\[a-z0-9\\\_\]+\\.html)$ $1/simple/index.php?$2
  11. ErrorLog “/alidata/log/httpd/phpwind-error.log
  12. 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.测试网站。请在浏览器中输入域名,测试设置。

视频资料

发表评论

表情:
评论列表 (有 0 条评论,254人围观)

还没有评论,来说两句吧...

相关阅读

    相关 Tomcat域名

     |字号 订阅     现在很多的公司的网站都是用tomcat作为应用服务区的,可是对于初学者,8080端口号是如何去掉的,这些网站是如何和域名绑定到一起的呢

    相关 博客域名

    ![blog][] 前言 之前利用 hexo 在 Github 上搭建了个人博客后,感觉还是不错的。但博客的域名是二级域名,每次访问都是 `用户名.github.io`