Mi serverebbe un po' di aiuto per la configurazione apache2 di un home server.
Spero possiate aiutarmi lo stesso anche se non uso Ubuntu (ma Fedora X86_64)
perchè di server non si parla tanto in giro per i forums.
Il caso è questo : ho una macchina virtuale
con 3 schede di rete bridged e di conseguenza 3 ip del tipo 192.168.1.x .
Dopo aver installato i vari server (web, mail, ftp, ecc) ho installato
Ispconfig control panel e creato 2 siti:
1) server1.domain.com sull'ip 192.168.1.101 con SSL e certificato proprio.
2) server2.domain.org sull'ip 192.168.1.102 sempre con SSL e certificato.
Premetto che per l'ip dinamico utilizzo un servizio No-ip (DDNS) e che questo server viene utilizzato puramente
per lo sviluppo di siti web in locale ma volevo testarne la connettività anche da remoto.
Ora: ho modificato la configurazione di httpd (apache2) così :
Codice: Seleziona tutto
# file /etc/httpd/conf/vhosts/Vhosts_ispconfig.conf (sezioni SSL)
...
<IfModule mod_ssl.c>
<VirtualHost 192.168.1.101:443>
ServerName server1.domain.com:443
ServerAdmin webmaster@server1.domain.com
DocumentRoot /var/www/web2/ssl
ServerAlias domain.com
DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
Alias /cgi-bin/ /var/www/web2/cgi-bin/
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
ErrorLog /var/www/web2/log/error.log
AddType application/x-httpd-php .php .php3 .php4 .php5
php_admin_flag safe_mode Off
<IfModule mod_ruby.c>
<Directory /var/www/web2/ssl>
Options +ExecCGI
</Directory>
RubyRequire apache/ruby-run
#RubySafeLevel 0
<Files *.rb>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Files>
<Files *.rbx>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Files>
</IfModule>
<IfModule mod_python.c>
<Directory /var/www/web2/ssl>
Options +Indexes +FollowSymLinks
AllowOverride None
Order allow,deny
allow from all
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On
</Directory>
</IfModule>
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
SSLEngine on
SSLCertificateFile /var/www/web2/ssl/server1.domain.com.crt
SSLCertificateKeyFile /var/www/web2/ssl/server1.domain.com.key
Alias /stats "/var/www/web2/web/webalizer"
Alias /error/ "/var/www/web2/web/error/"
ErrorDocument 400 /error/invalidSyntax.html
ErrorDocument 401 /error/authorizationRequired.html
ErrorDocument 403 /error/forbidden.html
ErrorDocument 404 /error/fileNotFound.html
ErrorDocument 405 /error/methodNotAllowed.html
ErrorDocument 500 /error/internalServerError.html
ErrorDocument 503 /error/overloaded.html
AliasMatch ^/~([^/]+)(/(.*))? /var/www/web2/user/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web2/user/$1/web/$3
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
</IfModule>
</VirtualHost>
</IfModule>
...
<IfModule mod_ssl.c>
<VirtualHost 192.168.1.102:443>
ServerName server2.domain.org:443
ServerAdmin webmaster@server2.domain.org
DocumentRoot /var/www/web3/ssl
ServerAlias domain.org
DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
Alias /cgi-bin/ /var/www/web3/cgi-bin/
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
ErrorLog /var/www/web3/log/error.log
AddType application/x-httpd-php .php .php3 .php4 .php5
php_admin_flag safe_mode Off
<IfModule mod_ruby.c>
<Directory /var/www/web3/ssl>
Options +ExecCGI
</Directory>
RubyRequire apache/ruby-run
#RubySafeLevel 0
<Files *.rb>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Files>
<Files *.rbx>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Files>
</IfModule>
<IfModule mod_python.c>
<Directory /var/www/web3/ssl>
Options +Indexes +FollowSymLinks
AllowOverride None
Order allow,deny
allow from all
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On
</Directory>
</IfModule>
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
SSLEngine on
SSLCertificateFile /var/www/web3/ssl/server2.domain.org.crt
SSLCertificateKeyFile /var/www/web3/ssl/server2.domain.org.key
Alias /stats "/var/www/web3/web/webalizer"
Alias /error/ "/var/www/web3/web/error/"
ErrorDocument 400 /error/invalidSyntax.html
ErrorDocument 401 /error/authorizationRequired.html
ErrorDocument 403 /error/forbidden.html
ErrorDocument 404 /error/fileNotFound.html
ErrorDocument 405 /error/methodNotAllowed.html
ErrorDocument 500 /error/internalServerError.html
ErrorDocument 503 /error/overloaded.html
AliasMatch ^/~([^/]+)(/(.*))? /var/www/web3/user/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web3/user/$1/web/$3
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
</IfModule>
</VirtualHost>
</IfModule>
Stò pensando di modificare anche il file /etc/httpd/conf.d/ssl.conf (ispconfig usa un suo file di configurazione ) e quindi non so se questo file "entra" o meno nelle opzioni che apache utilizza..
So che non ho IP privati ma solo quelli della mia Lan e quindi il progetto è molto aleatorio e vorrei sapere se sto camminando sulla strada giusta o è meglio che abbandoni la speranza di avere una minima connettività da remoto.
Comunque grazie e spero che questo forum rimanga sempre cosi' cioè GRANDE!!
