그냥 개발자 블로그

[Linux] Virtual host using the port for centos7 본문

프로그래밍팁/linux

[Linux] Virtual host using the port for centos7

마음이파파 2017. 6. 27. 01:25

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 기본경로

     ServerName play-ground.kr

</VirtualHost>

<VirtualHost *: Port number>

     DocumentRoot Path

     ServerName play-ground.kr

</VirtualHost>


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.