1 |
michael@×××××××××××××.com wrote: |
2 |
> Hi, |
3 |
> |
4 |
> I want to serve web pages for multiple virtual domains from my gentoo |
5 |
> box. The latest howto I could find |
6 |
> (http://gentoo-wiki.com/HOWTO_Linux_Virtual_Server#Apache.2C_mod_php.2C_and_PHP) |
7 |
> |
8 |
> admits that it is out of date relative to the gentoo apach2 package. |
9 |
> |
10 |
> Does anyone know of a more recent howto, or have any other tips? Last |
11 |
> time I implemented a virtual domains web server was on redhat 8 with |
12 |
> apache 1. I'm sure things have changed. |
13 |
> |
14 |
> Thanks, |
15 |
> Michael |
16 |
|
17 |
This is a snippet of the config running here, don't take it as a cut and |
18 |
paste ready because it survived to many upgrades and may be dirty, |
19 |
instead you could mix it with the nice manuals you just readed ;-) |
20 |
And the double network is because it's actually serving on two ips, you |
21 |
may need ust one. |
22 |
|
23 |
|
24 |
[/etc/apache2] |
25 |
./mime.types |
26 |
./magic |
27 |
./modules.d |
28 |
./modules.d/70_mod_php5.conf |
29 |
./modules.d/46_mod_ldap.conf |
30 |
./modules.d/40_mod_ssl.conf |
31 |
./modules.d/41_mod_ssl.default-vhost.conf |
32 |
./apache2-builtin-mods |
33 |
./vhosts.d |
34 |
./vhosts.d/vhosts.conf |
35 |
./httpd.conf |
36 |
./ssl |
37 |
./ssl/.keep |
38 |
./ssl/server.csr |
39 |
./ssl/server.key |
40 |
./ssl/server.crt |
41 |
./conf -> . |
42 |
|
43 |
|
44 |
|
45 |
|
46 |
<FILE httpd.conf> |
47 |
# |
48 |
# Gentoo VHosts |
49 |
# |
50 |
# For Gentoo we include External Virtual Hosts Files. |
51 |
# Please see vhosts.d/00_default_vhost.conf for the default virtual host. |
52 |
# |
53 |
Include /etc/apache2/vhosts.d/*.conf |
54 |
</FILE httpd.conf> |
55 |
|
56 |
|
57 |
<FILE vhosts.d/vhosts.conf> |
58 |
|
59 |
NameVirtualHost 192.168.100.80:80 |
60 |
NameVirtualHost 192.168.101.80:80 |
61 |
|
62 |
<VirtualHost 192.168.100.80:80 192.168.101.80:80> |
63 |
|
64 |
ErrorLog logs/www.mydomain1.tld_error |
65 |
CustomLog logs/www.mydomain1.tld_log common |
66 |
CustomLog logs/www.mydomain1.tld_referer referer |
67 |
|
68 |
DocumentRoot "/srv/www/www.mydomain1.tld" |
69 |
|
70 |
[...] |
71 |
</VirtualHost> |
72 |
|
73 |
<VirtualHost 192.168.100.80:80 192.168.101.80:80> |
74 |
ServerName www.mydomain2.tld |
75 |
ServerAlias si.pnp |
76 |
|
77 |
DocumentRoot /srv/www/si.pnp |
78 |
|
79 |
ErrorLog logs/www.mydomain2.tld_error |
80 |
CustomLog logs/www.mydomain2.tld_log common |
81 |
CustomLog logs/www.mydomain2.tld_referer referer |
82 |
</VirtualHost> |
83 |
|
84 |
## SSL ############################################### |
85 |
|
86 |
<VirtualHost 192.168.4.80:443 192.168.5.80:443> |
87 |
|
88 |
ErrorLog logs/https.mydomain3.tld_error |
89 |
CustomLog logs/https.mydomain3.tld_log common |
90 |
CustomLog logs/https.mydomain3.tld_referer referer |
91 |
|
92 |
SSLEngine on |
93 |
SSLCipherSuite |
94 |
ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL |
95 |
SSLCertificateFile conf/ssl/server.crt |
96 |
SSLCertificateKeyFile conf/ssl/server.key |
97 |
|
98 |
<Files ~ "\.(cgi|shtml|phtml|php?)$"> |
99 |
SSLOptions +StdEnvVars |
100 |
</Files> |
101 |
|
102 |
<Directory "/var/www/localhost/cgi-bin"> |
103 |
SSLOptions +StdEnvVars |
104 |
</Directory> |
105 |
|
106 |
<IfModule mod_setenvif.c> |
107 |
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown \ |
108 |
downgrade-1.0 force-response-1.0 |
109 |
</IfModule> |
110 |
|
111 |
<IfModule mod_log_config.c> |
112 |
CustomLog logs/ssl_request_log \ |
113 |
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" |
114 |
</IfModule> |
115 |
|
116 |
<IfModule mod_rewrite.c> |
117 |
RewriteEngine On |
118 |
RewriteOptions inherit |
119 |
</IfModule> |
120 |
|
121 |
</FILE vhosts.d/vhosts.conf> |
122 |
|
123 |
|
124 |
regards, |
125 |
Francesco R. |
126 |
-- |
127 |
gentoo-user@g.o mailing list |