Versionsunterschiede von Test Server / Setting Up Virtual Hosts




← Vorherige Änderung
Nächste Änderung →




16 16
17 Create a new file in the above mentioned directory by using the following command. 17 Create a new file in the above mentioned directory by using the following command.
18 18
19 %% echo -e '<html>\n<html>\n\t<body>\n\t\t<h1>MyWiki Works!</h1>\n\t</body>\n</html>' > /srv/www/htdocs/myproject/index.html %% 19 %% echo -e '<html>\n<html>\n\t<body>\n\t\t<h1>Welcome World!</h1>\n\t</body>\n</html>' > /srv/www/htdocs/myproject/index.html %%
20 20
21 Create a new virtualhost configuration file in the below mentioned directory and configure it as follows. 21 Create a new virtualhost configuration file in the below mentioned directory and configure it as follows.
22 22
23 /etc/apache2/conf.d/vhost.conf 23 /etc/apache2/conf.d/vhost.conf
24 24
25 %% sudo su%% 25 %% sudo su%%
26 %%echo -e 'DocumentRoot "srv/www/htdocs/site1"\nServerName "www.linuxhelp1.com"' > /etc/apache2/conf.d/vhost.conf %% 26 %%echo -e 'DocumentRoot "srv/www/htdocs/myproject"\nServerName "myproject"' > /etc/apache2/conf.d/vhost.conf %%
27 27
28 Did it work? 28 Did it work?
29 %% cat /etc/apache2/conf.d/vhost.conf%% 29 %% cat /etc/apache2/conf.d/vhost.conf%%
30 %% 30
31 DocumentRoot "srv/www/htdocs/site1" 31
32 ServerName "www.linuxhelp1.com" %% 32 You should see
    33
    34 %% DocumentRoot "srv/www/htdocs/site1"
    35  ServerName "www.linuxhelp1.com" %%
33 36
34 37
35 ---- 38 ----
36 39
    40
37 /etc/hosts 41 /etc/hosts
    42
    43
    44 /etc/apache2/httpd.conf
38 /etc/apache2/conf.d/vhost.conf 45 /etc/apache2/conf.d/vhost.conf
    46 /etc/apache2/vhosts.d/*.conf
    47
    48
    49 /etc/apache2/default-server.conf
    50
39 51
40 52
41 **/opt/lampp/etc/httpd.conf** 53 **/opt/lampp/etc/httpd.conf**