Multi-site on Windows- Apache, WAMP

  1. Click vào WAMPServer trên thanh công cụ (taskbar), chọn Apache – httpd.conf
  2. Tìm dòng
  3. # Virtual hosts
    #Include conf/extra/httpd-vhosts.conf

  4. Bỏ kí tự # (comment indicator)

    # Virtual hosts
    Include conf/extra/httpd-vhosts.conf

  5. Lưu lại tập tin
  6. Kế tiếp là chỉnh sửa lại tập tin httpd-vhosts.conf được lưu tại đường dẫn C:\wamp\bin\apache\Apache2.2.17\conf\extra, chỉnh sữa hoặc thêm các <VirtualHost> Như ví dụ bên dưới ta sẽ có 2 website khác nhau là site1.example.com site2.example.com

    <VirtualHost *:80>
    ServerAdmin webmaster@site1.example.com
    DocumentRoot “C:/wamp/www/drupal-7.0”
    ServerName site1.example.com
    ServerAlias www.site1.example.com
        ErrorLog “c:/wamp/logs/site1.example.com-error.log”
    CustomLog “c:/wamp/logs/site1.example.com-access.log” common
    </VirtualHost>

    <VirtualHost *:80>
    ServerAdmin webmaster@site2.example.com
    DocumentRoot “C:/wamp/www/drupal-7.0”
    ServerName site2.example.com
    ServerAlias www.site2.example.com
        ErrorLog “c:/wamp/logs/site2.example.com-error.log”
    CustomLog “c:/wamp/logs/site2.example.com-access.log” common
    </VirtualHost>

    <VirtualHost *:80>
    ServerAdmin webmaster@site2.example.com
    DocumentRoot “C:/wamp/www”
    ServerName localhost
    ErrorLog “c:/wamp/logs/error.log”
    CustomLog “c:/wamp/logs/access.log” common
    </VirtualHost>

About Terri

System Administrator @Netpower Datacenter

Posted on 24.09.2012, in Technical Articles, Windows and tagged , , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: