阿里云如何添加多个网站 for Linux(绑定域名)
2015-08-02 09:17
831 查看
阿里云一台云主机不能绑定多个ip
【以下配置的路径以阿里云提供的标准环境路径为准,如果您另行安装,请根据实际安装路径配置】。
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.测试网站。请在浏览器中输入域名,测试设置。
【以下配置的路径以阿里云提供的标准环境路径为准,如果您另行安装,请根据实际安装路径配置】。
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.测试网站。请在浏览器中输入域名,测试设置。
相关文章推荐
- 移植好uboot和基于initramfs根文件系统Linux内核的开发板的启动过程
- linux下gtk+一个将字符串大写化的小示例
- linux下gtk+一个将字符串大写化的小示例
- linux下gtk+一个将字符串大写化的小示例
- Linux 初体验之基础篇
- Linux命令小技巧
- Linux下编译安装Mysql 5.5的简单步骤
- Linux syslog日志系统详解
- CentOS下将MySQL 5.1升级到MySQL 5.5的步骤
- linux初学(二十一)之linux软件管理基础之YUM软件管理
- Linux学习笔记
- Linux的SOCKET编程详解
- CentOS下将MySQL 5.1升级到MySQL 5.5的步骤
- Linux下编译安装Mysql 5.5的简单步骤
- Linux
- Linux下查看内存使用情况方法总结
- centos6的yum配置脚本-163的源+epel+rpmforge源
- VMware虚拟机Linux忘记root密码
- RHEL6: how to use Centos6 yum
- Linux调用backtrack函数打印程序崩溃时的调用堆栈