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.
|