Redirect von einem zum anderen Verzeichnis

Alles, was den Apache betrifft, kann hier besprochen werden.

Re: Redirect von einem zum anderen Verzeichnis

Postby borobudur » 27. January 2009 21:52

Linux Ubuntu Server 8.04

In apache.conf finde ich dies (auskommentiert):
Code: Select all
# The internationalized error documents require mod_alias, mod_include
# and mod_negotiation.  To activate them, uncomment the following 30 lines.

#    Alias /error/ "/usr/share/apache2/error/"
#
#    <Directory "/usr/share/apache2/error">
#        AllowOverride None
#        Options IncludesNoExec
#        AddOutputFilter Includes html
#        AddHandler type-map var
#        Order allow,deny
#        Allow from all
#        LanguagePriority en cs de es fr it nl sv pt-br ro
#        ForceLanguagePriority Prefer Fallback
#    </Directory>
borobudur
 
Posts: 20
Joined: 27. January 2009 17:21

Re: Redirect von einem zum anderen Verzeichnis

Postby glitzi85 » 27. January 2009 22:03

OK, bitte mal den Inhalt jeder Datei aus dem Ordner /etc/apache2 hier posten. Die Konfigurationsaufteilung vom Apachen in Debian/Ubuntu fand ich schon immer bescheuert...

mfg glitzi

Edit: Und auch die Unterordner!
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Re: Redirect von einem zum anderen Verzeichnis

Postby borobudur » 27. January 2009 22:12

Ist ein bisschen viel. Welche datei hätten's denn gern?
Code: Select all
-rw-r--r-- 1 root root 10587 2008-05-14 09:58 apache2.conf
-rw-r--r-- 1 root root 24576 2008-11-04 16:54 .apache2.conf.swp
drwxr-xr-x 2 root root  4096 2009-01-20 12:05 conf.d
-rw-r--r-- 1 root root   378 2008-05-14 09:58 envvars
-rw-r--r-- 1 root root     0 2008-08-14 08:59 http.conf
-rw-r--r-- 1 root root  1340 2009-01-27 11:33 httpd.conf
-rw-r--r-- 1 root root  1119 2009-01-20 12:12 httpd.conf_backup
drwxr-xr-x 2 root root  4096 2008-12-29 10:34 mods-available
drwxr-xr-x 2 root root  4096 2009-01-17 10:20 mods-enabled
-rw-r--r-- 1 root root    59 2008-05-14 09:58 ports.conf
drwxr-xr-x 2 root root  4096 2009-01-27 14:17 sites-available
drwxr-xr-x 2 root root  4096 2008-05-31 20:50 sites-enabled
borobudur
 
Posts: 20
Joined: 27. January 2009 17:21

Re: Redirect von einem zum anderen Verzeichnis

Postby glitzi85 » 27. January 2009 22:26

httpd.conf_backup
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Re: Redirect von einem zum anderen Verzeichnis

Postby borobudur » 27. January 2009 22:30

httpd.conf_backup sieht gleich aus wie httpd.conf. Ursprünglich war httpd.conf leer.
borobudur
 
Posts: 20
Joined: 27. January 2009 17:21

Re: Redirect von einem zum anderen Verzeichnis

Postby glitzi85 » 27. January 2009 22:52

OK, seh grad dass du ja nur einen Ausschnitt aus der apache2.conf gepostet hast, dann bitte mal die hier posten.

mfg glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Re: Redirect von einem zum anderen Verzeichnis

Postby borobudur » 28. January 2009 08:22

Code: Select all
#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.2/ for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned. 
#
# The configuration directives are grouped into three basic sections:
#  1. Directives that control the operation of the Apache server process as a
#     whole (the 'global environment').
#  2. Directives that define the parameters of the 'main' or 'default' server,
#     which responds to requests that aren't handled by a virtual host.
#     These directives also provide default values for the settings
#     of all virtual hosts.
#  3. Settings for virtual hosts, which allow Web requests to be sent to
#     different IP addresses or hostnames and have them handled by the
#     same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "/var/log/apache2/foo.log"
# with ServerRoot set to "" will be interpreted by the
# server as "//var/log/apache2/foo.log".
#

### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation (available
# at <URL:http://httpd.apache.org/docs-2.1/mod/mpm_common.html#lockfile>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
ServerRoot "/etc/apache2"

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
#<IfModule !mpm_winnt.c>
#<IfModule !mpm_netware.c>
LockFile /var/lock/apache2/accept.lock
#</IfModule>
#</IfModule>

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15

##
## Server-Pool Size Regulation (MPM specific)
##

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_worker_module>
    StartServers          2
    MaxClients          150
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadsPerChild      25
    MaxRequestsPerChild   0
</IfModule>

# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#

AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

#
# DefaultType is the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value.  If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain


#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog /var/log/apache2/error.log

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

# Include module configuration:
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf

# Include all the user configurations:
Include /etc/apache2/httpd.conf

# Include ports listing
Include /etc/apache2/ports.conf

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
# If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

#
# ServerTokens
# This directive configures what you return as the Server HTTP response
# Header. The default is 'Full' which sends information about the OS-Type
# and compiled in modules.
# Set to one of:  Full | OS | Minor | Minimal | Major | Prod
# where Full conveys the most information, and Prod the least.
#
ServerTokens Full

#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (internal error documents, FTP directory
# listings, mod_status and mod_info output etc., but not CGI generated
# documents or custom error documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of:  On | Off | EMail
#
ServerSignature On



#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#

#
# Putting this all together, we can internationalize error responses.
#
# We use Alias to redirect any /error/HTTP_<error>.html.var response to
# our collection of by-error message multi-language collections.  We use
# includes to substitute the appropriate text.
#
# You can modify the messages' appearance without changing any of the
# default HTTP_<error>.html.var files by adding the line:
#
#   Alias /error/include/ "/your/include/path/"
#
# which allows you to create your own set of files by starting with the
# /usr/share/apache2/error/include/ files and copying them to /your/include/path/,
# even on a per-VirtualHost basis.  The default include files will display
# your Apache version number and your ServerAdmin email address regardless
# of the setting of ServerSignature.
#
# The internationalized error documents require mod_alias, mod_include
# and mod_negotiation.  To activate them, uncomment the following 30 lines.

#    Alias /error/ "/usr/share/apache2/error/"
#
#    <Directory "/usr/share/apache2/error">
#        AllowOverride None
#        Options IncludesNoExec
#        AddOutputFilter Includes html
#        AddHandler type-map var
#        Order allow,deny
#        Allow from all
#        LanguagePriority en cs de es fr it nl sv pt-br ro
#        ForceLanguagePriority Prefer Fallback
#    </Directory>
#
#    ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
#    ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
#    ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
#    ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
#    ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
#    ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
#    ErrorDocument 410 /error/HTTP_GONE.html.var
#    ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
#    ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
#    ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
#    ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
#    ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
#    ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
#    ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
#    ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
#    ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
#    ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var



# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
Include /etc/apache2/conf.d/

# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/
borobudur
 
Posts: 20
Joined: 27. January 2009 17:21

Re: Redirect von einem zum anderen Verzeichnis

Postby glitzi85 » 28. January 2009 15:15

OK, das war's leider auch nicht. Schau mal im Ordner conf.d nach, was da drin ist. Wenn da mehrere Dateien drin sind, dann führ mal diesen Befehl für jede Datei aus und poste den Inhalt der Datei, in der was gefunden wird:

Code: Select all
cat DATEINAME | grep DocumentRoot


mfg glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Re: Redirect von einem zum anderen Verzeichnis

Postby borobudur » 28. January 2009 15:39

Code: Select all
user@machine:~/etc/apache2/conf.d$ ls -al
total 12
drwxr-xr-x 2 root root 4096 2009-01-20 12:05 .
drwxr-xr-x 7 root root 4096 2009-01-27 22:09 ..
-rw-r--r-- 1 root root  269 2008-05-14 09:58 charset
lrwxrwxrwx 1 root root   28 2009-01-27 22:10 typo3-dummy.conf -> /etc/typo3-dummy/apache.conf

In charset ist nichts und apache.conf von typo3 sieht so aus:
Code: Select all
user@machine:~$ cat /etc/typo3-dummy/apache.conf | grep DocumentRoot
#     DocumentRoot /var/lib/typo3-dummy
borobudur
 
Posts: 20
Joined: 27. January 2009 17:21

Re: Redirect von einem zum anderen Verzeichnis

Postby glitzi85 » 28. January 2009 15:47

So ne verstreute Konfiguration hab ich ja noch nie gesehen, aber es ist Licht am ende des Tunnels :D

Bitte mal den kompletten Inhalt der Datei /etc/typo3-dummy/apache.conf posten.

mfg glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Re: Redirect von einem zum anderen Verzeichnis

Postby borobudur » 28. January 2009 15:58

Code: Select all
# Configuration for the apache web server                 -*- apache -*-

# inspired by /etc/phpldapadmin/apache.conf from the Debian package of
# phpldapadmin (version 0.9.4-10) maintained by Fabio Tranchitella
# <kobold@kobold.it>

# improved through advanced.htaccess from Michael Stucki <mundaun@gmx.ch>


# Define the package aliases.  The following directive defines the
# /TYPO3root as /typo3.  If this is changed, search for
# TYPO3root and adapt the found directives appropriate.

<IfModule mod_alias.c>
    Alias /typo3 /var/lib/typo3-dummy
    #Alias /typo3-dummy /var/lib/typo3-dummy
</IfModule>


# To use TYPO3 as a VirtualHost, comment out and customize the following section
# <VirtualHost *:*>
#     ServerName typo3.example.com
#     ServerAdmin webmaster@example.com
#     DocumentRoot /var/lib/typo3-dummy
#     ErrorLog logs/typo3.example.com-error.log
#     CustomLog logs/typo3.example.com-access.log combined
# </VirtualHost>


<DirectoryMatch /var/lib/typo3-dummy/>

    DirectoryIndex index.php index.html
    # TYPO3 needs files shared between different instances. These are
    # symlinked into the document root directory. The following
    # directive enables that apache follows the symlinks.
    Options +FollowSymLinks
    # disable .htaccess, because it slows down apache
    AllowOverride None

    Order allow,deny
    Allow from all

    ### Begin: PHP optimisation ###
    <IfModule mod_mime.c>
      <IfModule mod_php4.c>
          # enable PHP processing for files ending with .php 
          AddType application/x-httpd-php .php

          # enable safe PHP operation
          php_admin_value safe_mode on
        php_admin_value safe_mode_gid on
          # php_admin_value safe_mode_include_dir /usr/share/typo3/typo3_src-4.1/

          #  Maximum allowed size for uploaded files (PHP defaults to 2MB)
          php_admin_value upload_max_filesize 100M

          # Maximum amount of memory a script may consume (PHP defaults to 8MB)
        # You may want to set this higher as 48 mb if you have problems
        # getting the extension manager to work.
          php_admin_value memory_limit 96M

        # Maximum amount of time a script my consume
        # You may want to set this higher as 30 seconds if you have problems
        # getting the extension manager to work.
          # php_admin_value max_execution_time 90

          # list of directories where require(), include() and fopen_with_path() look for files
          php_admin_value include_path /var/lib/typo3-dummy/:/usr/share/typo3/typo3_src-4.0/:.
          php_admin_value sendmail_path /var/lib/typo3-dummy/execdir/sendmail
         
          # Limit the files that can be opened by PHP to the specified directory-tree(s)
          php_admin_value open_basedir /var/lib/typo3-dummy/:/usr/share/typo3/:/usr/share/typo3-dummy/:/etc/typo3-dummy/:/usr/share/fonts/truetype/ttf-bitstream-vera/

          # in safe mode programs that are not in this directory will not be started
          php_admin_value safe_mode_exec_dir /var/lib/typo3-dummy/execdir/

          # The PHP developers recommend disabling this feature. Do that.
          # It's deprecated and is likely to be unsupported in future
          # versions of PHP.
          php_flag allow_call_time_pass_reference off

          # TYPO3 works fine with register_globals turned off.
          # This is highly recommended!
          php_flag register_globals off

          # PHP may not declare the argv & argc variables (that would
          # contain the GET information).
          # TYPO3 doesn't need this, so just turn it off.
          php_flag register_argc_argv off

          # Magic quotes for runtime-generated data (data from SQL, exec(), etc.)
          php_flag magic_quotes_gpc off

          # Order in which PHP registers GET, POST, Cookie and Built-in variables
          php_value variables_order GPCS

      </IfModule>
      <IfModule mod_php5.c>
          # for hints regarding these options see section above.

          AddType application/x-httpd-php .php
          php_admin_value safe_mode off
        php_admin_value safe_mode_gid on
          # php_admin_value safe_mode_include_dir /usr/share/typo3/typo3_src-4.1/
          php_admin_value upload_max_filesize 100M
          php_admin_value memory_limit 96M
          # php_admin_value max_execution_time 90
          php_admin_value include_path /var/lib/typo3-dummy/:/usr/share/typo3/typo3_src-4.1/:.
          php_admin_value sendmail_path /var/lib/typo3-dummy/execdir/sendmail
          php_admin_value open_basedir /var/lib/typo3-dummy/:/usr/share/typo3/:/etc/typo3-dummy/:/usr/share/fonts/truetype/ttf-bitstream-vera/
          php_admin_value safe_mode_exec_dir /var/lib/typo3-dummy/execdir/
          php_flag allow_call_time_pass_reference off
          php_flag register_globals off
          php_flag register_argc_argv off
          php_flag magic_quotes_gpc off
          php_value variables_order GPCS
      </IfModule>
    </IfModule>
    ### End: PHP optimisation ###


    ### Begin: Rewrite stuff ###
    <IfModule mod_rewrite.c>

        # Enable URL rewriting
        RewriteEngine On

        # To assist in debugging rewriting, you could use these lines
        # DON'T enable it for production!
        # This will only work in httpd.conf, not in .htaccess files
        #RewriteLog /var/log/apache/rewrite.log
        #RewriteLogLevel 9

        # If you use the RealUrl extension, then you'll have to enable the next line.
        # You will have to change this path if your TYPO3 installation is located
        # in a subdirectory of the website root.
        #
        # If you place this in httpd.conf, you cannot use this directive in any case!
        #RewriteBase /

        # Stop rewrite processing if we are in the typo3/ directory
        # For httpd.conf, use this line instead of the next one:
        # RewriteRule ^/TYPO3root/(typo3|typo3temp|typo3conf|t3lib|fileadmin|uploads)/ - [L]
        # RewriteRule ^(typo3|typo3temp|typo3conf|t3lib|fileadmin|uploads)/ - [L]
        RewriteRule ^/typo3/(typo3|typo3temp|typo3conf|t3lib|fileadmin|uploads)/ - [L]
        #RewriteRule ^/typo3-dummy/(typo3|typo3temp|typo3conf|t3lib|fileadmin|uploads)/ - [L]

        # Redirect http://mysite/typo3 to http://mysite/typo3/index_re.php
        # and stop the rewrite processing
        # For httpd.conf, use this line instead of the next one:
        # RewriteRule ^/TYPO3root/typo3$ /TYPO3root/typo3/index.php [L]
        # RewriteRule ^typo3$ typo3/index_re.php [L]
        RewriteRule ^/typo3/typo3$ /typo3/typo3/index.php [L]
        #RewriteRule ^/typo3-dummy/typo3$ /typo3-dummy/typo3/index.php [L]

        # If the file/symlink/directory does not exist => Redirect to index.php
        # Important note: If you copy/paste this into httpd.conf instead
        # of .htaccess you will need to add '%{DOCUMENT_ROOT}' left to each
        # '%{REQUEST_FILENAME}' part.
        RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
        RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
        RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-l

        # Main URL rewriting.

        # If you use Windows and SimulateStaticDocuments do not work, try adding a
        # slash (/) right before 'index.php' below.
       
        # The example shows how to rewrite only *.html and *.pdf files to index.php
        # This may be helpful when using an extension that can generate PDF files
        # on the fly.
        # Example: RewriteRule .*\.(html|pdf)$ index.php [L]

        # For httpd.conf, use this line instead of the next one that has no '#':
        # RewriteRule .* /TYPO3root/index.php [L]

        # For use with the RealUrl extension, you might need to remove the
        # RewriteBase directive somewhere above and use this line instead of the
        # next one:
        # RewriteRule .* /index.php [L]
        # RewriteRule .* index.php [L]
        RewriteRule .* /typo3/index.php [L]
        #RewriteRule .* /typo3-dummy/index.php [L]

        ### End: Rewrite stuff ###
    </IfModule>

</DirectoryMatch>
borobudur
 
Posts: 20
Joined: 27. January 2009 17:21

Re: Redirect von einem zum anderen Verzeichnis

Postby borobudur » 26. February 2009 21:02

Danke, hat sich erledigt. Habe die leute informiert, dass die URL gewechselt hat.
(Linux Debian [Ubuntu])
borobudur
 
Posts: 20
Joined: 27. January 2009 17:21

Previous

Return to Apache

Who is online

Users browsing this forum: No registered users and 35 guests