1

First: I am pretty new to Linux/Apache

My problem: I am trying to acces my forum via the subdomain forum.lumix-transporte.de. Usually you can acess it with lumix-transporte.de/forum.

My forum.conf file:

<VirtualHost *:80>

        ServerName forum.lumix-transporte.de
        ServerAdmin [email protected]

        DocumentRoot /var/www/forum

        <Directory /var/www/forum>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
        </Directory>

</VirtualHost>

When I am trying to access the forum with forum.lumix-transporte.de I am being redirected lumix-transporte.de so to the default Apache2 page "It works!". Also the Icon of the Software is shown in the Tab.

default file in /etc/apache2/sites-available:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

After executing the 2 commands that were suggested by jacek.ciach 3:

root@lumix-transporte:/etc/apache2# grep -R Redirect *
root@lumix-transporte:/etc/apache2# grep -R lumix-transporte.de *
sites-available/default:        ServerName lumix-transporte.de
sites-available/forum.conf:     ServerName forum.lumix-transporte.de
sites-available/forum.conf:     ServerAdmin [email protected]
sites-enabled/forum.conf:       ServerName forum.lumix-transporte.de
sites-enabled/forum.conf:       ServerAdmin [email protected]
sites-enabled/000-default:      ServerName lumix-transporte.de

//After changing via phpmyadmin in the database wcf, the table wcf1_application and changing the domainpath from /forum to / and the domainname from lumix-transporte.de to forum.lumix-transporte.de it is finally working. Thank you jacek.ciach for saying that it may be caused by the forum itself. I found that after googling some more.

2 Answers 2

0

1st solution

Check also the order in which your *.conf files are processed.

If a .conf for *.lumix-transporte.de is ,,run'' before forum.conf and has a sort of redirection directive, then the forum.conf will never be even processed.

So you can change the order (for example by changing the name of forum.conf to 000-forum.conf) or, what is better in my opinion, modify .conf for *.lumix-transporte.de in such a way, that it won't conflict with forum.conf (look at ServerName and ServerAlias for wildcards and check directives which may cause a redirect).

2nd solution

In default there's no ServerName, so when Apache processes default before forum.conf, then it sends to a client the website under /var/www.

Add ServerName lumix-transporte.de (in <VirtualHost>) to default and restart Apache.

3rd solution

It seems, that the forum itself causes the redirection. (Check response header of http://forum.lumix-transporte.de/ with i.e. http://web-sniffer.net/ and you'll see...).

15
  • I dont have a conf for lumix-transporte.de . I only have an A-Record for lumix-transporte.de so *.lumix-transporte.de. But the weird thing is that I tried that with phpmyadmin already and it worked properly.
    – Splixz
    Commented Jun 14, 2015 at 18:15
  • Could you explain what have you tried with phpMyAdmin? Commented Jun 14, 2015 at 18:20
  • Even there's not a .conf for *.lumix-transporte.de, your Apache has something that can be called ,,global'' or ,,main'' config file. Commented Jun 14, 2015 at 18:22
  • Where is this located? (As I said already I am pretty new) Is it the apache2.conf?
    – Splixz
    Commented Jun 14, 2015 at 18:25
  • I just tried if the vHost would work at all
    – Splixz
    Commented Jun 14, 2015 at 18:27
0

Have a look at the DirectoryIndex directive of Apache. Your forum probably does using something different than the default index.html.

See http://httpd.apache.org/docs/2.4/mod/mod_dir.html for more information.

3
  • Yes. It isn't index.html, it is index.php. Now my forum.conf looks like that: <VirtualHost *:80> ServerName forum.lumix-transporte.de ServerAdmin [email protected] DocumentRoot /var/www/forum <Directory /var/www/forum> Options Indexes FollowSymLinks MultiViews AllowOverride All DirectoryIndex index.php </Directory> </VirtualHost> The problem is still there.
    – Splixz
    Commented Jun 14, 2015 at 18:08
  • And you know you have php installed and restarted Apache after the configuration changes?
    – Lambert
    Commented Jun 14, 2015 at 18:36
  • Sure i have installed php. I have reloaded apache after changing the .conf file. // Restarted apache now too, the problem still exists.
    – Splixz
    Commented Jun 14, 2015 at 18:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .