Deklarasikan beberapa port untuk VirtualHosts yang sama:
SSLStrictSNIVHostCheck off
# Apache setup which will listen for and accept SSL connections on port 443.
Listen 443
# Listen for virtual host requests on all IP addresses
NameVirtualHost *:443
<VirtualHost *:443>
ServerName domain.localhost
DocumentRoot "/Users/<my_user_name>/Sites/domain/public"
<Directory "/Users/<my_user_name>/Sites/domain/public">
Order allow,deny
Allow from all
</Directory>
# SSL Configuration
SSLEngine on
...
</VirtualHost>
Bagaimana saya bisa mendeklarasikan port baru ('dengarkan', ServerName, ...) untuk 'domain.localhost'?
Jika saya menambahkan kode berikut, apache berfungsi (terlalu banyak) juga untuk semua subdomain lain dari 'domain.localhost' (subdomain1.domain.localhost, subdomain2.domain.localhost, ...):
<VirtualHost *:80>
ServerName pjtmain.localhost:80
DocumentRoot "/Users/Toto85/Sites/pjtmain/public"
RackEnv development
<Directory "/Users/Toto85/Sites/pjtmain/public">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>