-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathlocalhost-setup-readme
More file actions
49 lines (34 loc) · 1.96 KB
/
localhost-setup-readme
File metadata and controls
49 lines (34 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
## Multilingual localhost setup
To set up localhost test environment, virtual hosts should be created for each domain / locale.
For example, you want to view your site by visiting:
http://localhost/silverstripe-site
http://localhost-fr/silverstripe-site
http://localhost-de/silverstripe-site
Basic MAMP instructions:
1. open terminal, sudo nano /private/etc/hosts (WAMP: C:\Windows\System32\drivers\etc\hosts)
2. create a alternative localhost for each language, for example, add:
127.0.0.1 localhost-de
127.0.0.1 localhost-jp
3. exit (ctrl+x, and save)
4. create a text file: touch /Application/MAMP/conf/apache/vhosts.conf (WAMP: C:\wamp\bin\apache\apache2.2.22\conf\vhosts.conf)
5. In the new vhosts.conf file, add a VirtualHost block for each new domain, should look something like this:
<VirtualHost *:port>
ServerName localhost-domain
DocumentRoot /path/to/www/root/
<Directory /path/to/www/root/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
5a. Replace 'localhost-domain' with your localhost (example: localhost-de)
5b. Replace 'port' to match your port (80 for default, 8888 for alternative).. if you dont know what this is, open MAMP control panel, open preferences, select Ports, and use the apache port.
5c. Replace '/path/to/www/root/' with the absolute path to your local www root. default MAMP path is '/Applications/MAMP/htdocs/', could be '/Users/[you]/Sites'. if you dont know what this is, copy this from MAMP control panel -> preferences -> Apache -> Document Root.
6. Open /Applications/MAMP/conf/apache/httpd.conf
7. at the end of the document, add the following:
NameVirtualHost *:port
Include /Applications/MAMP/conf/apache/vhosts.conf
8. Replace 'port' with the apache port you are using.
9. Restart MAMP.
10. test new localhost-domains (http://localhost-de:8888/). you should see the same thing as http://localhost:8888/