Create Apache Virtual Hosts on Ubuntu

27 ก.พ. 2019 , 1,971 Views   , หมวดหมู่ Linux โค๊ดดิ้ง   , ป้ายกำกับ:, ,


โดยที่ไฟล์เว็บไซต์จะอยู่ที่

/home/user1/public_html
/home/user2/public_html

ให้เข้าไปแก้ไขไฟล์ /etc/apache2/sites-available/000-default.conf

โดยแก้ไขไฟล์ประมาณด้านล่าง

จากนั้นเข้าไปแก้ไขไฟล์ /etc/apache2/apache2.conf โดยเพิ่มโค๊ดด้านล่างเข้าไป

จากนั้นเข้าไปเพิ่มในไฟล์ /etc/hosts

*ตัวอย่างที่ใช้บน ec2

*xxx.xx.xx.xxx คือ Private IPs

จากนั้นให้ไป Edit DNS Zone file

 

ดูเพิ่มเติม

https://stackoverflow.com/questions/13837978/apache-multiple-sub-domains-with-one-ip-address

https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts

https://stackoverflow.com/questions/45656861/apache2-creating-virtual-hosts-on-one-ip-address


ป้ายกำกับ:, ,