This is how to implement virtual host using port in centos7.

vi /etc/httpd/conf/httpd.conf

Open the httpd.conf file. InclutdeOption option path move.

vi vhost.conf

A Create vhost.conf file.

Listen Port number

<VirtualHost *:80>

     DocumentRoot 기본경로



<VirtualHost *: Port number>

     DocumentRoot Path



Modify it as shown. Press esc.  Press the :wq key to save.

systemctl restart httpd

Restart httpd.

vi /etc/firewalld/zones/public.xml

Please correct the public.xml file.

<port protocol="tcp" port="Port number"/>

Add line.

firewall-cmd --reload

Restart Firewall.

Url Test.

+ Recent posts