企业宽带 3G上网 400电话 虚拟总机 上海VPS 双线云VPS 高速云VPS 美国VPS 网络加速器 服务器托管 服务器租用 廉价域名 企业邮箱 技术服务 网站建设 业务一览
您在这: 客户中心 > 帮助中心 > English Help > How to setup vitual hosting in Linux cloudVPS
3G无线上网注册找回密码 支付帮助 在线服务

How to setup vitual hosting in Linux cloudVPS

1) change the httpd.conf of apache

Add  multiple Listen port like this

[root@x conf.d]# cat /etc/httpd/conf/httpd.conf |grep Listen
# Listen: Allows you to bind Apache to specific IP addresses and/or
# Change this to Listen on specific IP addresses as shown below to
#Listen 12.34.56.78:80
Listen 81
Listen 82
Listen 83
Listen 84
Listen 85
Listen 86
Listen 87
Listen 18088
[root@x conf.d]#

 

2) setup VirtualHost base on port

change /etc/httpd/conf.d/vhost.conf  (default yum install)

<VirtualHost 127.0.0.1:83 *>
ServerName web1.cn
ServerAlias www.web1.cn
DocumentRoot /opt/www/web1.cn/www
<FilesMatch "\.(tpl|rar|gz|bar|bz2)">
Order Deny,Allow
Deny from all
</FilesMatch>
php_admin_value open_basedir "/opt/www/web1.cn/www:/tmp"
UseCanonicalName Off
</VirtualHost>

<VirtualHost 127.0.0.1:84 *>
ServerName web1.cn
ServerAlias www.web1.cn
DocumentRoot /opt/www/web1.cn/www
<FilesMatch "\.(tpl|rar|gz|bar|bz2)">
Order Deny,Allow
Deny from all
</FilesMatch>
php_admin_value open_basedir "/opt/www/web1.cn/www:/tmp"
UseCanonicalName Off
</VirtualHost>

<VirtualHost 127.0.0.1:85 *>
ServerName web1.cn
ServerAlias www.web1.cn
DocumentRoot /opt/www/web1.cn/www
<FilesMatch "\.(tpl|rar|gz|bar|bz2)">
Order Deny,Allow
Deny from all
</FilesMatch>
php_admin_value open_basedir "/opt/www/web1.cn/www:/tmp"
UseCanonicalName Off
</VirtualHost>

3) turn off selinux

Our cloud server is very safe for outside world. they are behide our firewall.

And selinux often give the troubles for linux beginner. So just turn off it.

Change /etc/selinux/config ,set SELINUX=disabled , and reboot

 

If you tun on selinux ,you must set rules for these ports and website directory to use.

 

4)how to visit the website?

a) visit your web through "Public IP:PORT"

b) visit your web through domain name

If this case ,your domain must have ICP Beian No. and we need add your domain to our white list system.

If your domain have no ICP Beian No. We can't cancel whilte list limit by the law.

 



此答案有用么?

添加到收藏
打印

选择语言: