HOW TO CONFIGURE VIRTUAL WEB HOSTING
[root@dev ~]# vi /etc/httpd/conf.d/ip.conf
<VirtualHost 192.168.0.10:80>
ServerAdmin root@dev.example.com
ServerName www1.example.com
DocumentRoot /var/www/
</virtualhost>
<Directory "/var/www/">
AllowOverride none
Require all Granted
</Directory>
[root@dev ~]# vi /var/www/index.html
[root@dev ~]# vi /etc/hosts
192.168.105.62 www1.example.com
192.168.105.62 www2.example.com
[root@dev ~]# firewall-cmd --permanent --add-service=http
success
[root@dev ~]# firewall-cmd --complete-reload
success
[root@dev ~]# elinks www1.example.com
HOW TO REDIRECT WEBSITE
[root@dev ~]# vi /etc/httpd/conf.d/virtual.conf
<VirtualHost *:80>
ServerAdmin root@dev.example.com
ServerName www1.example.com
DocumentRoot /var/www/
Redirect / "https://www.ecollege.life"
</virtualhost>
<Directory "/var/www/">
AllowOverride none
Require all Granted
</Directory>
[root@dev ~]# vi /var/www/index.html
PORT BASED WEB HOSTING
[root@dev ~]# vi /etc/httpd/conf.d/port.conf
<VirtualHost *:8999>
ServerAdmin root@dev.example.com
ServerName www1.example.com
DocumentRoot /var/www/
</virtualhost>
<Directory "/var/www/">
AllowOverride none
Require all Granted
</Directory>
[root@dev ~]# firewall-cmd --permanent --add-port=8999/tcp
success
[root@dev ~]# systemctl restart httpd
[root@dev ~]# firewall-cmd --complete-reload
[root@dev ~]#firewall-cmd --permanent --add-port=21/tcp
No comments:
Post a Comment