App Name aus URL entfernen

X3TitanCore

Bekanntes Mitglied
Hallo!

Ich hab folgendes Problem. Jeder Link auf eine App in Tomcat beinhaltet den Verzeichnisnamen.

z.B. http://www.domain.de/AppName/index.jsp

Ich bekomme es einfach nicht hin über mod_rewrite dieses AppName verschwinden zu lassen und möchte die App auch nicht in ROOT laufen lassen. Gleichzeitig sollen alle Anfragen auf https umgeleitet werden.

Vor dem Tomcat befindet sich ein Apache Webserver.

Kann mir da jemand helfen?
 

X3TitanCore

Bekanntes Mitglied
So, hier ist die conf.

[XML]
<IfModule mod_ssl.c>

<VirtualHost 85.214.74.236:443>
ServerName web2touch.net:443
ServerAlias www.web2touch.net
UseCanonicalName Off
SuexecUserGroup web2touchadmin psacln
ServerAdmin admin@neuron-processing.eu
DocumentRoot /srv/www/vhosts/web2touch.net/httpdocs
CustomLog /srv/www/vhosts/web2touch.net/statistics/logs/access_ssl_log plesklog
ErrorLog /srv/www/vhosts/web2touch.net/statistics/logs/error_log
<IfModule mod_userdir.c>
UserDir /srv/www/vhosts/web2touch.net/web_users
</IfModule>
ScriptAlias /mivavm /usr/bin/mivavm
SetEnv MvCONFIG_DIR_MIVA /srv/www/vhosts/web2touch.net/httpdocs
SetEnv MvCONFIG_DIR_DATA /srv/www/vhosts/web2touch.net/mivadata
SetEnv MvCONFIG_DIR_CA /usr/share/miva/certs
SetEnv MvCONFIG_LIBRARY /usr/lib/miva/config/env.so
SetEnv MvCONFIG_DIR_BUILTIN /usr/lib/miva/builtins
SetEnv MvCONFIG_DATABASE_MIVASQL /usr/lib/miva/databases/mivasql.so
SetEnv MvCONFIG_SSL_OPENSSL /usr/lib/libssl.so.0.9.8
SetEnv MvCONFIG_SSL_CRYPTO /usr/lib/libcrypto.so.0.9.8
SetEnv MvCONFIG_COMMERCE_AuthorizeNet /usr/lib/miva/commerce/authnet.so
SetEnv MvCONFIG_COMMERCE_CyberCash /usr/lib/miva/commerce/cybercash.so
SetEnv MvCONFIG_COMMERCE_LinkPoint /usr/lib/miva/commerce/linkpoint.so
SetEnv MvCONFIG_COMMERCE_ICS2 /usr/lib/miva/commerce/ics2.so
SetEnv MvCONFIG_FLAGS_SECURITY 23
AddType application/x-miva-compiled .mvc
Action application/x-miva-compiled /mivavm
<Directory /usr/bin>
<Files mivavm>
order allow,deny
Allow from all
</Files>
</Directory>
SetEnv MvCONFIG_DIR_USER ./
Alias /plesk-stat /srv/www/vhosts/web2touch.net/statistics/
<Location /plesk-stat/>
Options +Indexes
</Location>
<Location /plesk-stat/logs/>
Require valid-user
</Location>
Alias /webstat /srv/www/vhosts/web2touch.net/statistics/webstat
Alias /webstat-ssl /srv/www/vhosts/web2touch.net/statistics/webstat-ssl
Alias /ftpstat /srv/www/vhosts/web2touch.net/statistics/ftpstat
Alias /anon_ftpstat /srv/www/vhosts/web2touch.net/statistics/anon_ftpstat
Alias /awstats-icon /usr/share/apache2/icons/awstats
SSLEngine on
SSLVerifyClient none
SSLCertificateFile /usr/local/psa/var/certificates/cert-jcBWV0
<Directory /srv/www/vhosts/web2touch.net/httpdocs>
<IfModule sapi_apache2.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/srv/www/vhosts/web2touch.net/httpdocs:/tmp"
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/srv/www/vhosts/web2touch.net/httpdocs:/tmp"
</IfModule>
SSLRequireSSL
Options -Includes -ExecCGI
</Directory>
<Directory /srv/www/vhosts/web2touch.net/web_users>
<IfModule sapi_apache2.c>
php_admin_flag engine off
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine off
</IfModule>
</Directory>
Alias "/error_docs" "/srv/www/vhosts/web2touch.net/error_docs"
ErrorDocument 400 /error_docs/bad_request.html
ErrorDocument 401 /error_docs/unauthorized.html
ErrorDocument 403 /error_docs/forbidden.html
ErrorDocument 404 /error_docs/not_found.html
ErrorDocument 500 /error_docs/internal_server_error.html
ErrorDocument 405 /error_docs/method_not_allowed.html
ErrorDocument 406 /error_docs/not_acceptable.html
ErrorDocument 407 /error_docs/proxy_authentication_required.html
ErrorDocument 412 /error_docs/precondition_failed.html
ErrorDocument 415 /error_docs/unsupported_media_type.html
ErrorDocument 501 /error_docs/not_implemented.html
ErrorDocument 502 /error_docs/bad_gateway.html
Include /srv/www/vhosts/web2touch.net/conf/vhost_ssl.conf
</VirtualHost>

</IfModule>

<VirtualHost 85.214.74.236:80>
ServerName web2touch.net:80
ServerAlias www.web2touch.net
UseCanonicalName Off
SuexecUserGroup web2touchadmin psacln
ServerAdmin "admin@neuron-processing.eu"
DocumentRoot /srv/www/vhosts/web2touch.net/httpdocs
CustomLog /srv/www/vhosts/web2touch.net/statistics/logs/access_log plesklog
ErrorLog /srv/www/vhosts/web2touch.net/statistics/logs/error_log
<IfModule mod_userdir.c>
UserDir /srv/www/vhosts/web2touch.net/web_users
</IfModule>
ScriptAlias /mivavm /usr/bin/mivavm
SetEnv MvCONFIG_DIR_MIVA /srv/www/vhosts/web2touch.net/httpdocs
SetEnv MvCONFIG_DIR_DATA /srv/www/vhosts/web2touch.net/mivadata
SetEnv MvCONFIG_DIR_CA /usr/share/miva/certs
SetEnv MvCONFIG_LIBRARY /usr/lib/miva/config/env.so
SetEnv MvCONFIG_DIR_BUILTIN /usr/lib/miva/builtins
SetEnv MvCONFIG_DATABASE_MIVASQL /usr/lib/miva/databases/mivasql.so
SetEnv MvCONFIG_SSL_OPENSSL /usr/lib/libssl.so.0.9.8
SetEnv MvCONFIG_SSL_CRYPTO /usr/lib/libcrypto.so.0.9.8
SetEnv MvCONFIG_COMMERCE_AuthorizeNet /usr/lib/miva/commerce/authnet.so
SetEnv MvCONFIG_COMMERCE_CyberCash /usr/lib/miva/commerce/cybercash.so
SetEnv MvCONFIG_COMMERCE_LinkPoint /usr/lib/miva/commerce/linkpoint.so
SetEnv MvCONFIG_COMMERCE_ICS2 /usr/lib/miva/commerce/ics2.so
SetEnv MvCONFIG_FLAGS_SECURITY 23
AddType application/x-miva-compiled .mvc
Action application/x-miva-compiled /mivavm
<Directory /usr/bin>
<Files mivavm>
order allow,deny
Allow from all
</Files>
</Directory>
SetEnv MvCONFIG_DIR_USER ./
Redirect permanent /plesk-stat https://web2touch.net/plesk-stat
Redirect permanent /webstat https://web2touch.net/webstat
Redirect permanent /webstat-ssl https://web2touch.net/webstat-ssl
Redirect permanent /ftpstat https://web2touch.net/ftpstat
Redirect permanent /anon_ftpstat https://web2touch.net/anon_ftpstat
Redirect permanent /awstats-icon https://web2touch.net/awstats-icon
<IfModule mod_ssl.c>
SSLEngine off
</IfModule>
<Directory /srv/www/vhosts/web2touch.net/httpdocs>
<IfModule sapi_apache2.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/srv/www/vhosts/web2touch.net/httpdocs:/tmp"
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/srv/www/vhosts/web2touch.net/httpdocs:/tmp"
</IfModule>
Options -Includes -ExecCGI
</Directory>
<Directory /srv/www/vhosts/web2touch.net/web_users>
<IfModule sapi_apache2.c>
php_admin_flag engine off
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine off
</IfModule>
</Directory>
Alias "/error_docs" "/srv/www/vhosts/web2touch.net/error_docs"
ErrorDocument 400 /error_docs/bad_request.html
ErrorDocument 401 /error_docs/unauthorized.html
ErrorDocument 403 /error_docs/forbidden.html
ErrorDocument 404 /error_docs/not_found.html
ErrorDocument 500 /error_docs/internal_server_error.html
ErrorDocument 405 /error_docs/method_not_allowed.html
ErrorDocument 406 /error_docs/not_acceptable.html
ErrorDocument 407 /error_docs/proxy_authentication_required.html
ErrorDocument 412 /error_docs/precondition_failed.html
ErrorDocument 415 /error_docs/unsupported_media_type.html
ErrorDocument 501 /error_docs/not_implemented.html
ErrorDocument 502 /error_docs/bad_gateway.html
Include /srv/www/vhosts/web2touch.net/conf/vhost.conf
</VirtualHost>

[/XML]
 
Zuletzt bearbeitet:

TheDarkRose

Gesperrter Benutzer
Mal abgesehen davon, das die Config grauenhaft und zum kotzen ist (naja, was will man von Plesk erwarten), ist hier absolut kein Hinweis auf den Apache. Poste mal den Inhalt von /srv/www/vhosts/web2touch.net/conf/vhost.conf
 

X3TitanCore

Bekanntes Mitglied
Da hast du Recht. Krieg auch immer das gruseln wenn ich da rein muss.

vhost.conf enthält nur folgendes

JkMount /Web2Touch/* web2touch
 

TheDarkRose

Gesperrter Benutzer
Das alles mit der relativen URL /Web2Touch/* an deinen Tomcat worker web2touch geht. Also: [c]JkMount /* web2touch[/c] sollte Abhilfe schaffen.

Ich weiß ja nicht, wer deinen Server administriert, aber desweiteren solltet ihr (falls installiert) Samba deinstallieren, Dienste wie MySQL, PostgreSQL und den Tomcat nur an localhost binden.
 

X3TitanCore

Bekanntes Mitglied
Ja, Samba ist drauf, nutzt aber keiner, genauso wie PostgreSQL.

Hab das jetzt mal geändert. Geht leider nicht. Jetzt lande ich im ROOT des Tomcat bzw. seiner Startseite.
 

TheDarkRose

Gesperrter Benutzer
Warum ist Samba drauf? Hat auf einen Server überhaupt keinen Sinn. Alles was nicht genutzt wird, deinstallieren!

Hmm, ich hab auch nur kurz die Doku von mod_jk durchgeschaut. Selbst leider auch noch nie angewendet.
 

X3TitanCore

Bekanntes Mitglied
Also meine letzt Variante wenn nix anderes geht ist die App als ROOT laufen zu lassen. Das hab ich ja eben gesehen das das gehen würde.
 

krazun

Bekanntes Mitglied
Genau das gleiche Problem hatte ich auch und habe es mit JkMount in verbindung mit der RewriteEngine gelöst.

folgende Module aktivieren:

Code:
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule jk_module modules/mod_jk.so

und dann der entsprechende Teil der httpd.conf:

Code:
JkWorkersFile C:\Apache2.2\conf\workers.properties

JkShmFile C:\Apache2.2\logs\mod_jk.shm
JkLogFile C:\Apache2.2\logs\mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkMount /AppName/* worker1

RewriteEngine on
RewriteRule ^/$ /AppName/Main [R]

Vielleicht hilft dir das ja weiter.

Hier: mod_rewrite - Apache HTTP Server gibts übrigens ausführlichere Infos zu mod_rewrite allgemein und zu Rewriting in Virtual Hosts im speziellen.

mfg,
krazun
 
Zuletzt bearbeitet:

Neue Themen


Oben